camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sameer Apte <aptesam...@gmail.com>
Subject Re: Jetty as consumer in synchronous mode?
Date Thu, 05 Apr 2012 09:57:18 GMT
Any one answering this question please???
I have run into exactly same problem. What I am trying to do is expose a
jetty endpoint which will receive post requests from client and push the
message on queue after converting body to string. And obviously it works
fine.

Route definition looks like below:

/*from(jettyUrl)
  .transacted()
  .inOnly()
  .to(activemq)
  .end()*/

The problem is when broker is down I want to return 500 straight away. 
However, what happens is if broker is down then http client keeps on waiting
for outcome rather than getting 500. 
So obviously at some stage client will kill the connection thinking that it
is not working and when broker is up again, message appears on queue again.

I believe problem is with the way I have used inOnly() above . 
Probably it should be inOut() in this case which obviously I have tried. 
What happens with inOut() is, camel sends a message to queue and expects
reply back on some in-memory temporary queue. It times out eventually
because there is no one to send ack on that queue and fails eventually. 
On failure, message gets moved to dead letter queue as per the handler
registered and client receives 200.

Any suggestions/comments?
[I am fighting the battle to prove camel is a good choice so please be
quick. :-) ]

-Sameer

--
View this message in context: http://camel.465427.n5.nabble.com/Jetty-as-consumer-in-synchronous-mode-tp5614463p5619967.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message