How can I manually redelivery the message to source endpoint while an exception throws?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I manually redelivery the message to source endpoint while an exception throws?

zhichao.fei@hpe.com
This post was updated on .
Hi All,

As we known, Camel has auto redelivery machanism, but sometimes, we need manually re-delivery the message to source endpoint while delivery faild. Nomally, we need to process below steps.

1. While an exception throws, we will save the Exchange/Message to the database.
2. Provide a page to modify the Exchange/Message then click a button to re-delivery the message.

How can I implement this scenario.

I appreciate if someone can provide good idea.


Zhi-Chao Fei

Reply | Threaded
Open this post in threaded view
|

Re: How can I manually redelivery the message to source endpoint while an exception throws?

Gregoire Autric

Hi Zhi-Chao Fei,


You can catch exception via OnException mechanism
http://camel.apache.org/exception-clause.html

If you can reply everything you want to the client (HTTP)

feel free to send your sample if needed

Greg AUTRIC                        
JBoss Middleware Consultant

email   : gautric __at__ redhat __dot__ com
twitter : @gautric_io

Red Hat Global Services            
Red Hat France SARL                sit: http://www.redhat.fr
Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
Sent from webmail

----- Mail original -----
De: "zhichao fei" <[hidden email]>
À: [hidden email]
Envoyé: Lundi 14 Septembre 2015 09:09:08
Objet: How can I manually redelivery the message to source endpoint while an exception throws?

Hi All,

As we known, Camel has auto redelivery machanism, but sometimes, we need
re-delivery the message to source endpoint while delivery faild. Nomally, we
need to process below steps.

1. While an exception throws, we will save the Exchange/Message to the
database.
2. Provide a page to modify the Exchange/Message then click a button to
re-delivery the message.

How can I implement this scenario.

I appreciate if someone can provide good idea.


Zhi-Chao Fei





--
View this message in context: http://camel.465427.n5.nabble.com/How-can-I-manually-redelivery-the-message-to-source-endpoint-while-an-exception-throws-tp5771486.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: How can I manually redelivery the message to source endpoint while an exception throws?

zhichao.fei@hpe.com
Hi Greg,

I appreciate your quickly response.
I know Camel has OnException to catch the exception, as well as the auto re-delivery mechanism. But in some case, user hope they can manually to resubmit the message.
For example, if the exception throws, we need serialize Message/Exchange object as String and save it to database. Then user can correct the message/exchange then deserialize the String as Message/Exchange object and resubmit it.

Do you have any good solution for this scenario? If you can provide some code example, I really appreciate.

Zhi-Chao Fei