camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajneesh <hi.its.rajne...@gmail.com>
Subject Nested routing using rest and MQ processing asyncronously
Date Sat, 07 Jan 2017 16:01:11 GMT
I have a use case:
1. Client send the msg via rest endpoint
2. App need to get it, validate it, put in MQ, and send acknowledgement
(message received) to client app in rest response.
3. MQ endpoint has its own route to offline processing of msg which triggers
as soon as msg is in queue.
4. rest response can not wait till the MQ processing to be complete and has
to go independently.

Problem what I am facing is some time rest respone get delayed and
stuck/meshed up with MQ processing and client is not getting response on
given SLA.

I have done nested routing Configuration in camel context like below.. not
sure is it right way or not..but its not working as expected. Please advise:

<restConfiguration component="servlet" bindingMode="off">
<rest path="/">
 <post uri="/messages" >
 <to uri="direct:handleRestCall" />
 </post>
</rest>

<route>
<from uri="direct:handleRestCall" />
  <process ref="restRequestValidationProcessor" />
    <to uri="ref:mqueueEndpoint" />
    <to uri="bean:restCallResponserService?method=generateSuccessResponse"/>
    <onException>
    <exception>java.lang.Exception</exception>
     <handled>
     <constant>true</constant>
     </handled>
      <process ref="exceptionProcessor"></process>
    </onException>
</route>

<route>
 <from uri="ref:mqueueEndpoint" />
  <process ref="msgProcessor"></process>
</route> 



--
View this message in context: http://camel.465427.n5.nabble.com/Nested-routing-using-rest-and-MQ-processing-asyncronously-tp5792279.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message