You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ss2 <sp...@yahoo.com> on 2007/03/22 15:23:43 UTC

Messages dont get redelivered till broker restart - expected behaviour?

I am using Jencks2.0/ActiveMQ4.1/Spring2.0 and am seeing that messages dont
get redelivered till the broker is restarted. Is this is a configuration
setting or is that the normal behaviour for ActiveMQ?
thanks!
-- 
View this message in context: http://www.nabble.com/Messages-dont-get-redelivered-till-broker-restart---expected-behaviour--tf3447871s2354.html#a9615827
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Messages dont get redelivered till broker restart - expected behaviour?

Posted by Subrata1208 <sa...@GMAIL.COM>.

our requirement is for text meesage. We dont have nany problem switching to
other type of message.

and one more thing 
it working for tcp type of connection not for http.

Thanks
Subrata 
-- 
View this message in context: http://www.nabble.com/Messages-dont-get-redelivered-till-broker-restart---expected-behaviour--tp9615827s2354p17509585.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Messages dont get redelivered till broker restart - expected behaviour?

Posted by Dave Syer <da...@hotmail.com>.


ss2 wrote:
> 
> is that the normal behaviour for ActiveMQ?
> 

It depends on whether your session is transactional and if it is being
committed or rolled back.  If you never commit or rollback the session, then
I guess this might be the expected behaviour.

When you say "messages are re-delivered", what do you mean exactly?  In what
circumstances did they fail the first time?
-- 
View this message in context: http://www.nabble.com/Messages-dont-get-redelivered-till-broker-restart---expected-behaviour--tf3447871s2354.html#a9659767
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Messages dont get redelivered till broker restart - expected behaviour?

Posted by James Strachan <ja...@gmail.com>.
I'd recommend trying 4.1.1 which has a few queue dispatch issues fixed
(which could cause the effect your seeing).

On 3/22/07, ss2 <sp...@yahoo.com> wrote:
>
> I am using Jencks2.0/ActiveMQ4.1/Spring2.0 and am seeing that messages dont
> get redelivered till the broker is restarted. Is this is a configuration
> setting or is that the normal behaviour for ActiveMQ?
> thanks!
> --
> View this message in context: http://www.nabble.com/Messages-dont-get-redelivered-till-broker-restart---expected-behaviour--tf3447871s2354.html#a9615827
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Messages dont get redelivered till broker restart - expected behaviour?

Posted by Rob Davies <ra...@gmail.com>.
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/





Re: Messages dont get redelivered till broker restart - expected behaviour?

Posted by Subrata1208 <sa...@GMAIL.COM>.
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.


Re: Messages dont get redelivered till broker restart - expected behaviour?

Posted by "ruben.martin" <ru...@fundacionctic.org>.
We have the same problem with 5.1. Out of some 100 object messages produced,
4 messagges are left (actually leaped because they are generated in the
middle).

When we restart the broker then the massages are read.

The reader in configured with spring. The onMessage method is marked as
transactional.

	<bean id="listenerQueueTawGridResultados"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
		<property name="concurrentConsumers" value="1"/>
		<property name="connectionFactory" ref="jmsFactory" />
		<property name="destination" ref="jmsQueueTawGridResultados" />
		<property name="messageListener" ref="gestorResultadosService" />
		<property name="transactionManager" ref="jmsTransactionManager" />
		<property name="sessionTransacted" value="true"/>
		<property name="recoveryInterval" value="10000"/>		
	</bean>

Any idea?


-- 
View this message in context: http://www.nabble.com/Messages-dont-get-redelivered-till-broker-restart---expected-behaviour--tp9615827s2354p17515417.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.