camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henryk Konsek <hekon...@gmail.com>
Subject Re: ActiveMQ processing
Date Wed, 08 Jan 2014 20:35:51 GMT
> I know that I will get the result when the request is solved in queue, but
> for example, when I am processing big amount of data, I don't want to wait
> 20 seconds.

You won't wait. :) You will submit task to the queue and immediately
return control to the "response" bean at the end of the route.

In the meantime another route will consume orders from the queue and
create users in the background:

from("activemq:queue:users.add").
  bean(SlowBeanAddingUsers.class).
  to("activemq:queue:users.done");

from("activemq:queue:users.done").to("mock:notifyMeWhenUserHasBeenCreated");

You're on the right track with your example. :)

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Mime
View raw message