activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Davies <rajdav...@gmail.com>
Subject Re: Messages dont get redelivered till broker restart - expected behaviour?
Date Wed, 28 May 2008 10:15:23 GMT

On 28 May 2008, at 10:53, Subrata1208 wrote:

>
> i am using activemq 5.1
>
> i am also getting the same problem.
> This is how i am creating factory and connection
> connFactory = new ActiveMQConnectionFactory(url);
> 		
> 				ActiveMQPrefetchPolicy  po = new ActiveMQPrefetchPolicy();
> 		        po.setQueuePrefetch(1);
> 		        connFactory.setPrefetchPolicy(po);	
> 		        RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
>                redeliveryPolicy.setMaximumRedeliveries(-1);
>      	        connFactory.setRedeliveryPolicy(redeliveryPolicy);
>
> and my On message method is ::
> if (msg instanceof TextMessage) {
> 				counter++;
> 				TextMessage mesg = (TextMessage) msg;
> 				if (mesg != null) {
> 					String message = null;
> 					if(mesg != null){
> 						message = mesg.getText();
> 						System.out.println("Text Message Received :: "
> 								+ message);
> 						if(handler != null){
> 							status = handler.handleData(message);
> 							if(status){
> 								session.commit();
> 							} else {
> 								session.rollback();
> 							}
> 						}
> 						message = null;
> 						mesg = null;
> 					}				
> 					
> 				}
> 				return;
> 			}
>
> where there is a prblem with processing a message it is not going to  
> DLQ but
> the message never got consumed until i
> restart the broker.
> -- 
> View this message in context: http://www.nabble.com/Messages-dont-get-redelivered-till-broker-restart---expected-behaviour--tp9615827s2354p17509046.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

What if you get a Message which isn't a TextMessage ?


cheers,

Rob

http://open.iona.com/products/enterprise-activemq
http://rajdavies.blogspot.com/





Mime
View raw message