How to send an immediate response to a camel route after placing a message in the queue

I am trying to implement a fairly simple camel route, through which a request is received from the CXF endpoint and queued for subsequent asynchronous processing. When a message is queued, I should be able to send a response to the caller, indicating that the message has been received. I went through the tutorials, but it seems I can’t work correctly. It happens that after a message is queued, no response will be sent to the caller until the message has been processed from the queue to its intended destination.

Code below

from (SOAP_ENDPOINT) .to(SEDA_RECEIVED) .transform(constant(OK))//I expect this transform to return OK to caller .log("OK response sent back to caller"); from (SEDA_RECEIVED) .to(BEAN_CONVERT_REQUEST) .to("activemq:queue:events"); from ("activemq:queue:events") .to(BEAN_STORE_TO_DB); 
+4
source share
2 answers

Instead of k (SEDA_RECEIVED) you can try inOnly (SEDA_RECEIVED)

+1
source

Yes, this is an eip event message http://camel.apache.org/event-message.html

And a bit related to http://camel.apache.org/wire-tap.html

+1
source

Source: https://habr.com/ru/post/1447848/


All Articles