You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by pratibhaG <pr...@in2m.com> on 2008/10/03 08:38:05 UTC

Message lost during redelivery

I am using camel inside servicemix.
I have message flow like this
1)A message is put in a jms topic called updateProfileTopic.
2)jms consumer consumes the message and sends the message to an application
through http provider.
3)When jms consumer sends message to http provider, the application may be
down.
4)If application is down, the message delivery is retried. After all re
deliveries (4) the message is put in a queue called application.error.queue.
5)I have set the redelivery of message as follows.
        .maximumRedeliveries(4)
        .useExponentialBackOff()
        .initialRedeliveryDelay(15000L)
        .backOffMultiplier(2.0)

Now suppose the message is redelivered 2 times but still the application is
down. By the time it redelivers third time, I stopped the servicemix.
In this case I do find the message any where. Either it should have been in
the topic updateProfileTopic or in queue application.error.queue.
But do not find it. It seems to be lost. How can I get the message.

As my operation is asynchronous when client puts the message in topic
updateProfileTopic I send a success message to client. So if I lose the
message after sending success message it would be inconsistent.

How can i recollect the message?
Please help....................


-Pratibha

-- 
View this message in context: http://www.nabble.com/Message-lost-during-redelivery-tp19792858s22882p19792858.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Message lost during redelivery

Posted by pratibhaG <pr...@in2m.com>.
I read about transactional errorHandler.
But did not get an idea how to use it for this case.
Please provide any example for it.

Pratibha
-- 
View this message in context: http://www.nabble.com/Message-lost-during-redelivery-tp19792858s22882p19797226.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Message lost during redelivery

Posted by torry <to...@gmail.com>.
Thanks very much. I'm reading about transactions. Hope it can resolve my
problem.

Thanks again.


Claus Ibsen wrote:
> 
> Hi
> 
> If you are using transactions then the message is not lost. (transactional
> client = EIP pattern)
> http://activemq.apache.org/camel/transactional-client.html
> 
> eg. all the spring TX stuff, there is a sample with JMS to mock, but the
> same should apply for JMS to JMS as well (JMS Sample).
> 
> The configuration of the TX is a bit verbose in the XML (we would like to
> improve this in Camel 2.0)
> 
> Using TX then it's activeMQ that handles the redelivery and thus will not
> lose the message.
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> -----Original Message-----
> From: torry [mailto:torworx@gmail.com] 
> Sent: 19. oktober 2008 11:04
> To: camel-user@activemq.apache.org
> Subject: RE: Message lost during redelivery
> 
> 
> I have the same problem now.
> 
> I want to use camel (1.5 snapshot) to help to get all the local messages
> form the activemq (5.1) queue and then send them to a remote activemq
> queue.
> I hope when the remote activemq was down, the local camel can retry to
> connect until the remote activemq comes back. 
> 
> My RouteBuilder is :
> 
> public class MyRouteBuilder extends RouteBuilder {
> 
>     @Override
>     public void configure() throws Exception {
>            public void configure() {     				
>             	Class[] exceptions = new
> Class[]{IOException.class,Exception.class,NullPointerException.class}; 
> 		    	
> 	for (Class ex : exceptions) {
> 		exception(ex).maximumRedeliveries(-1);   
> 	}; 		    	
> 	from("localMq:queue:test").to("remoteMq:queue.test");
>             }   
>     }
> }
> 
> The problem is that when the remote activemq is down and before it comes
> back, the local camel is down also, at this time, the message that the
> local
> camel was trying to send before it was down was lost.
> 
> Should what I do that I can find back the lost message and resend it when
> all server is come back.
> 
> Thanks any help
>  
> 
> pratibhaG wrote:
>> 
>> I am using activemq as jms provider
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Message-lost-during-redelivery-tp19792858s22882p20054311.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Message-lost-during-redelivery-tp19792858s22882p20054546.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Message lost during redelivery

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

If you are using transactions then the message is not lost. (transactional client = EIP pattern)
http://activemq.apache.org/camel/transactional-client.html

eg. all the spring TX stuff, there is a sample with JMS to mock, but the same should apply for JMS to JMS as well (JMS Sample).

The configuration of the TX is a bit verbose in the XML (we would like to improve this in Camel 2.0)

Using TX then it's activeMQ that handles the redelivery and thus will not lose the message.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: torry [mailto:torworx@gmail.com] 
Sent: 19. oktober 2008 11:04
To: camel-user@activemq.apache.org
Subject: RE: Message lost during redelivery


I have the same problem now.

I want to use camel (1.5 snapshot) to help to get all the local messages
form the activemq (5.1) queue and then send them to a remote activemq queue.
I hope when the remote activemq was down, the local camel can retry to
connect until the remote activemq comes back. 

My RouteBuilder is :

public class MyRouteBuilder extends RouteBuilder {

    @Override
    public void configure() throws Exception {
           public void configure() {     				
            	Class[] exceptions = new
Class[]{IOException.class,Exception.class,NullPointerException.class}; 
		    	
	for (Class ex : exceptions) {
		exception(ex).maximumRedeliveries(-1);   
	}; 		    	
	from("localMq:queue:test").to("remoteMq:queue.test");
            }   
    }
}

The problem is that when the remote activemq is down and before it comes
back, the local camel is down also, at this time, the message that the local
camel was trying to send before it was down was lost.

Should what I do that I can find back the lost message and resend it when
all server is come back.

Thanks any help
 

pratibhaG wrote:
> 
> I am using activemq as jms provider
> 

-- 
View this message in context: http://www.nabble.com/Message-lost-during-redelivery-tp19792858s22882p20054311.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Message lost during redelivery

Posted by torry <to...@gmail.com>.
I have the same problem now.

I want to use camel (1.5 snapshot) to help to get all the local messages
form the activemq (5.1) queue and then send them to a remote activemq queue.
I hope when the remote activemq was down, the local camel can retry to
connect until the remote activemq comes back. 

My RouteBuilder is :

public class MyRouteBuilder extends RouteBuilder {

    @Override
    public void configure() throws Exception {
           public void configure() {     				
            	Class[] exceptions = new
Class[]{IOException.class,Exception.class,NullPointerException.class}; 
		    	
	for (Class ex : exceptions) {
		exception(ex).maximumRedeliveries(-1);   
	}; 		    	
	from("localMq:queue:test").to("remoteMq:queue.test");
            }   
    }
}

The problem is that when the remote activemq is down and before it comes
back, the local camel is down also, at this time, the message that the local
camel was trying to send before it was down was lost.

Should what I do that I can find back the lost message and resend it when
all server is come back.

Thanks any help
 

pratibhaG wrote:
> 
> I am using activemq as jms provider
> 

-- 
View this message in context: http://www.nabble.com/Message-lost-during-redelivery-tp19792858s22882p20054311.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Message lost during redelivery

Posted by pratibhaG <pr...@in2m.com>.
I am using activemq as jms provider
-- 
View this message in context: http://www.nabble.com/Message-lost-during-redelivery-tp19792858s22882p19851834.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Message lost during redelivery

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

You need transactions for such stuff, and then it's a bit more tricky.

Are the queue and topic from the *same* JMS provider? And what is this provider?

There is some wiki about transaction here:
http://activemq.apache.org/camel/transactional-client.html



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: pratibhaG [mailto:pratibha.ghogale@in2m.com] 
Sent: 3. oktober 2008 08:38
To: camel-user@activemq.apache.org
Subject: Message lost during redelivery


I am using camel inside servicemix.
I have message flow like this
1)A message is put in a jms topic called updateProfileTopic.
2)jms consumer consumes the message and sends the message to an application
through http provider.
3)When jms consumer sends message to http provider, the application may be
down.
4)If application is down, the message delivery is retried. After all re
deliveries (4) the message is put in a queue called application.error.queue.
5)I have set the redelivery of message as follows.
        .maximumRedeliveries(4)
        .useExponentialBackOff()
        .initialRedeliveryDelay(15000L)
        .backOffMultiplier(2.0)

Now suppose the message is redelivered 2 times but still the application is
down. By the time it redelivers third time, I stopped the servicemix.
In this case I do find the message any where. Either it should have been in
the topic updateProfileTopic or in queue application.error.queue.
But do not find it. It seems to be lost. How can I get the message.

As my operation is asynchronous when client puts the message in topic
updateProfileTopic I send a success message to client. So if I lose the
message after sending success message it would be inconsistent.

How can i recollect the message?
Please help....................


-Pratibha

-- 
View this message in context: http://www.nabble.com/Message-lost-during-redelivery-tp19792858s22882p19792858.html
Sent from the Camel - Users mailing list archive at Nabble.com.