You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by hayden74 <hd...@gmail.com> on 2015/04/14 00:21:12 UTC

Publishing events using Camel - best approach with example

I want to use Camel to basically do the following asynchronously:

- System A triggers newAccountCreated spring event
- System A - event handler publishes the event to a Camel route "accounts"
- Camel receives the event and delivers it to System X, Y and Z

What is the best approach to implement the above? are there any
examples/tutorials to go through?

The examples I've checked so far don't show clearly how to publish events
from the producer or consuming by a consumer.

So far I've got the below and stuck with how to deliver the message to the
consumer and how the consumer would receive it

Producer (System A) - delivering the message to Camel: ProducerTemplate
camelTemplate = context.getBean("camelTemplate", ProducerTemplate.class);
camelTemplate.sendBody("jms:queue:accounts", ExchangePattern.InOnly, "New
Account Created");

Camel - receiving the message from the producer and publish it to consumers:
from("jms:queue:accounts").log("message: ${body}").to("what to do here? how
should the message be delivered to the consumer(X, Y, Z)?");

Consumer(s) - how would consumers receive the message from Camel?



--
View this message in context: http://camel.465427.n5.nabble.com/Publishing-events-using-Camel-best-approach-with-example-tp5765717.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Publishing events using Camel - best approach with example

Posted by Mark Frazier <mm...@me.com>.
http://camel.apache.org/recipient-list.html <http://camel.apache.org/recipient-list.html>


> On Apr 13, 2015, at 3:21 PM, hayden74 <hd...@gmail.com> wrote:
> 
> I want to use Camel to basically do the following asynchronously:
> 
> - System A triggers newAccountCreated spring event
> - System A - event handler publishes the event to a Camel route "accounts"
> - Camel receives the event and delivers it to System X, Y and Z
> 
> What is the best approach to implement the above? are there any
> examples/tutorials to go through?
> 
> The examples I've checked so far don't show clearly how to publish events
> from the producer or consuming by a consumer.
> 
> So far I've got the below and stuck with how to deliver the message to the
> consumer and how the consumer would receive it
> 
> Producer (System A) - delivering the message to Camel: ProducerTemplate
> camelTemplate = context.getBean("camelTemplate", ProducerTemplate.class);
> camelTemplate.sendBody("jms:queue:accounts", ExchangePattern.InOnly, "New
> Account Created");
> 
> Camel - receiving the message from the producer and publish it to consumers:
> from("jms:queue:accounts").log("message: ${body}").to("what to do here? how
> should the message be delivered to the consumer(X, Y, Z)?");
> 
> Consumer(s) - how would consumers receive the message from Camel?
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Publishing-events-using-Camel-best-approach-with-example-tp5765717.html
> Sent from the Camel - Users mailing list archive at Nabble.com.