You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Bhatt, Shally (GE Healthcare)" <Sh...@ge.com> on 2012/08/23 14:06:12 UTC

ActiveMQ redelivery

Hi,

 

An overview  of the data-flow                 

	
	 	
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


We have an application, that receives messages and  sends it to multiple
endpoints.

Before sending to these endpoints, we have activemq  which will store
the message, and process  the message and then send it to the endpoint.
We have noticed that the movement the message is being picked up for
processing, it gets dequeued from activemq.If the process fails or the
endpoint is not reachable, the message is lost. We want that message
should be retained in the queue until the message is consumed by the
endpoint successfully.

 

We tried setting the redeliverypolicy in our configuration file as
below, but it did not work:

<bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
 <property name="brokerURL" value="tcp://localhost:61616" /> 
 <property name="redeliveryPolicy" ref="redeliveryPolicy" />
 </bean>

<bean id="redeliveryPolicy"
class="org.apache.activemq.RedeliveryPolicy">
<property name="maximumRedeliveries" value="1" /> 
</bean>

<bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
 <property name="maxConnections" value="8" /> 
 <property name="maximumActive" value="500" /> 
 <property name="connectionFactory" ref="jmsConnectionFactory" /> 
 </bean>
<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
 <property name="connectionFactory" ref="pooledConnectionFactory" /> 
 <property name="transacted" value="false" /> 
 <property name="concurrentConsumers" value="10" /> 
 
 </bean>
<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
 <property name="configuration" ref="jmsConfig" /> 
 </bean>  

 

Kindly help us to figure out what configuration we need to make, to get
it working.

 

Regards,

Shally


Re: ActiveMQ redelivery

Posted by "christian.ohr" <ch...@googlemail.com>.
Hi Shally,

you should make your JMS Configuration transactional, also see
http://camel.apache.org/how-do-i-make-my-jms-endpoint-transactional.html. 

JmsConfiguration should get transacted=true and a reference to a transaction
manager, e.g. 

	<bean id="jmsTransactionManager"
		class="org.springframework.jms.connection.JmsTransactionManager">
		<property name="connectionFactory" ref="pooledConnectionFactory" />
	</bean> 

If you get an exception from sending away your message (and you don't
explicitly handle it in an exception handler), the message will be rolled
back into the queue.

When you send to multiple endpoints, consider using a separate queue for
each of them - otherwise, if only one endpoint is down, the message may get
redelivered to the others as well, even though they might have already
received it before.

regards
Christian



--
View this message in context: http://camel.465427.n5.nabble.com/ActiveMQ-redelivery-tp5717941p5718012.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: ActiveMQ redelivery

Posted by Charles Moulliard <ch...@gmail.com>.
Hi Shally,

Your topic should be discussed in activemq mailing list but not on camel

Regards,

Charles

On Thu, Aug 23, 2012 at 2:06 PM, Bhatt, Shally (GE Healthcare) <
Shally.Bhatt@ge.com> wrote:

> Hi,****
>
> ** **
>
> An overview  of the data-flow                 ****
>
> **
> **** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> We have an application, that receives messages and  sends it to multiple
> endpoints.****
>
> Before sending to these endpoints, we have activemq  which will store the
> message, and process  the message and then send it to the endpoint. We have
> noticed that the movement the message is being picked up for processing, it
> gets dequeued from activemq.If the process fails or the endpoint is not
> reachable, the message is lost. We want that message should be retained in
> the queue until the message is consumed by the endpoint successfully.****
>
> ** **
>
> We tried setting the redeliverypolicy in our configuration file as below,
> but it did not work:****
>
> *<bean id="jmsConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>  <property name="brokerURL" value="tcp://localhost:61616" />
>  <property name="redeliveryPolicy" ref="redeliveryPolicy" />
>  </bean>
>
> <bean id="redeliveryPolicy" class="org.apache.activemq.RedeliveryPolicy">
> <property name="maximumRedeliveries" value="1" />
> </bean>
>
> <bean id="pooledConnectionFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory">
>  <property name="maxConnections" value="8" />
>  <property name="maximumActive" value="500" />
>  <property name="connectionFactory" ref="jmsConnectionFactory" />
>  </bean>
> <bean id="jmsConfig"
> class="org.apache.camel.component.jms.JmsConfiguration">
>  <property name="connectionFactory" ref="pooledConnectionFactory" />
>  <property name="transacted" value="false" />
>  <property name="concurrentConsumers" value="10" />
>
>  </bean>
> <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>  <property name="configuration" ref="jmsConfig" />
>  </bean>**  *
>
> * *
>
> Kindly help us to figure out what configuration we need to make, to get it
> working.****
>
> ** **
>
> Regards,****
>
> Shally****
>



-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com