You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Drone42 <ge...@logica.com> on 2008/11/19 22:55:27 UTC

Camel route and message header field mapping

I'm trying to create a Camel route with an iBATIS SU for storage of data,
i.e.

MyApp -> MessageFilter SU -> iBATIS SU

I dont understand how the POJO created in MyApp is mapped to message header
fields in a message transfered through a Camel route and finally to
identifiers in the SQL query definition of iBATIS. This is likely a general
problem due to my missing understanding of Camel.

I have gone through the Camel iBATIS test program. It creates an Account,
configures it and send it to the iBATIS endpoint. That I understand. But
what when I have another Camel SU in between? How can I filter on the
'Account' instance created by MyApp in the MessageFilter? Which fields are
available in the message header? All? Will each attribute in the POJO be
mapped to a separate message header field, i.e. if the Account class is
defined as 

public class Account {
    private int id;
    private String firstName;
    private String lastName;
    private String emailAddress;
...

Will each of these fields then be available in the message header so that I
can configure the filter route as

from("foo:start").filter().xpath("/Account[@firstName='James']").to(ibatis:InsertAccount);
-- 
View this message in context: http://www.nabble.com/Camel-route-and-message-header-field-mapping-tp20590082s22882p20590082.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel route and message header field mapping

Posted by Drone42 <ge...@logica.com>.
That was the missing link for me; Camel messages are not (necesarrily) WSDL
messages as servicemix. 

I can thus chose to a) transmit XML formatted messages and then use Xath to
filter, or b) I can transmit java objects and use other filtering
mechanisms.






Claus Ibsen-2 wrote:
> 
> Hi
> 
> Apache Camel doesn't use XML as payload, so the Account is an java object.
> 
> So if you want to filter you can either
> a) marshal to XML and do the filter and unmarshal from XML to Object
> (eg using xstream)
> b) using something else than xpath for the filter test (predicate)
> 
> Ad a)
> See the xstream DataFormat
> http://activemq.apache.org/camel/data-format.html
> 
> Ad b)
> Instead of xpath you can use
> - Scripting languages such as OGNL, EL, Groovy, JavaScript
> http://activemq.apache.org/camel/languages.html
> 
> - Invoking a bean
> http://activemq.apache.org/camel/bean-language.html
> 
> 
> from("foo:start").filter().bean(MyFilterOnlyJamesBean.class).to(ibatis:InsertAccount);
> 
> public class MyFilterOnlyJamesBean {
> 
>   public boolean isOnlyJames(Account account) {
>      return account.getFirstName().equals("James");
>   }
> 
> }
> 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 
> 
> On Wed, Nov 19, 2008 at 10:55 PM, Drone42 <ge...@logica.com>
> wrote:
>>
>> I'm trying to create a Camel route with an iBATIS SU for storage of data,
>> i.e.
>>
>> MyApp -> MessageFilter SU -> iBATIS SU
>>
>> I dont understand how the POJO created in MyApp is mapped to message
>> header
>> fields in a message transfered through a Camel route and finally to
>> identifiers in the SQL query definition of iBATIS. This is likely a
>> general
>> problem due to my missing understanding of Camel.
>>
>> I have gone through the Camel iBATIS test program. It creates an Account,
>> configures it and send it to the iBATIS endpoint. That I understand. But
>> what when I have another Camel SU in between? How can I filter on the
>> 'Account' instance created by MyApp in the MessageFilter? Which fields
>> are
>> available in the message header? All? Will each attribute in the POJO be
>> mapped to a separate message header field, i.e. if the Account class is
>> defined as
>>
>> public class Account {
>>    private int id;
>>    private String firstName;
>>    private String lastName;
>>    private String emailAddress;
>> ...
>>
>> Will each of these fields then be available in the message header so that
>> I
>> can configure the filter route as
>>
>> from("foo:start").filter().xpath("/Account[@firstName='James']").to(ibatis:InsertAccount);
>> --
>> View this message in context:
>> http://www.nabble.com/Camel-route-and-message-header-field-mapping-tp20590082s22882p20590082.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Camel-route-and-message-header-field-mapping-tp20590082s22882p20596745.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel route and message header field mapping

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Apache Camel doesn't use XML as payload, so the Account is an java object.

So if you want to filter you can either
a) marshal to XML and do the filter and unmarshal from XML to Object
(eg using xstream)
b) using something else than xpath for the filter test (predicate)

Ad a)
See the xstream DataFormat
http://activemq.apache.org/camel/data-format.html

Ad b)
Instead of xpath you can use
- Scripting languages such as OGNL, EL, Groovy, JavaScript
http://activemq.apache.org/camel/languages.html

- Invoking a bean
http://activemq.apache.org/camel/bean-language.html


from("foo:start").filter().bean(MyFilterOnlyJamesBean.class).to(ibatis:InsertAccount);

public class MyFilterOnlyJamesBean {

  public boolean isOnlyJames(Account account) {
     return account.getFirstName().equals("James");
  }

}


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Wed, Nov 19, 2008 at 10:55 PM, Drone42 <ge...@logica.com> wrote:
>
> I'm trying to create a Camel route with an iBATIS SU for storage of data,
> i.e.
>
> MyApp -> MessageFilter SU -> iBATIS SU
>
> I dont understand how the POJO created in MyApp is mapped to message header
> fields in a message transfered through a Camel route and finally to
> identifiers in the SQL query definition of iBATIS. This is likely a general
> problem due to my missing understanding of Camel.
>
> I have gone through the Camel iBATIS test program. It creates an Account,
> configures it and send it to the iBATIS endpoint. That I understand. But
> what when I have another Camel SU in between? How can I filter on the
> 'Account' instance created by MyApp in the MessageFilter? Which fields are
> available in the message header? All? Will each attribute in the POJO be
> mapped to a separate message header field, i.e. if the Account class is
> defined as
>
> public class Account {
>    private int id;
>    private String firstName;
>    private String lastName;
>    private String emailAddress;
> ...
>
> Will each of these fields then be available in the message header so that I
> can configure the filter route as
>
> from("foo:start").filter().xpath("/Account[@firstName='James']").to(ibatis:InsertAccount);
> --
> View this message in context: http://www.nabble.com/Camel-route-and-message-header-field-mapping-tp20590082s22882p20590082.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Re: RecipientList Distribution & J

Posted by Coder One <co...@yahoo.com>.
Good idea...when I put the stuff into direct:start, I will create the recipient list as per your description.

I use Tibco EMS and Active MQ...

thanks again!

--- On Thu, 11/20/08, Claus Ibsen <cl...@gmail.com> wrote:

> From: Claus Ibsen <cl...@gmail.com>
> Subject: Re: RecipientList Distribution & J
> To: camel-user@activemq.apache.org, coder_lol@yahoo.com
> Date: Thursday, November 20, 2008, 1:18 AM
> Hi
> 
> Ah you can just return the actual endpoint URI and Camel
> will use it as runtime
> 
> So you can return a list like this:
> 
> "jms:queue:foo"
> "jms:queue:bar"
> "jms:topic:goldtopic"
> 
> Just use the jms prefix to indicate the jms component
> should be used.
> Actually it should be the JMS you have configured in Camel.
> What JMS
> broker are you connecting to?
> 
> 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 
> 
> On Thu, Nov 20, 2008 at 10:14 AM, Coder One
> <co...@yahoo.com> wrote:
> > I need the list to be dynamic though, so foo and bar
> could end up being foo-1,...foo-n, and same for bar...
> >
> > Ie..dynamic "routing" based on a message id
> and need the message to arrive at a given endpoint, jms in
> this case.
> >
> > There is an admin process to create the actual JMS
> topic/queue, but my routing piece needs to stay dynamic...
> >
> > Thanks!
> >
> > --- On Wed, 11/19/08, Claus Ibsen
> <cl...@gmail.com> wrote:
> >
> >> From: Claus Ibsen <cl...@gmail.com>
> >> Subject: Re: RecipientList Distribution & JM
> >> To: camel-user@activemq.apache.org,
> coder_lol@yahoo.com
> >> Date: Wednesday, November 19, 2008, 11:44 PM
> >> Hi
> >>
> >> I think you can use endpoint ids in the
> destinationIds
> >> header.
> >>
> >> <endpoint id="foo"
> >> uri="jms:queue:foo"/>
> >> <endpoint id="bar"
> >> uri="jms:queue:bar"/>
> >>
> >> And then you can have foo and bar in the header.
> >>
> >>
> >> /Claus Ibsen
> >> Apache Camel Committer
> >> Blog: http://davsclaus.blogspot.com/
> >>
> >>
> >>
> >> On Thu, Nov 20, 2008 at 7:10 AM, Coder One
> >> <co...@yahoo.com> wrote:
> >> > destionationIds="A" or
> "A,B,C"
> >> >
> >> >
> >>
> from("direct:start").recipientList().header("destinationIds");
> >> >
> >> > How can I distribute the above to JMS queue
> or topic
> >> A, B, C respectively?  Or similarly, would it be
> possible to
> >> name the JMS queues/topics as abc.xyz.A abc.xyz.B,
> and
> >> abc.xyz.C and route accordingly?
> >> >
> >> > Thanks...
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >
> >
> >
> >
> >


      


Re: RecipientList Distribution & J

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah you can just return the actual endpoint URI and Camel will use it as runtime

So you can return a list like this:

"jms:queue:foo"
"jms:queue:bar"
"jms:topic:goldtopic"

Just use the jms prefix to indicate the jms component should be used.
Actually it should be the JMS you have configured in Camel. What JMS
broker are you connecting to?



/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Thu, Nov 20, 2008 at 10:14 AM, Coder One <co...@yahoo.com> wrote:
> I need the list to be dynamic though, so foo and bar could end up being foo-1,...foo-n, and same for bar...
>
> Ie..dynamic "routing" based on a message id and need the message to arrive at a given endpoint, jms in this case.
>
> There is an admin process to create the actual JMS topic/queue, but my routing piece needs to stay dynamic...
>
> Thanks!
>
> --- On Wed, 11/19/08, Claus Ibsen <cl...@gmail.com> wrote:
>
>> From: Claus Ibsen <cl...@gmail.com>
>> Subject: Re: RecipientList Distribution & JM
>> To: camel-user@activemq.apache.org, coder_lol@yahoo.com
>> Date: Wednesday, November 19, 2008, 11:44 PM
>> Hi
>>
>> I think you can use endpoint ids in the destinationIds
>> header.
>>
>> <endpoint id="foo"
>> uri="jms:queue:foo"/>
>> <endpoint id="bar"
>> uri="jms:queue:bar"/>
>>
>> And then you can have foo and bar in the header.
>>
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>>
>> On Thu, Nov 20, 2008 at 7:10 AM, Coder One
>> <co...@yahoo.com> wrote:
>> > destionationIds="A" or "A,B,C"
>> >
>> >
>> from("direct:start").recipientList().header("destinationIds");
>> >
>> > How can I distribute the above to JMS queue or topic
>> A, B, C respectively?  Or similarly, would it be possible to
>> name the JMS queues/topics as abc.xyz.A abc.xyz.B, and
>> abc.xyz.C and route accordingly?
>> >
>> > Thanks...
>> >
>> >
>> >
>> >
>> >
>> >
>
>
>
>
>

Re: RecipientList Distribution & JM

Posted by Coder One <co...@yahoo.com>.
I need the list to be dynamic though, so foo and bar could end up being foo-1,...foo-n, and same for bar...

Ie..dynamic "routing" based on a message id and need the message to arrive at a given endpoint, jms in this case.

There is an admin process to create the actual JMS topic/queue, but my routing piece needs to stay dynamic...

Thanks!

--- On Wed, 11/19/08, Claus Ibsen <cl...@gmail.com> wrote:

> From: Claus Ibsen <cl...@gmail.com>
> Subject: Re: RecipientList Distribution & JM
> To: camel-user@activemq.apache.org, coder_lol@yahoo.com
> Date: Wednesday, November 19, 2008, 11:44 PM
> Hi
> 
> I think you can use endpoint ids in the destinationIds
> header.
> 
> <endpoint id="foo"
> uri="jms:queue:foo"/>
> <endpoint id="bar"
> uri="jms:queue:bar"/>
> 
> And then you can have foo and bar in the header.
> 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 
> 
> On Thu, Nov 20, 2008 at 7:10 AM, Coder One
> <co...@yahoo.com> wrote:
> > destionationIds="A" or "A,B,C"
> >
> >
> from("direct:start").recipientList().header("destinationIds");
> >
> > How can I distribute the above to JMS queue or topic
> A, B, C respectively?  Or similarly, would it be possible to
> name the JMS queues/topics as abc.xyz.A abc.xyz.B, and
> abc.xyz.C and route accordingly?
> >
> > Thanks...
> >
> >
> >
> >
> >
> >


      


Re: RecipientList Distribution & JM

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I think you can use endpoint ids in the destinationIds header.

<endpoint id="foo" uri="jms:queue:foo"/>
<endpoint id="bar" uri="jms:queue:bar"/>

And then you can have foo and bar in the header.


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Thu, Nov 20, 2008 at 7:10 AM, Coder One <co...@yahoo.com> wrote:
> destionationIds="A" or "A,B,C"
>
> from("direct:start").recipientList().header("destinationIds");
>
> How can I distribute the above to JMS queue or topic A, B, C respectively?  Or similarly, would it be possible to name the JMS queues/topics as abc.xyz.A abc.xyz.B, and abc.xyz.C and route accordingly?
>
> Thanks...
>
>
>
>
>
>

Re: RecipientList & Bean Continuing Rou

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Nov 20, 2008 at 6:23 PM, Coder One <co...@yahoo.com> wrote:
> Beautiful....I did not know about that body() call.  This stuff is powerful!!! :)
>
> Thanks for all your help!
Yeah it grows on you ;)

A trick to learn is to avoid using parameters but rely on the fluent
builder, since when you place a dot and press ctrl + space to get the
method list from your IDE then the list shows what you can do

So you can do:
...recipientList().CURSOR HERE

And then press ctrl + space and you should get the body() in the list to choose

If using parameters instead then you just get a hint that it should be
a Expression type and then it's much hard to figure out what to
insert.


/Claus

Re: RecipientList & Bean Continuing Rout

Posted by Coder One <co...@yahoo.com>.
Beautiful....I did not know about that body() call.  This stuff is powerful!!! :)

Thanks for all your help!


--- On Thu, 11/20/08, Claus Ibsen <cl...@gmail.com> wrote:

> From: Claus Ibsen <cl...@gmail.com>
> Subject: Re: RecipientList & Bean Continuing Rout
> To: camel-user@activemq.apache.org, coder_lol@yahoo.com
> Date: Thursday, November 20, 2008, 9:21 AM
> Hi
> 
> The dynamic recpient list is documented here
> http://activemq.apache.org/camel/recipient-list.html
> 
> It has a sample how to use a tokenizer to split a string
> based on
> comma. Just used body() instead of header
> from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(body().tokenize(","));
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 
> 
> On Thu, Nov 20, 2008 at 6:15 PM, Coder One
> <co...@yahoo.com> wrote:
> >
> from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(???)..
> >
> > My event Listener returns a string of comma delimiter
> route URI, say, jms:q1, jms:q2, etc...and now I would like
> to further route the event to all the q1, q2, etc...
> >
> > q1, q2, come from database keyed by the event...
> >
> > Is recipientList the right way?  How?
> >
> > Thanks...
> >
> >
> >
> >
> >
> >


      


Re: RecipientList & Bean Continuing Rout

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

The dynamic recpient list is documented here
http://activemq.apache.org/camel/recipient-list.html

It has a sample how to use a tokenizer to split a string based on
comma. Just used body() instead of header
from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(body().tokenize(","));

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Thu, Nov 20, 2008 at 6:15 PM, Coder One <co...@yahoo.com> wrote:
> from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(???)..
>
> My event Listener returns a string of comma delimiter route URI, say, jms:q1, jms:q2, etc...and now I would like to further route the event to all the q1, q2, etc...
>
> q1, q2, come from database keyed by the event...
>
> Is recipientList the right way?  How?
>
> Thanks...
>
>
>
>
>
>

RecipientList & Bean Continuing Route

Posted by Coder One <co...@yahoo.com>.
from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(???)..

My event Listener returns a string of comma delimiter route URI, say, jms:q1, jms:q2, etc...and now I would like to further route the event to all the q1, q2, etc...

q1, q2, come from database keyed by the event...

Is recipientList the right way?  How?

Thanks...



      


Re: Competing Consumers Variant

Posted by Claus Ibsen <cl...@gmail.com>.
> The key is "as fast as possible" without having to start up another webapp.  I guess the question is if a camel supports multiple routes given a single context and if each route in the same context is handled by a dedicated thread?
Yes excatly. You can define multiple froms in a single camel context
and each JMS listener is their own dedicated worker thread.

If using Spring DSL just add multiple <route> elements
<camelContext>
   <route>
    <from uri="x">
   <to uri="xxx">
   </route>

   <route>
    <from uri="y">
   <to uri="yyy">
   </route>
</camelContext>


In Java DSL you can just add multiple from in the same route builder
configure() method
public void configure() {
from(x).to(xxx);

from(y).to(yyy);
}

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Thu, Nov 20, 2008 at 10:37 AM, Coder One <co...@yahoo.com> wrote:
> The use case is that I need to run a single server (like a webapp) that listens into multiple queues and de-queues messages from a bunch of queues and route them further as fast as possible...
>
> Single process = Single webapp...really...
>
> The key is "as fast as possible" without having to start up another webapp.  I guess the question is if a camel supports multiple routes given a single context and if each route in the same context is handled by a dedicated thread?
>
> Thanks,
>
> --- On Wed, 11/19/08, Claus Ibsen <cl...@gmail.com> wrote:
>
>> From: Claus Ibsen <cl...@gmail.com>
>> Subject: Re: Competing Consumers Variant
>> To: camel-user@activemq.apache.org, coder_lol@yahoo.com
>> Date: Wednesday, November 19, 2008, 11:42 PM
>> Hi
>>
>> I think you need a polling consumer then that polls for a
>> given time
>> and then iterate the list of queues. I don't think you
>> kinda like
>> listen to multiple queues in a single thread/process?
>>
>> But I doubt that Camel has a DSL that does this out of the
>> box.
>>
>> And I guess the queues and topics should be durable
>> (persistent) so
>> you wont lose messages while polling other queues
>>
>> You can also try the ActiveMQ user forum as they might have
>> had such a
>> use case before.
>>
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>>
>> On Thu, Nov 20, 2008 at 7:39 AM, Coder One
>> <co...@yahoo.com> wrote:
>> > Clarification:
>> >
>> > I need to have a single server process listening on
>> multiple JMS queues/topics and then do the routing
>> accordingly...
>> >
>> > Thx...
>> >
>> >
>> > --- On Wed, 11/19/08, Coder One
>> <co...@yahoo.com> wrote:
>> >
>> >> From: Coder One <co...@yahoo.com>
>> >> Subject: Competing Consumers Variant
>> >> To: camel-user@activemq.apache.org
>> >> Date: Wednesday, November 19, 2008, 10:32 PM
>> >> From within a single Route configure() and
>> consumer, is it
>> >> possible to achieve the following:
>> >>
>> >> from("jms.A")...
>> >> from("jms.B")...
>> >> from("jms.C")...
>> >>
>> >> and have all from's execute concurrently?
>> >>
>> >> A bit more advanced, I need a route that can
>> dynamically
>> >> change the from piece based on some configuration
>> setting.
>> >> ie...do a
>> >>
>> >> from(senderList).blabla
>> >>
>> >> and have a separate thread executing each
>> sender...
>> >>
>> >> Thanks...
>> >
>> >
>> >
>> >
>> >
>
>
>
>
>

Re: Competing Consumers Variant

Posted by Coder One <co...@yahoo.com>.
The use case is that I need to run a single server (like a webapp) that listens into multiple queues and de-queues messages from a bunch of queues and route them further as fast as possible...

Single process = Single webapp...really...

The key is "as fast as possible" without having to start up another webapp.  I guess the question is if a camel supports multiple routes given a single context and if each route in the same context is handled by a dedicated thread?

Thanks,

--- On Wed, 11/19/08, Claus Ibsen <cl...@gmail.com> wrote:

> From: Claus Ibsen <cl...@gmail.com>
> Subject: Re: Competing Consumers Variant
> To: camel-user@activemq.apache.org, coder_lol@yahoo.com
> Date: Wednesday, November 19, 2008, 11:42 PM
> Hi
> 
> I think you need a polling consumer then that polls for a
> given time
> and then iterate the list of queues. I don't think you
> kinda like
> listen to multiple queues in a single thread/process?
> 
> But I doubt that Camel has a DSL that does this out of the
> box.
> 
> And I guess the queues and topics should be durable
> (persistent) so
> you wont lose messages while polling other queues
> 
> You can also try the ActiveMQ user forum as they might have
> had such a
> use case before.
> 
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 
> 
> On Thu, Nov 20, 2008 at 7:39 AM, Coder One
> <co...@yahoo.com> wrote:
> > Clarification:
> >
> > I need to have a single server process listening on
> multiple JMS queues/topics and then do the routing
> accordingly...
> >
> > Thx...
> >
> >
> > --- On Wed, 11/19/08, Coder One
> <co...@yahoo.com> wrote:
> >
> >> From: Coder One <co...@yahoo.com>
> >> Subject: Competing Consumers Variant
> >> To: camel-user@activemq.apache.org
> >> Date: Wednesday, November 19, 2008, 10:32 PM
> >> From within a single Route configure() and
> consumer, is it
> >> possible to achieve the following:
> >>
> >> from("jms.A")...
> >> from("jms.B")...
> >> from("jms.C")...
> >>
> >> and have all from's execute concurrently?
> >>
> >> A bit more advanced, I need a route that can
> dynamically
> >> change the from piece based on some configuration
> setting.
> >> ie...do a
> >>
> >> from(senderList).blabla
> >>
> >> and have a separate thread executing each
> sender...
> >>
> >> Thanks...
> >
> >
> >
> >
> >


      


Re: Competing Consumers Variant

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I think you need a polling consumer then that polls for a given time
and then iterate the list of queues. I don't think you kinda like
listen to multiple queues in a single thread/process?

But I doubt that Camel has a DSL that does this out of the box.

And I guess the queues and topics should be durable (persistent) so
you wont lose messages while polling other queues

You can also try the ActiveMQ user forum as they might have had such a
use case before.


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Thu, Nov 20, 2008 at 7:39 AM, Coder One <co...@yahoo.com> wrote:
> Clarification:
>
> I need to have a single server process listening on multiple JMS queues/topics and then do the routing accordingly...
>
> Thx...
>
>
> --- On Wed, 11/19/08, Coder One <co...@yahoo.com> wrote:
>
>> From: Coder One <co...@yahoo.com>
>> Subject: Competing Consumers Variant
>> To: camel-user@activemq.apache.org
>> Date: Wednesday, November 19, 2008, 10:32 PM
>> From within a single Route configure() and consumer, is it
>> possible to achieve the following:
>>
>> from("jms.A")...
>> from("jms.B")...
>> from("jms.C")...
>>
>> and have all from's execute concurrently?
>>
>> A bit more advanced, I need a route that can dynamically
>> change the from piece based on some configuration setting.
>> ie...do a
>>
>> from(senderList).blabla
>>
>> and have a separate thread executing each sender...
>>
>> Thanks...
>
>
>
>
>

Re: Competing Consumers Variant

Posted by Coder One <co...@yahoo.com>.
Clarification:

I need to have a single server process listening on multiple JMS queues/topics and then do the routing accordingly...

Thx...


--- On Wed, 11/19/08, Coder One <co...@yahoo.com> wrote:

> From: Coder One <co...@yahoo.com>
> Subject: Competing Consumers Variant
> To: camel-user@activemq.apache.org
> Date: Wednesday, November 19, 2008, 10:32 PM
> From within a single Route configure() and consumer, is it
> possible to achieve the following:
> 
> from("jms.A")...
> from("jms.B")...
> from("jms.C")...
> 
> and have all from's execute concurrently?
> 
> A bit more advanced, I need a route that can dynamically
> change the from piece based on some configuration setting. 
> ie...do a 
> 
> from(senderList).blabla
> 
> and have a separate thread executing each sender...
> 
> Thanks...


      


Competing Consumers Variant

Posted by Coder One <co...@yahoo.com>.
>From within a single Route configure() and consumer, is it possible to achieve the following:

from("jms.A")...
from("jms.B")...
from("jms.C")...

and have all from's execute concurrently?

A bit more advanced, I need a route that can dynamically change the from piece based on some configuration setting.  ie...do a 

from(senderList).blabla

and have a separate thread executing each sender...

Thanks...




      


RecipientList Distribution & JMS

Posted by Coder One <co...@yahoo.com>.
destionationIds="A" or "A,B,C"

from("direct:start").recipientList().header("destinationIds");

How can I distribute the above to JMS queue or topic A, B, C respectively?  Or similarly, would it be possible to name the JMS queues/topics as abc.xyz.A abc.xyz.B, and abc.xyz.C and route accordingly?

Thanks...