Camel routing issue

classic Classic list List threaded Threaded
56 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Camel routing issue

prabumca06@gmail.com

I have activemmq  Project in that i have following requirement

1.Move message from Inbound queue to type based inbound queue.
2.Move message from Message type inbound queue to outbound queue

I have created two bean for to achieve this.

1.one for move from inbound to message type  inbound queue
2.one for move from inbound to outbound queue.

I have following entry in camel.xml

   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
 
                <routeBuilder ref="routeBuilder" />
            <routeBuilder ref="routeBuilder1" /> 
               
    </camelContext>

    <bean id="routeBuilder" class="com.camel.routes.SinglecastRouteBuilder"/>
    <bean id="recipientsGenerator" class="com.camel.routes.TypeSpecificListBean"/>
    <bean id="routeBuilder1" class="com.camel.routes.MulticastRouteBuilder"/>               
    <bean id="recipientsGenerator1" class="com.camel.routes.RecipientListBean"/>

When i run application i am getting following error.

 java.lang.Exception: org.apache.camel.RuntimeCamelException: org.apache.camel.Fa
iledToCreateRouteException: Failed to create route route2: Route[[From[Inbound.G
MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint could be found
 for: Inbound.SSS.TestEvent, please check your classpath contains the needed Cam
el component jar.


I am not sure i am missing any configuration,Please kindly help me
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Claus Ibsen-2
Hi

Do as the exception tells you. Check route 2. You route from
"Inbound.SSS.TestEvent". And that is now know to Camel.

Maybe you need to add "activemq:" as prefix so its
"activemq:Inbound.SSS.TestEvent".


On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]
<[hidden email]> wrote:

>
> I have activemmq  Project in that i have following requirement
>
> 1.Move message from Inbound queue to type based inbound queue.
> 2.Move message from Message type inbound queue to outbound queue
>
> I have created two bean for to achieve this.
>
> 1.one for move from inbound to message type  inbound queue
> 2.one for move from inbound to outbound queue.
>
> I have following entry in camel.xml
>
>    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>
>                 <routeBuilder ref="routeBuilder" />
>             <routeBuilder ref="routeBuilder1" />
>
>     </camelContext>
>
>     <bean id="routeBuilder"
> class="com.camel.routes.SinglecastRouteBuilder"/>
>     <bean id="recipientsGenerator"
> class="com.camel.routes.TypeSpecificListBean"/>
>     <bean id="routeBuilder1"
> class="com.camel.routes.MulticastRouteBuilder"/>
>     <bean id="recipientsGenerator1"
> class="com.camel.routes.RecipientListBean"/>
>
> When i run application i am getting following error.
>
> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
> org.apache.camel.Fa
> iledToCreateRouteException: Failed to create route route2:
> Route[[From[Inbound.G
> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint could be
> found
>  for: Inbound.SSS.TestEvent, please check your classpath contains the needed
> Cam
> el component jar.*
>
> I am not sure i am missing any configuration,Please kindly help me
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

prabumca06@gmail.com
Hi Claus,

Thanks so much Clus for help.It is working now.

I need your guidance for the following requirement.

1.I have one inbound queue it will receive message frequently from my application.
2.From inbound queue i need camel routing to move message from another message based inbound queue based on message header value.
3.From message based inbound queue i need camel routing to move message to one or more outbound queue based on message content
 
I need camel java DSLsample code for above requirement.

Thanks in advance


On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <[hidden email]> wrote:
Hi

Do as the exception tells you. Check route 2. You route from
"Inbound.SSS.TestEvent". And that is now know to Camel.

Maybe you need to add "activemq:" as prefix so its
"activemq:Inbound.SSS.TestEvent".


On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]
<[hidden email]> wrote:

>
> I have activemmq  Project in that i have following requirement
>
> 1.Move message from Inbound queue to type based inbound queue.
> 2.Move message from Message type inbound queue to outbound queue
>
> I have created two bean for to achieve this.
>
> 1.one for move from inbound to message type  inbound queue
> 2.one for move from inbound to outbound queue.
>
> I have following entry in camel.xml
>
>    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>
>                 <routeBuilder ref="routeBuilder" />
>             <routeBuilder ref="routeBuilder1" />
>
>     </camelContext>
>
>     <bean id="routeBuilder"
> class="com.camel.routes.SinglecastRouteBuilder"/>
>     <bean id="recipientsGenerator"
> class="com.camel.routes.TypeSpecificListBean"/>
>     <bean id="routeBuilder1"
> class="com.camel.routes.MulticastRouteBuilder"/>
>     <bean id="recipientsGenerator1"
> class="com.camel.routes.RecipientListBean"/>
>
> When i run application i am getting following error.
>
> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
> org.apache.camel.Fa
> iledToCreateRouteException: Failed to create route route2:
> Route[[From[Inbound.G
> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint could be
> found
>  for: Inbound.SSS.TestEvent, please check your classpath contains the needed
> Cam
> el component jar.*
>
> I am not sure i am missing any configuration,Please kindly help me
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen



If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730109.html
To unsubscribe from Camel routing issue, click here.
NAML



--
Thanks & Regards
 Prabu.N
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Walzer, Thomas
Hi,

you could start by reading Claus´ book (p. 44ff) which has a perfect example or http://camel.apache.org/content-based-router.html (just replace the direct: with your queues).
If you need to fire your messages to multiple queues: http://camel.apache.org/publish-subscribe-channel.html shows you the various ways.
When you get the concepts you can just "lego" them together.

Regards, Thomas.

Am 30.03.2013 um 19:05 schrieb "[hidden email]" <[hidden email]>:

> Hi Claus,
>
> Thanks so much Clus for help.It is working now.
>
> I need your guidance for the following requirement.
>
> 1.I have one *inbound queue* it will receive message frequently from my
> application.
> 2.From *inbound queue* i need camel routing to move message from
> another *message
> based inbound queue* based on message header value.
> 3.From *message based inbound queue *i* *need camel routing to move message
> to *one or more outbound queue *based on message content*
> *
>
> I need *camel java DSL*sample code for above requirement.*
> *
> *
> *
> *Thanks in advance*
>
>
> On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
> [hidden email]> wrote:
>
>> Hi
>>
>> Do as the exception tells you. Check route 2. You route from
>> "Inbound.SSS.TestEvent". And that is now know to Camel.
>>
>> Maybe you need to add "activemq:" as prefix so its
>> "activemq:Inbound.SSS.TestEvent".
>>
>>
>> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730109&i=1>>
>> wrote:
>>
>>>
>>> I have activemmq  Project in that i have following requirement
>>>
>>> 1.Move message from Inbound queue to type based inbound queue.
>>> 2.Move message from Message type inbound queue to outbound queue
>>>
>>> I have created two bean for to achieve this.
>>>
>>> 1.one for move from inbound to message type  inbound queue
>>> 2.one for move from inbound to outbound queue.
>>>
>>> I have following entry in camel.xml
>>>
>>>   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>>
>>>
>>>                <routeBuilder ref="routeBuilder" />
>>>            <routeBuilder ref="routeBuilder1" />
>>>
>>>    </camelContext>
>>>
>>>    <bean id="routeBuilder"
>>> class="com.camel.routes.SinglecastRouteBuilder"/>
>>>    <bean id="recipientsGenerator"
>>> class="com.camel.routes.TypeSpecificListBean"/>
>>>    <bean id="routeBuilder1"
>>> class="com.camel.routes.MulticastRouteBuilder"/>
>>>    <bean id="recipientsGenerator1"
>>> class="com.camel.routes.RecipientListBean"/>
>>>
>>> When i run application i am getting following error.
>>>
>>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
>>> org.apache.camel.Fa
>>> iledToCreateRouteException: Failed to create route route2:
>>> Route[[From[Inbound.G
>>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint could
>> be
>>> found
>>> for: Inbound.SSS.TestEvent, please check your classpath contains the
>> needed
>>> Cam
>>> el component jar.*
>>>
>>> I am not sure i am missing any configuration,Please kindly help me
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730109.html
>> To unsubscribe from Camel routing issue, click here<
>> .
>> NAML<
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
> --
> Thanks & Regards
> Prabu.N
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

prabumca06@gmail.com
Thanks Walzer..

Queston1:

Example
.when(header("foo").isEqualTo("bar"))
                    .to("direct:b")

In my case i have to add more than 80 condition and forwards to 80 different queues.

Above example i can only hard-code queue name,But what i want is below.

.when(header("Type").isNotNull()) .to("activemq.Inbound."+header("Type"))

Example:If queue type is test,It should forward to Inbound.test queue.

Above example i tried,but it did not worked,created queue something like this Inbound.header("type")
Question2:
from("direct:a")
            .multicast().to("direct:b", "direct:c", "direct:d");
 
Based on messages header and content type i want forward to different queue.
condition will be OR and AND.How can i do that like above example.

Thanks in advance
Regards
Prabu.N












On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <[hidden email]> wrote:
Hi,

you could start by reading Claus´ book (p. 44ff) which has a perfect example or http://camel.apache.org/content-based-router.html (
just replace the direct: with your queues).
If you need to fire your messages to multiple queues: http://camel.apache.org/publish-subscribe-channel.html
 shows you the various ways.
When you get the concepts you can just "lego" them together.

Regards, Thomas.

Am 30.03.2013 um 19:05 schrieb "[hidden email]" <[hidden email]>:

> Hi Claus,
>
> Thanks so much Clus for help.It is working now.
>
> I need your guidance for the following requirement.
>
> 1.I have one *inbound queue* it will receive message frequently from my

> application.
> 2.From *inbound queue* i need camel routing to move message from
> another *message
> based inbound queue* based on message header value.
> 3.From *message based inbound queue *i* *need camel routing to move message
> to *one or more outbound queue *based on message content*
> *
>
> I need *camel java DSL*sample code for above requirement.*
> *
> *
> *
> *Thanks in advance*
>
>
> On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
> [hidden email]> wrote:

>
>> Hi
>>
>> Do as the exception tells you. Check route 2. You route from
>> "Inbound.SSS.TestEvent". And that is now know to Camel.
>>
>> Maybe you need to add "activemq:" as prefix so its
>> "activemq:Inbound.SSS.TestEvent".
>>
>>
>> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730109&i=1>>
>> wrote:

>>
>>>
>>> I have activemmq  Project in that i have following requirement
>>>
>>> 1.Move message from Inbound queue to type based inbound queue.
>>> 2.Move message from Message type inbound queue to outbound queue
>>>
>>> I have created two bean for to achieve this.
>>>
>>> 1.one for move from inbound to message type  inbound queue
>>> 2.one for move from inbound to outbound queue.
>>>
>>> I have following entry in camel.xml
>>>
>>>   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>>
>>>
>>>                <routeBuilder ref="routeBuilder" />
>>>            <routeBuilder ref="routeBuilder1" />
>>>
>>>    </camelContext>
>>>
>>>    <bean id="routeBuilder"
>>> class="com.camel.routes.SinglecastRouteBuilder"/>
>>>    <bean id="recipientsGenerator"
>>> class="com.camel.routes.
TypeSpecificListBean"/>
>>>    <bean id="routeBuilder1"
>>> class="com.camel.routes.
MulticastRouteBuilder"/>
>>>    <bean id="recipientsGenerator1"
>>> class="com.camel.routes.
RecipientListBean"/>
>>>
>>> When i run application i am getting following error.
>>>
>>> * java.lang.Exception: org.apache.camel.
RuntimeCamelException:
>>> org.apache.camel.Fa
>>> iledToCreateRouteException: Failed to create route route2:
>>> Route[[From[Inbound.G
>>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint could
>> be
>>> found
>>> for: Inbound.SSS.TestEvent, please check your classpath contains the
>> needed
>>> Cam
>>> el component jar.*
>>>
>>> I am not sure i am missing any configuration,Please kindly help me
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>>

>> .
>> NAML<
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>

>
>
>
> --
> Thanks & Regards
> Prabu.N
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html

> Sent from the Camel - Users mailing list archive at Nabble.com.




If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
To unsubscribe from Camel routing issue, click here.
NAML



--
Thanks & Regards
 Prabu.N
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Claus Ibsen-2
Hi

See this FAQ
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html




On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
<[hidden email]>wrote:

> Thanks Walzer..
> *
> *
> *Queston1:
>
> *
> *Example*
>
> .when(header("foo").isEqualTo("bar"))
>                     .to("direct:b")
>
> In my case i have to add more than 80 condition and forwards to 80
> different queues.
>
> Above example i can only hard-code queue name,But what i want is below.
>
> * .when(header("Type").isNotNull())
>     .to("activemq.Inbound."+header("Type"))
> *
>
> Example:If queue type is test,It should forward to *Inbound.test* queue.
>
> Above example i tried,but it did not worked,created queue something
> like this *Inbound.header("type")*
>
> *Question2*:
>
> from("direct:a")
>             .multicast().to("direct:b", "direct:c", "direct:d");
>
> Based on messages header and content type i want forward to different
> queue.
>
> condition will be *OR *and *AND*.How can i do that like above example.*
> *
>
> Thanks in advance*
> *
>
> *Regards*
>
> Prabu.N
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
> [hidden email]> wrote:
>
> > Hi,
> >
> > you could start by reading Claus´ book (p. 44ff) which has a perfect
> > example or http://camel.apache.org/content-based-router.html (just
> > replace the direct: with your queues).
> > If you need to fire your messages to multiple queues:
> > http://camel.apache.org/publish-subscribe-channel.html shows you the
> > various ways.
> > When you get the concepts you can just "lego" them together.
> >
> > Regards, Thomas.
> >
> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
> > <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
> >
> > > Hi Claus,
> > >
> > > Thanks so much Clus for help.It is working now.
> > >
> > > I need your guidance for the following requirement.
> > >
> > > 1.I have one *inbound queue* it will receive message frequently from my
> > > application.
> > > 2.From *inbound queue* i need camel routing to move message from
> > > another *message
> > > based inbound queue* based on message header value.
> > > 3.From *message based inbound queue *i* *need camel routing to move
> > message
> > > to *one or more outbound queue *based on message content*
> > > *
> > >
> > > I need *camel java DSL*sample code for above requirement.*
> > > *
> > > *
> > > *
> > > *Thanks in advance*
> > >
> > >
> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
> > wrote:
> > >
> > >> Hi
> > >>
> > >> Do as the exception tells you. Check route 2. You route from
> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
> > >>
> > >> Maybe you need to add "activemq:" as prefix so its
> > >> "activemq:Inbound.SSS.TestEvent".
> > >>
> > >>
> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
> > >> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730109&i=1
> >>
> >
> > >> wrote:
> > >>
> > >>>
> > >>> I have activemmq  Project in that i have following requirement
> > >>>
> > >>> 1.Move message from Inbound queue to type based inbound queue.
> > >>> 2.Move message from Message type inbound queue to outbound queue
> > >>>
> > >>> I have created two bean for to achieve this.
> > >>>
> > >>> 1.one for move from inbound to message type  inbound queue
> > >>> 2.one for move from inbound to outbound queue.
> > >>>
> > >>> I have following entry in camel.xml
> > >>>
> > >>>   <camelContext id="camel" xmlns="
> > http://camel.apache.org/schema/spring">
> > >>
> > >>>
> > >>>                <routeBuilder ref="routeBuilder" />
> > >>>            <routeBuilder ref="routeBuilder1" />
> > >>>
> > >>>    </camelContext>
> > >>>
> > >>>    <bean id="routeBuilder"
> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
> > >>>    <bean id="recipientsGenerator"
> > >>> class="com.camel.routes.TypeSpecificListBean"/>
> > >>>    <bean id="routeBuilder1"
> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
> > >>>    <bean id="recipientsGenerator1"
> > >>> class="com.camel.routes.RecipientListBean"/>
> > >>>
> > >>> When i run application i am getting following error.
> > >>>
> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
> > >>> org.apache.camel.Fa
> > >>> iledToCreateRouteException: Failed to create route route2:
> > >>> Route[[From[Inbound.G
> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
> > could
> > >> be
> > >>> found
> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains the
> > >> needed
> > >>> Cam
> > >>> el component jar.*
> > >>>
> > >>> I am not sure i am missing any configuration,Please kindly help me
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> View this message in context:
> > >> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
> > >>
> > >>
> > >>
> > >> --
> > >> Claus Ibsen
> > >> -----------------
> > >> Red Hat, Inc.
> > >> FuseSource is now part of Red Hat
> > >> Email: [hidden email]<
> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
> > >> Web: http://fusesource.com
> > >> Twitter: davsclaus
> > >> Blog: http://davsclaus.com
> > >> Author of Camel in Action: http://www.manning.com/ibsen
> > >>
> > >>
> > >> ------------------------------
> > >> If you reply to this email, your message will be added to the
> > discussion
> > >> below:
> > >>
> > >>
> >
> > >> .
> > >> NAML<
> >
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
> > >>
> > >
> > >
> > >
> > > --
> > > Thanks & Regards
> > > Prabu.N
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
> >
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
> >  To unsubscribe from Camel routing issue, click here<
> >
> > .
> > NAML<
>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
> --
> Thanks & Regards
>  Prabu.N
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Chris Wolf
Hi Claus,

I hate to ask this - but I still don't get it.  I thought
"recipientList" was for sending to multiple, runtime-defined
recipients.  I don't see how this
answers the question of sending to one, single recipient, whose URI is
dynamically constructed - and in my use-case the dynamic settings
are not in properties - so "simple" (property place-holders) won't help me.

Let me give you a concrete example.  I need to do an ftp download and
the connection information comes from up-stream in the route in the
form of XML (DOM - a Document instance).  Currently, I am trying to do
this with bean binding and method params decorated with @XPath
pointing into the Document with the ftp settings and inside the
this method doing:

FtpComponent ftpComponent = context.getComponent("ftp", FtpComponent.class);

..and then attempt to get the endpoint and call createConsumer(...).
I'm sure this is not the right way to do it, but I don't see how else
- any ideas?

Thanks,


Chris

On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> See this FAQ
> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>
>
>
>
> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
> <[hidden email]>wrote:
>
>> Thanks Walzer..
>> *
>> *
>> *Queston1:
>>
>> *
>> *Example*
>>
>> .when(header("foo").isEqualTo("bar"))
>>                     .to("direct:b")
>>
>> In my case i have to add more than 80 condition and forwards to 80
>> different queues.
>>
>> Above example i can only hard-code queue name,But what i want is below.
>>
>> * .when(header("Type").isNotNull())
>>     .to("activemq.Inbound."+header("Type"))
>> *
>>
>> Example:If queue type is test,It should forward to *Inbound.test* queue.
>>
>> Above example i tried,but it did not worked,created queue something
>> like this *Inbound.header("type")*
>>
>> *Question2*:
>>
>> from("direct:a")
>>             .multicast().to("direct:b", "direct:c", "direct:d");
>>
>> Based on messages header and content type i want forward to different
>> queue.
>>
>> condition will be *OR *and *AND*.How can i do that like above example.*
>> *
>>
>> Thanks in advance*
>> *
>>
>> *Regards*
>>
>> Prabu.N
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
>> [hidden email]> wrote:
>>
>> > Hi,
>> >
>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
>> > example or http://camel.apache.org/content-based-router.html (just
>> > replace the direct: with your queues).
>> > If you need to fire your messages to multiple queues:
>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
>> > various ways.
>> > When you get the concepts you can just "lego" them together.
>> >
>> > Regards, Thomas.
>> >
>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
>> > <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
>> >
>> > > Hi Claus,
>> > >
>> > > Thanks so much Clus for help.It is working now.
>> > >
>> > > I need your guidance for the following requirement.
>> > >
>> > > 1.I have one *inbound queue* it will receive message frequently from my
>> > > application.
>> > > 2.From *inbound queue* i need camel routing to move message from
>> > > another *message
>> > > based inbound queue* based on message header value.
>> > > 3.From *message based inbound queue *i* *need camel routing to move
>> > message
>> > > to *one or more outbound queue *based on message content*
>> > > *
>> > >
>> > > I need *camel java DSL*sample code for above requirement.*
>> > > *
>> > > *
>> > > *
>> > > *Thanks in advance*
>> > >
>> > >
>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
>> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
>> > wrote:
>> > >
>> > >> Hi
>> > >>
>> > >> Do as the exception tells you. Check route 2. You route from
>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
>> > >>
>> > >> Maybe you need to add "activemq:" as prefix so its
>> > >> "activemq:Inbound.SSS.TestEvent".
>> > >>
>> > >>
>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>> > >> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730109&i=1
>> >>
>> >
>> > >> wrote:
>> > >>
>> > >>>
>> > >>> I have activemmq  Project in that i have following requirement
>> > >>>
>> > >>> 1.Move message from Inbound queue to type based inbound queue.
>> > >>> 2.Move message from Message type inbound queue to outbound queue
>> > >>>
>> > >>> I have created two bean for to achieve this.
>> > >>>
>> > >>> 1.one for move from inbound to message type  inbound queue
>> > >>> 2.one for move from inbound to outbound queue.
>> > >>>
>> > >>> I have following entry in camel.xml
>> > >>>
>> > >>>   <camelContext id="camel" xmlns="
>> > http://camel.apache.org/schema/spring">
>> > >>
>> > >>>
>> > >>>                <routeBuilder ref="routeBuilder" />
>> > >>>            <routeBuilder ref="routeBuilder1" />
>> > >>>
>> > >>>    </camelContext>
>> > >>>
>> > >>>    <bean id="routeBuilder"
>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
>> > >>>    <bean id="recipientsGenerator"
>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
>> > >>>    <bean id="routeBuilder1"
>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
>> > >>>    <bean id="recipientsGenerator1"
>> > >>> class="com.camel.routes.RecipientListBean"/>
>> > >>>
>> > >>> When i run application i am getting following error.
>> > >>>
>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
>> > >>> org.apache.camel.Fa
>> > >>> iledToCreateRouteException: Failed to create route route2:
>> > >>> Route[[From[Inbound.G
>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
>> > could
>> > >> be
>> > >>> found
>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains the
>> > >> needed
>> > >>> Cam
>> > >>> el component jar.*
>> > >>>
>> > >>> I am not sure i am missing any configuration,Please kindly help me
>> > >>>
>> > >>>
>> > >>>
>> > >>>
>> > >>> --
>> > >>> View this message in context:
>> > >> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >> Claus Ibsen
>> > >> -----------------
>> > >> Red Hat, Inc.
>> > >> FuseSource is now part of Red Hat
>> > >> Email: [hidden email]<
>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>> > >> Web: http://fusesource.com
>> > >> Twitter: davsclaus
>> > >> Blog: http://davsclaus.com
>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>> > >>
>> > >>
>> > >> ------------------------------
>> > >> If you reply to this email, your message will be added to the
>> > discussion
>> > >> below:
>> > >>
>> > >>
>> >
>> > >> .
>> > >> NAML<
>> >
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>> >
>> > >>
>> > >
>> > >
>> > >
>> > > --
>> > > Thanks & Regards
>> > > Prabu.N
>> > >
>> > >
>> > >
>> > >
>> > > --
>> > > View this message in context:
>> >
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
>> >
>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >
>> >
>> >
>> > ------------------------------
>> >  If you reply to this email, your message will be added to the discussion
>> > below:
>> >
>> >
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
>> >  To unsubscribe from Camel routing issue, click here<
>> >
>> > .
>> > NAML<
>>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>> >
>>
>>
>>
>> --
>> Thanks & Regards
>>  Prabu.N
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Chris Wolf
Ok, I'm starting to get it - a little bit.  As for my concrete
example, so far, I have:

                from("direct:start")
                .beanRef("config")
                .convertBodyTo(Document.class)
                .recipientList().xquery(
                    "concat('ftp://'" +
                    ",//remote[vendorId/@value='CBOE34']/server/@value" +

",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
+
                    ",'?noop=true&amp;username='" +
                    ",//remote[vendorId/@value='CBOE34']/username/@value" +
                    ",'&amp;password='" +

",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);

Here's the problem - this will create an FTP Producer - that's not
what I need.  I need a dynamically
constructed URI for a polling FTP consumer.  I don't think
"recipientList" will work...   Any ideas?

Thanks,

Chris

On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]> wrote:

> Hi Claus,
>
> I hate to ask this - but I still don't get it.  I thought
> "recipientList" was for sending to multiple, runtime-defined
> recipients.  I don't see how this
> answers the question of sending to one, single recipient, whose URI is
> dynamically constructed - and in my use-case the dynamic settings
> are not in properties - so "simple" (property place-holders) won't help me.
>
> Let me give you a concrete example.  I need to do an ftp download and
> the connection information comes from up-stream in the route in the
> form of XML (DOM - a Document instance).  Currently, I am trying to do
> this with bean binding and method params decorated with @XPath
> pointing into the Document with the ftp settings and inside the
> this method doing:
>
> FtpComponent ftpComponent = context.getComponent("ftp", FtpComponent.class);
>
> ..and then attempt to get the endpoint and call createConsumer(...).
> I'm sure this is not the right way to do it, but I don't see how else
> - any ideas?
>
> Thanks,
>
>
> Chris
>
> On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]> wrote:
>> Hi
>>
>> See this FAQ
>> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>>
>>
>>
>>
>> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
>> <[hidden email]>wrote:
>>
>>> Thanks Walzer..
>>> *
>>> *
>>> *Queston1:
>>>
>>> *
>>> *Example*
>>>
>>> .when(header("foo").isEqualTo("bar"))
>>>                     .to("direct:b")
>>>
>>> In my case i have to add more than 80 condition and forwards to 80
>>> different queues.
>>>
>>> Above example i can only hard-code queue name,But what i want is below.
>>>
>>> * .when(header("Type").isNotNull())
>>>     .to("activemq.Inbound."+header("Type"))
>>> *
>>>
>>> Example:If queue type is test,It should forward to *Inbound.test* queue.
>>>
>>> Above example i tried,but it did not worked,created queue something
>>> like this *Inbound.header("type")*
>>>
>>> *Question2*:
>>>
>>> from("direct:a")
>>>             .multicast().to("direct:b", "direct:c", "direct:d");
>>>
>>> Based on messages header and content type i want forward to different
>>> queue.
>>>
>>> condition will be *OR *and *AND*.How can i do that like above example.*
>>> *
>>>
>>> Thanks in advance*
>>> *
>>>
>>> *Regards*
>>>
>>> Prabu.N
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
>>> [hidden email]> wrote:
>>>
>>> > Hi,
>>> >
>>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
>>> > example or http://camel.apache.org/content-based-router.html (just
>>> > replace the direct: with your queues).
>>> > If you need to fire your messages to multiple queues:
>>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
>>> > various ways.
>>> > When you get the concepts you can just "lego" them together.
>>> >
>>> > Regards, Thomas.
>>> >
>>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
>>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
>>> > <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
>>> >
>>> > > Hi Claus,
>>> > >
>>> > > Thanks so much Clus for help.It is working now.
>>> > >
>>> > > I need your guidance for the following requirement.
>>> > >
>>> > > 1.I have one *inbound queue* it will receive message frequently from my
>>> > > application.
>>> > > 2.From *inbound queue* i need camel routing to move message from
>>> > > another *message
>>> > > based inbound queue* based on message header value.
>>> > > 3.From *message based inbound queue *i* *need camel routing to move
>>> > message
>>> > > to *one or more outbound queue *based on message content*
>>> > > *
>>> > >
>>> > > I need *camel java DSL*sample code for above requirement.*
>>> > > *
>>> > > *
>>> > > *
>>> > > *Thanks in advance*
>>> > >
>>> > >
>>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
>>> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
>>> > wrote:
>>> > >
>>> > >> Hi
>>> > >>
>>> > >> Do as the exception tells you. Check route 2. You route from
>>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
>>> > >>
>>> > >> Maybe you need to add "activemq:" as prefix so its
>>> > >> "activemq:Inbound.SSS.TestEvent".
>>> > >>
>>> > >>
>>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
>>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>>> > >> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730109&i=1
>>> >>
>>> >
>>> > >> wrote:
>>> > >>
>>> > >>>
>>> > >>> I have activemmq  Project in that i have following requirement
>>> > >>>
>>> > >>> 1.Move message from Inbound queue to type based inbound queue.
>>> > >>> 2.Move message from Message type inbound queue to outbound queue
>>> > >>>
>>> > >>> I have created two bean for to achieve this.
>>> > >>>
>>> > >>> 1.one for move from inbound to message type  inbound queue
>>> > >>> 2.one for move from inbound to outbound queue.
>>> > >>>
>>> > >>> I have following entry in camel.xml
>>> > >>>
>>> > >>>   <camelContext id="camel" xmlns="
>>> > http://camel.apache.org/schema/spring">
>>> > >>
>>> > >>>
>>> > >>>                <routeBuilder ref="routeBuilder" />
>>> > >>>            <routeBuilder ref="routeBuilder1" />
>>> > >>>
>>> > >>>    </camelContext>
>>> > >>>
>>> > >>>    <bean id="routeBuilder"
>>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
>>> > >>>    <bean id="recipientsGenerator"
>>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
>>> > >>>    <bean id="routeBuilder1"
>>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
>>> > >>>    <bean id="recipientsGenerator1"
>>> > >>> class="com.camel.routes.RecipientListBean"/>
>>> > >>>
>>> > >>> When i run application i am getting following error.
>>> > >>>
>>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
>>> > >>> org.apache.camel.Fa
>>> > >>> iledToCreateRouteException: Failed to create route route2:
>>> > >>> Route[[From[Inbound.G
>>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
>>> > could
>>> > >> be
>>> > >>> found
>>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains the
>>> > >> needed
>>> > >>> Cam
>>> > >>> el component jar.*
>>> > >>>
>>> > >>> I am not sure i am missing any configuration,Please kindly help me
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>> --
>>> > >>> View this message in context:
>>> > >> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>> > >>
>>> > >>
>>> > >>
>>> > >> --
>>> > >> Claus Ibsen
>>> > >> -----------------
>>> > >> Red Hat, Inc.
>>> > >> FuseSource is now part of Red Hat
>>> > >> Email: [hidden email]<
>>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>>> > >> Web: http://fusesource.com
>>> > >> Twitter: davsclaus
>>> > >> Blog: http://davsclaus.com
>>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>>> > >>
>>> > >>
>>> > >> ------------------------------
>>> > >> If you reply to this email, your message will be added to the
>>> > discussion
>>> > >> below:
>>> > >>
>>> > >>
>>> >
>>> > >> .
>>> > >> NAML<
>>> >
>>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>> >
>>> >
>>> > >>
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > Thanks & Regards
>>> > > Prabu.N
>>> > >
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > View this message in context:
>>> >
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
>>> >
>>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>>> >
>>> >
>>> >
>>> > ------------------------------
>>> >  If you reply to this email, your message will be added to the discussion
>>> > below:
>>> >
>>> >
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
>>> >  To unsubscribe from Camel routing issue, click here<
>>> >
>>> > .
>>> > NAML<
>>>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Thanks & Regards
>>>  Prabu.N
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: [hidden email]
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

prabumca06@gmail.com

Thanks for your faq url,but I did not understand anything from that faq.

as I told already 

.to("activemq.Inbound."+ header(" Type")

Please kindly provide with example.

Thanks
Prabu.n

On Mar 31, 2013 11:22 PM, "Chris Wolf [via Camel]" <[hidden email]> wrote:
Ok, I'm starting to get it - a little bit.  As for my concrete
example, so far, I have:

                from("direct:start")
                .beanRef("config")
                .convertBodyTo(Document.class)
                .recipientList().xquery(
                    "concat('ftp://'" +
                    ",//remote[vendorId/@value='CBOE34']/server/@value" +

",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
+
                    ",'?noop=true&amp;username='" +
                    ",//remote[vendorId/@value='CBOE34']/username/@value" +
                    ",'&amp;password='" +

",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);

Here's the problem - this will create an FTP Producer - that's not
what I need.  I need a dynamically
constructed URI for a polling FTP consumer.  I don't think
"recipientList" will work...   Any ideas?

Thanks,

Chris

On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]> wrote:

> Hi Claus,
>
> I hate to ask this - but I still don't get it.  I thought
> "recipientList" was for sending to multiple, runtime-defined
> recipients.  I don't see how this
> answers the question of sending to one, single recipient, whose URI is
> dynamically constructed - and in my use-case the dynamic settings
> are not in properties - so "simple" (property place-holders) won't help me.
>
> Let me give you a concrete example.  I need to do an ftp download and
> the connection information comes from up-stream in the route in the
> form of XML (DOM - a Document instance).  Currently, I am trying to do
> this with bean binding and method params decorated with @XPath
> pointing into the Document with the ftp settings and inside the
> this method doing:
>
> FtpComponent ftpComponent = context.getComponent("ftp", FtpComponent.class);
>
> ..and then attempt to get the endpoint and call createConsumer(...).
> I'm sure this is not the right way to do it, but I don't see how else
> - any ideas?
>
> Thanks,
>
>
> Chris
>
> On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]> wrote:
>> Hi
>>
>> See this FAQ
>> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>>
>>
>>
>>
>> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
>> <[hidden email]>wrote:
>>
>>> Thanks Walzer..
>>> *
>>> *
>>> *Queston1:
>>>
>>> *
>>> *Example*
>>>
>>> .when(header("foo").isEqualTo("bar"))
>>>                     .to("direct:b")
>>>
>>> In my case i have to add more than 80 condition and forwards to 80
>>> different queues.
>>>
>>> Above example i can only hard-code queue name,But what i want is below.
>>>
>>> * .when(header("Type").isNotNull())
>>>     .to("activemq.Inbound."+header("Type"))
>>> *
>>>
>>> Example:If queue type is test,It should forward to *Inbound.test* queue.
>>>
>>> Above example i tried,but it did not worked,created queue something
>>> like this *Inbound.header("type")*
>>>
>>> *Question2*:
>>>
>>> from("direct:a")
>>>             .multicast().to("direct:b", "direct:c", "direct:d");
>>>
>>> Based on messages header and content type i want forward to different
>>> queue.
>>>
>>> condition will be *OR *and *AND*.How can i do that like above example.*
>>> *
>>>
>>> Thanks in advance*
>>> *
>>>
>>> *Regards*
>>>
>>> Prabu.N
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
>>> [hidden email]> wrote:
>>>
>>> > Hi,
>>> >
>>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
>>> > example or http://camel.apache.org/content-based-router.html (just
>>> > replace the direct: with your queues).
>>> > If you need to fire your messages to multiple queues:
>>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
>>> > various ways.
>>> > When you get the concepts you can just "lego" them together.
>>> >
>>> > Regards, Thomas.
>>> >
>>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
>>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
>>> > <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
>>> >
>>> > > Hi Claus,
>>> > >
>>> > > Thanks so much Clus for help.It is working now.
>>> > >
>>> > > I need your guidance for the following requirement.
>>> > >
>>> > > 1.I have one *inbound queue* it will receive message frequently from my
>>> > > application.
>>> > > 2.From *inbound queue* i need camel routing to move message from
>>> > > another *message
>>> > > based inbound queue* based on message header value.
>>> > > 3.From *message based inbound queue *i* *need camel routing to move
>>> > message
>>> > > to *one or more outbound queue *based on message content*
>>> > > *
>>> > >
>>> > > I need *camel java DSL*sample code for above requirement.*
>>> > > *
>>> > > *
>>> > > *
>>> > > *Thanks in advance*
>>> > >
>>> > >
>>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
>>> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
>>> > wrote:
>>> > >
>>> > >> Hi
>>> > >>
>>> > >> Do as the exception tells you. Check route 2. You route from
>>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
>>> > >>
>>> > >> Maybe you need to add "activemq:" as prefix so its
>>> > >> "activemq:Inbound.SSS.TestEvent".
>>> > >>
>>> > >>
>>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
>>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>>> > >> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730109&i=1
>>> >>

>>> >
>>> > >> wrote:
>>> > >>
>>> > >>>
>>> > >>> I have activemmq  Project in that i have following requirement
>>> > >>>
>>> > >>> 1.Move message from Inbound queue to type based inbound queue.
>>> > >>> 2.Move message from Message type inbound queue to outbound queue
>>> > >>>
>>> > >>> I have created two bean for to achieve this.
>>> > >>>
>>> > >>> 1.one for move from inbound to message type  inbound queue
>>> > >>> 2.one for move from inbound to outbound queue.
>>> > >>>
>>> > >>> I have following entry in camel.xml
>>> > >>>
>>> > >>>   <camelContext id="camel" xmlns="
>>> > http://camel.apache.org/schema/spring">
>>> > >>
>>> > >>>
>>> > >>>                <routeBuilder ref="routeBuilder" />
>>> > >>>            <routeBuilder ref="routeBuilder1" />
>>> > >>>
>>> > >>>    </camelContext>
>>> > >>>
>>> > >>>    <bean id="routeBuilder"
>>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
>>> > >>>    <bean id="recipientsGenerator"
>>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
>>> > >>>    <bean id="routeBuilder1"
>>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
>>> > >>>    <bean id="recipientsGenerator1"
>>> > >>> class="com.camel.routes.RecipientListBean"/>
>>> > >>>
>>> > >>> When i run application i am getting following error.
>>> > >>>
>>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
>>> > >>> org.apache.camel.Fa
>>> > >>> iledToCreateRouteException: Failed to create route route2:
>>> > >>> Route[[From[Inbound.G
>>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
>>> > could
>>> > >> be
>>> > >>> found
>>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains the
>>> > >> needed
>>> > >>> Cam
>>> > >>> el component jar.*
>>> > >>>
>>> > >>> I am not sure i am missing any configuration,Please kindly help me
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>> --
>>> > >>> View this message in context:
>>> > >> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.

>>> > >>
>>> > >>
>>> > >>
>>> > >> --
>>> > >> Claus Ibsen
>>> > >> -----------------
>>> > >> Red Hat, Inc.
>>> > >> FuseSource is now part of Red Hat
>>> > >> Email: [hidden email]<
>>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>>> > >> Web: http://fusesource.com
>>> > >> Twitter: davsclaus
>>> > >> Blog: http://davsclaus.com
>>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>>> > >> >>> >

>>> >
>>> > >>
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > Thanks & Regards
>>> > > Prabu.N
>>> > >
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > View this message in context:
>>> >
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
>>> >

>>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>>> >
>>> >
>>> >
>>> > ------------------------------
>>> >  If you reply to this email, your message will be added to the discussion
>>> > below:
>>> >
>>> >
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
>>> >  To unsubscribe from Camel routing issue, click here<
>>> >
>>> > .
>>> > NAML<
>>>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>> >

>>> >
>>>
>>>
>>>
>>> --
>>> Thanks & Regards
>>>  Prabu.N
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.

>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: [hidden email]
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen



If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730134.html
To unsubscribe from Camel routing issue, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Chris Wolf
Here you go:


                .choice().when(header("Type").isNotNull())
                    .recipientList(simple("activemq.Inbound.${header.Type}"))
                .endChoice()


Sorry for hijacking your thread, but I also was not getting
"recipientList" to implement dynamic destinations.  I get it now,
pretty much,
I just don't know how to specify a polling consumer with dynamic uri...

Regards,

Chris

On Sun, Mar 31, 2013 at 2:21 PM, [hidden email]
<[hidden email]> wrote:

> Thanks for your faq url,but I did not understand anything from that faq.
>
> as I told already
>
> .to("activemq.Inbound."+ header(" Type")
>
> Please kindly provide with example.
>
> Thanks
> Prabu.n
> On Mar 31, 2013 11:22 PM, "Chris Wolf [via Camel]" <
> [hidden email]> wrote:
>
>> Ok, I'm starting to get it - a little bit.  As for my concrete
>> example, so far, I have:
>>
>>                 from("direct:start")
>>                 .beanRef("config")
>>                 .convertBodyTo(Document.class)
>>                 .recipientList().xquery(
>>                     "concat('ftp://'" +
>>                     ",//remote[vendorId/@value='CBOE34']/server/@value" +
>>
>> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
>>
>> +
>>                     ",'?noop=true&amp;username='" +
>>                     ",//remote[vendorId/@value='CBOE34']/username/@value"
>> +
>>                     ",'&amp;password='" +
>>
>> ",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);
>>
>> Here's the problem - this will create an FTP Producer - that's not
>> what I need.  I need a dynamically
>> constructed URI for a polling FTP consumer.  I don't think
>> "recipientList" will work...   Any ideas?
>>
>> Thanks,
>>
>> Chris
>>
>> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]<http://user/SendEmail.jtp?type=node&node=5730134&i=0>>
>> wrote:
>>
>> > Hi Claus,
>> >
>> > I hate to ask this - but I still don't get it.  I thought
>> > "recipientList" was for sending to multiple, runtime-defined
>> > recipients.  I don't see how this
>> > answers the question of sending to one, single recipient, whose URI is
>> > dynamically constructed - and in my use-case the dynamic settings
>> > are not in properties - so "simple" (property place-holders) won't help
>> me.
>> >
>> > Let me give you a concrete example.  I need to do an ftp download and
>> > the connection information comes from up-stream in the route in the
>> > form of XML (DOM - a Document instance).  Currently, I am trying to do
>> > this with bean binding and method params decorated with @XPath
>> > pointing into the Document with the ftp settings and inside the
>> > this method doing:
>> >
>> > FtpComponent ftpComponent = context.getComponent("ftp",
>> FtpComponent.class);
>> >
>> > ..and then attempt to get the endpoint and call createConsumer(...).
>> > I'm sure this is not the right way to do it, but I don't see how else
>> > - any ideas?
>> >
>> > Thanks,
>> >
>> >
>> > Chris
>> >
>> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]<http://user/SendEmail.jtp?type=node&node=5730134&i=1>>
>> wrote:
>> >> Hi
>> >>
>> >> See this FAQ
>> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>> >>
>> >>
>> >>
>> >>
>> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]<http://user/SendEmail.jtp?type=node&node=5730134&i=2>
>> >> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730134&i=3>>wrote:
>>
>> >>
>> >>> Thanks Walzer..
>> >>> *
>> >>> *
>> >>> *Queston1:
>> >>>
>> >>> *
>> >>> *Example*
>> >>>
>> >>> .when(header("foo").isEqualTo("bar"))
>> >>>                     .to("direct:b")
>> >>>
>> >>> In my case i have to add more than 80 condition and forwards to 80
>> >>> different queues.
>> >>>
>> >>> Above example i can only hard-code queue name,But what i want is
>> below.
>> >>>
>> >>> * .when(header("Type").isNotNull())
>> >>>     .to("activemq.Inbound."+header("Type"))
>> >>> *
>> >>>
>> >>> Example:If queue type is test,It should forward to *Inbound.test*
>> queue.
>> >>>
>> >>> Above example i tried,but it did not worked,created queue something
>> >>> like this *Inbound.header("type")*
>> >>>
>> >>> *Question2*:
>> >>>
>> >>> from("direct:a")
>> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
>> >>>
>> >>> Based on messages header and content type i want forward to different
>> >>> queue.
>> >>>
>> >>> condition will be *OR *and *AND*.How can i do that like above
>> example.*
>> >>> *
>> >>>
>> >>> Thanks in advance*
>> >>> *
>> >>>
>> >>> *Regards*
>> >>>
>> >>> Prabu.N
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
>> >>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5730134&i=4>>
>> wrote:
>> >>>
>> >>> > Hi,
>> >>> >
>> >>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
>> >>> > example or http://camel.apache.org/content-based-router.html (just
>> >>> > replace the direct: with your queues).
>> >>> > If you need to fire your messages to multiple queues:
>> >>> > http://camel.apache.org/publish-subscribe-channel.html shows you
>> the
>> >>> > various ways.
>> >>> > When you get the concepts you can just "lego" them together.
>> >>> >
>> >>> > Regards, Thomas.
>> >>> >
>> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
>> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
>> >>> > <[hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
>> >>> >
>> >>> > > Hi Claus,
>> >>> > >
>> >>> > > Thanks so much Clus for help.It is working now.
>> >>> > >
>> >>> > > I need your guidance for the following requirement.
>> >>> > >
>> >>> > > 1.I have one *inbound queue* it will receive message frequently
>> from my
>> >>> > > application.
>> >>> > > 2.From *inbound queue* i need camel routing to move message from
>> >>> > > another *message
>> >>> > > based inbound queue* based on message header value.
>> >>> > > 3.From *message based inbound queue *i* *need camel routing to
>> move
>> >>> > message
>> >>> > > to *one or more outbound queue *based on message content*
>> >>> > > *
>> >>> > >
>> >>> > > I need *camel java DSL*sample code for above requirement.*
>> >>> > > *
>> >>> > > *
>> >>> > > *
>> >>> > > *Thanks in advance*
>> >>> > >
>> >>> > >
>> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
>> >>> > > [hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
>> >>> > wrote:
>> >>> > >
>> >>> > >> Hi
>> >>> > >>
>> >>> > >> Do as the exception tells you. Check route 2. You route from
>> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
>> >>> > >>
>> >>> > >> Maybe you need to add "activemq:" as prefix so its
>> >>> > >> "activemq:Inbound.SSS.TestEvent".
>> >>> > >>
>> >>> > >>
>> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
>> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>> >>> > >> <[hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730109&i=1
>> >>> >>
>> >>> >
>> >>> > >> wrote:
>> >>> > >>
>> >>> > >>>
>> >>> > >>> I have activemmq  Project in that i have following requirement
>> >>> > >>>
>> >>> > >>> 1.Move message from Inbound queue to type based inbound queue.
>> >>> > >>> 2.Move message from Message type inbound queue to outbound queue
>> >>> > >>>
>> >>> > >>> I have created two bean for to achieve this.
>> >>> > >>>
>> >>> > >>> 1.one for move from inbound to message type  inbound queue
>> >>> > >>> 2.one for move from inbound to outbound queue.
>> >>> > >>>
>> >>> > >>> I have following entry in camel.xml
>> >>> > >>>
>> >>> > >>>   <camelContext id="camel" xmlns="
>> >>> > http://camel.apache.org/schema/spring">
>> >>> > >>
>> >>> > >>>
>> >>> > >>>                <routeBuilder ref="routeBuilder" />
>> >>> > >>>            <routeBuilder ref="routeBuilder1" />
>> >>> > >>>
>> >>> > >>>    </camelContext>
>> >>> > >>>
>> >>> > >>>    <bean id="routeBuilder"
>> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
>> >>> > >>>    <bean id="recipientsGenerator"
>> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
>> >>> > >>>    <bean id="routeBuilder1"
>> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
>> >>> > >>>    <bean id="recipientsGenerator1"
>> >>> > >>> class="com.camel.routes.RecipientListBean"/>
>> >>> > >>>
>> >>> > >>> When i run application i am getting following error.
>> >>> > >>>
>> >>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
>> >>> > >>> org.apache.camel.Fa
>> >>> > >>> iledToCreateRouteException: Failed to create route route2:
>> >>> > >>> Route[[From[Inbound.G
>> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No
>> endpoint
>> >>> > could
>> >>> > >> be
>> >>> > >>> found
>> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains
>> the
>> >>> > >> needed
>> >>> > >>> Cam
>> >>> > >>> el component jar.*
>> >>> > >>>
>> >>> > >>> I am not sure i am missing any configuration,Please kindly help
>> me
>> >>> > >>>
>> >>> > >>>
>> >>> > >>>
>> >>> > >>>
>> >>> > >>> --
>> >>> > >>> View this message in context:
>> >>> > >>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>> >>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>> > >>
>> >>> > >>
>> >>> > >>
>> >>> > >> --
>> >>> > >> Claus Ibsen
>> >>> > >> -----------------
>> >>> > >> Red Hat, Inc.
>> >>> > >> FuseSource is now part of Red Hat
>> >>> > >> Email: [hidden email]<
>> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>> >>> > >> Web: http://fusesource.com
>> >>> > >> Twitter: davsclaus
>> >>> > >> Blog: http://davsclaus.com
>> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>> >>> > >>
>> >>> > >>
>> >>> > >> ------------------------------
>> >>> > >> If you reply to this email, your message will be added to the
>> >>> > discussion
>> >>> > >> below:
>> >>> > >>
>> >>> > >>
>> >>> >
>> >>> > >> .
>> >>> > >> NAML<
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >>> >
>> >>> >
>> >>> > >>
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > --
>> >>> > > Thanks & Regards
>> >>> > > Prabu.N
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > --
>> >>> > > View this message in context:
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
>> >>> >
>> >>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>> >
>> >>> >
>> >>> >
>> >>> > ------------------------------
>> >>> >  If you reply to this email, your message will be added to the
>> discussion
>> >>> > below:
>> >>> >
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
>> >>> >  To unsubscribe from Camel routing issue, click here<
>> >>> >
>> >>> > .
>> >>> > NAML<
>> >>>
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >>> >
>> >>> >
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Thanks & Regards
>> >>>  Prabu.N
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
>> >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -----------------
>> >> Red Hat, Inc.
>> >> FuseSource is now part of Red Hat
>> >> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5730134&i=5>
>> >> Web: http://fusesource.com
>> >> Twitter: davsclaus
>> >> Blog: http://davsclaus.com
>> >> Author of Camel in Action: http://www.manning.com/ibsen
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730134.html
>>  To unsubscribe from Camel routing issue, click here<
>> .
>> NAML<
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730135.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Claus Ibsen-2
In reply to this post by Chris Wolf
Hi

See this EIP
http://camel.apache.org/content-enricher.html

About pollEnrich.

Though pollEnrich currently does support dynamic uris. Its on the roadmap,
for Camel 3.0.
It requires an API change and thus isn't so easy to implement currently on
2.x.

You can always use a java bean / camel processor, and consume the ftp file
from java code.
For example using consumer template.

As you use FTP you may want to set disconnect=true so the connect is not
remained open after usage.



On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]> wrote:

> Ok, I'm starting to get it - a little bit.  As for my concrete
> example, so far, I have:
>
>                 from("direct:start")
>                 .beanRef("config")
>                 .convertBodyTo(Document.class)
>                 .recipientList().xquery(
>                     "concat('ftp://'" +
>                     ",//remote[vendorId/@value='CBOE34']/server/@value" +
>
>
> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
> +
>                     ",'?noop=true&amp;username='" +
>                     ",//remote[vendorId/@value='CBOE34']/username/@value" +
>                     ",'&amp;password='" +
>
> ",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);
>
> Here's the problem - this will create an FTP Producer - that's not
> what I need.  I need a dynamically
> constructed URI for a polling FTP consumer.  I don't think
> "recipientList" will work...   Any ideas?
>
> Thanks,
>
> Chris
>
> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]> wrote:
> > Hi Claus,
> >
> > I hate to ask this - but I still don't get it.  I thought
> > "recipientList" was for sending to multiple, runtime-defined
> > recipients.  I don't see how this
> > answers the question of sending to one, single recipient, whose URI is
> > dynamically constructed - and in my use-case the dynamic settings
> > are not in properties - so "simple" (property place-holders) won't help
> me.
> >
> > Let me give you a concrete example.  I need to do an ftp download and
> > the connection information comes from up-stream in the route in the
> > form of XML (DOM - a Document instance).  Currently, I am trying to do
> > this with bean binding and method params decorated with @XPath
> > pointing into the Document with the ftp settings and inside the
> > this method doing:
> >
> > FtpComponent ftpComponent = context.getComponent("ftp",
> FtpComponent.class);
> >
> > ..and then attempt to get the endpoint and call createConsumer(...).
> > I'm sure this is not the right way to do it, but I don't see how else
> > - any ideas?
> >
> > Thanks,
> >
> >
> > Chris
> >
> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]>
> wrote:
> >> Hi
> >>
> >> See this FAQ
> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> >>
> >>
> >>
> >>
> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
> >> <[hidden email]>wrote:
> >>
> >>> Thanks Walzer..
> >>> *
> >>> *
> >>> *Queston1:
> >>>
> >>> *
> >>> *Example*
> >>>
> >>> .when(header("foo").isEqualTo("bar"))
> >>>                     .to("direct:b")
> >>>
> >>> In my case i have to add more than 80 condition and forwards to 80
> >>> different queues.
> >>>
> >>> Above example i can only hard-code queue name,But what i want is below.
> >>>
> >>> * .when(header("Type").isNotNull())
> >>>     .to("activemq.Inbound."+header("Type"))
> >>> *
> >>>
> >>> Example:If queue type is test,It should forward to *Inbound.test*
> queue.
> >>>
> >>> Above example i tried,but it did not worked,created queue something
> >>> like this *Inbound.header("type")*
> >>>
> >>> *Question2*:
> >>>
> >>> from("direct:a")
> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
> >>>
> >>> Based on messages header and content type i want forward to different
> >>> queue.
> >>>
> >>> condition will be *OR *and *AND*.How can i do that like above example.*
> >>> *
> >>>
> >>> Thanks in advance*
> >>> *
> >>>
> >>> *Regards*
> >>>
> >>> Prabu.N
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
> >>> [hidden email]> wrote:
> >>>
> >>> > Hi,
> >>> >
> >>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
> >>> > example or http://camel.apache.org/content-based-router.html (just
> >>> > replace the direct: with your queues).
> >>> > If you need to fire your messages to multiple queues:
> >>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
> >>> > various ways.
> >>> > When you get the concepts you can just "lego" them together.
> >>> >
> >>> > Regards, Thomas.
> >>> >
> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
> >>> > <[hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
> >>> >
> >>> > > Hi Claus,
> >>> > >
> >>> > > Thanks so much Clus for help.It is working now.
> >>> > >
> >>> > > I need your guidance for the following requirement.
> >>> > >
> >>> > > 1.I have one *inbound queue* it will receive message frequently
> from my
> >>> > > application.
> >>> > > 2.From *inbound queue* i need camel routing to move message from
> >>> > > another *message
> >>> > > based inbound queue* based on message header value.
> >>> > > 3.From *message based inbound queue *i* *need camel routing to move
> >>> > message
> >>> > > to *one or more outbound queue *based on message content*
> >>> > > *
> >>> > >
> >>> > > I need *camel java DSL*sample code for above requirement.*
> >>> > > *
> >>> > > *
> >>> > > *
> >>> > > *Thanks in advance*
> >>> > >
> >>> > >
> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
> >>> > > [hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
> >>> > wrote:
> >>> > >
> >>> > >> Hi
> >>> > >>
> >>> > >> Do as the exception tells you. Check route 2. You route from
> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
> >>> > >>
> >>> > >> Maybe you need to add "activemq:" as prefix so its
> >>> > >> "activemq:Inbound.SSS.TestEvent".
> >>> > >>
> >>> > >>
> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
> >>> > >> <[hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730109&i=1
> >>> >>
> >>> >
> >>> > >> wrote:
> >>> > >>
> >>> > >>>
> >>> > >>> I have activemmq  Project in that i have following requirement
> >>> > >>>
> >>> > >>> 1.Move message from Inbound queue to type based inbound queue.
> >>> > >>> 2.Move message from Message type inbound queue to outbound queue
> >>> > >>>
> >>> > >>> I have created two bean for to achieve this.
> >>> > >>>
> >>> > >>> 1.one for move from inbound to message type  inbound queue
> >>> > >>> 2.one for move from inbound to outbound queue.
> >>> > >>>
> >>> > >>> I have following entry in camel.xml
> >>> > >>>
> >>> > >>>   <camelContext id="camel" xmlns="
> >>> > http://camel.apache.org/schema/spring">
> >>> > >>
> >>> > >>>
> >>> > >>>                <routeBuilder ref="routeBuilder" />
> >>> > >>>            <routeBuilder ref="routeBuilder1" />
> >>> > >>>
> >>> > >>>    </camelContext>
> >>> > >>>
> >>> > >>>    <bean id="routeBuilder"
> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
> >>> > >>>    <bean id="recipientsGenerator"
> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
> >>> > >>>    <bean id="routeBuilder1"
> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
> >>> > >>>    <bean id="recipientsGenerator1"
> >>> > >>> class="com.camel.routes.RecipientListBean"/>
> >>> > >>>
> >>> > >>> When i run application i am getting following error.
> >>> > >>>
> >>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
> >>> > >>> org.apache.camel.Fa
> >>> > >>> iledToCreateRouteException: Failed to create route route2:
> >>> > >>> Route[[From[Inbound.G
> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
> >>> > could
> >>> > >> be
> >>> > >>> found
> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains
> the
> >>> > >> needed
> >>> > >>> Cam
> >>> > >>> el component jar.*
> >>> > >>>
> >>> > >>> I am not sure i am missing any configuration,Please kindly help
> me
> >>> > >>>
> >>> > >>>
> >>> > >>>
> >>> > >>>
> >>> > >>> --
> >>> > >>> View this message in context:
> >>> > >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> >>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>> > >>
> >>> > >>
> >>> > >>
> >>> > >> --
> >>> > >> Claus Ibsen
> >>> > >> -----------------
> >>> > >> Red Hat, Inc.
> >>> > >> FuseSource is now part of Red Hat
> >>> > >> Email: [hidden email]<
> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
> >>> > >> Web: http://fusesource.com
> >>> > >> Twitter: davsclaus
> >>> > >> Blog: http://davsclaus.com
> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
> >>> > >>
> >>> > >>
> >>> > >> ------------------------------
> >>> > >> If you reply to this email, your message will be added to the
> >>> > discussion
> >>> > >> below:
> >>> > >>
> >>> > >>
> >>> >
> >>> > >> .
> >>> > >> NAML<
> >>> >
> >>>
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >>> >
> >>> >
> >>> > >>
> >>> > >
> >>> > >
> >>> > >
> >>> > > --
> >>> > > Thanks & Regards
> >>> > > Prabu.N
> >>> > >
> >>> > >
> >>> > >
> >>> > >
> >>> > > --
> >>> > > View this message in context:
> >>> >
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
> >>> >
> >>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >>> >
> >>> >
> >>> >
> >>> > ------------------------------
> >>> >  If you reply to this email, your message will be added to the
> discussion
> >>> > below:
> >>> >
> >>> >
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
> >>> >  To unsubscribe from Camel routing issue, click here<
> >>>
> >>> >
> >>> > .
> >>> > NAML<
> >>>
>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >>> >
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Thanks & Regards
> >>>  Prabu.N
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
> >>> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>>
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> Red Hat, Inc.
> >> FuseSource is now part of Red Hat
> >> Email: [hidden email]
> >> Web: http://fusesource.com
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
>



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

prabumca06@gmail.com
Like Chris suggest i tried below way


 .when(header("TYPE").isNotNull())
               .to("activemq:queue.Inbound.${header.Type}")  


But queue created ${header.Type} like this not Inbound.test

Please kindly give me example.

Regards
Prabu.N



On Mon, Apr 1, 2013 at 2:03 PM, Claus Ibsen-2 [via Camel] <[hidden email]> wrote:
Hi

See this EIP
http://camel.apache.org/content-enricher.html

About pollEnrich.

Though pollEnrich currently does support dynamic uris. Its on the roadmap,
for Camel 3.0.
It requires an API change and thus isn't so easy to implement currently on
2.x.

You can always use a java bean / camel processor, and consume the ftp file
from java code.
For example using consumer template.

As you use FTP you may want to set disconnect=true so the connect is not
remained open after usage.



On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]> wrote:

> Ok, I'm starting to get it - a little bit.  As for my concrete
> example, so far, I have:
>
>                 from("direct:start")
>                 .beanRef("config")
>                 .convertBodyTo(Document.class)
>                 .recipientList().xquery(
>                     "concat('ftp://'" +
>                     ",//remote[vendorId/@value='CBOE34']/server/@value" +
>
>
> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
> +
>                     ",'?noop=true&amp;username='" +
>                     ",//remote[vendorId/@value='CBOE34']/username/@value" +
>                     ",'&amp;password='" +
>
> ",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);
>
> Here's the problem - this will create an FTP Producer - that's not
> what I need.  I need a dynamically
> constructed URI for a polling FTP consumer.  I don't think
> "recipientList" will work...   Any ideas?
>
> Thanks,
>
> Chris
>
> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]> wrote:
> > Hi Claus,
> >
> > I hate to ask this - but I still don't get it.  I thought
> > "recipientList" was for sending to multiple, runtime-defined
> > recipients.  I don't see how this
> > answers the question of sending to one, single recipient, whose URI is
> > dynamically constructed - and in my use-case the dynamic settings
> > are not in properties - so "simple" (property place-holders) won't help
> me.
> >
> > Let me give you a concrete example.  I need to do an ftp download and
> > the connection information comes from up-stream in the route in the
> > form of XML (DOM - a Document instance).  Currently, I am trying to do
> > this with bean binding and method params decorated with @XPath
> > pointing into the Document with the ftp settings and inside the
> > this method doing:
> >
> > FtpComponent ftpComponent = context.getComponent("ftp",
> FtpComponent.class);
> >
> > ..and then attempt to get the endpoint and call createConsumer(...).
> > I'm sure this is not the right way to do it, but I don't see how else
> > - any ideas?
> >
> > Thanks,
> >
> >
> > Chris
> >
> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]>
> wrote:
> >> Hi
> >>
> >> See this FAQ
> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> >>
> >>
> >>
> >>
> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
> >> <[hidden email]>wrote:
> >>
> >>> Thanks Walzer..
> >>> *
> >>> *
> >>> *Queston1:
> >>>
> >>> *
> >>> *Example*
> >>>
> >>> .when(header("foo").isEqualTo("bar"))
> >>>                     .to("direct:b")
> >>>
> >>> In my case i have to add more than 80 condition and forwards to 80
> >>> different queues.
> >>>
> >>> Above example i can only hard-code queue name,But what i want is below.
> >>>
> >>> * .when(header("Type").isNotNull())
> >>>     .to("activemq.Inbound."+header("Type"))
> >>> *
> >>>
> >>> Example:If queue type is test,It should forward to *Inbound.test*
> queue.
> >>>
> >>> Above example i tried,but it did not worked,created queue something
> >>> like this *Inbound.header("type")*
> >>>
> >>> *Question2*:
> >>>
> >>> from("direct:a")
> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
> >>>
> >>> Based on messages header and content type i want forward to different
> >>> queue.
> >>>
> >>> condition will be *OR *and *AND*.How can i do that like above example.*
> >>> *
> >>>
> >>> Thanks in advance*
> >>> *
> >>>
> >>> *Regards*
> >>>
> >>> Prabu.N
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
> >>> [hidden email]> wrote:
> >>>
> >>> > Hi,
> >>> >
> >>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
> >>> > example or http://camel.apache.org/content-based-router.html (just
> >>> > replace the direct: with your queues).
> >>> > If you need to fire your messages to multiple queues:
> >>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
> >>> > various ways.
> >>> > When you get the concepts you can just "lego" them together.
> >>> >
> >>> > Regards, Thomas.
> >>> >
> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
> >>> > <[hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
> >>> >
> >>> > > Hi Claus,
> >>> > >
> >>> > > Thanks so much Clus for help.It is working now.
> >>> > >
> >>> > > I need your guidance for the following requirement.
> >>> > >
> >>> > > 1.I have one *inbound queue* it will receive message frequently
> from my
> >>> > > application.
> >>> > > 2.From *inbound queue* i need camel routing to move message from
> >>> > > another *message
> >>> > > based inbound queue* based on message header value.
> >>> > > 3.From *message based inbound queue *i* *need camel routing to move
> >>> > message
> >>> > > to *one or more outbound queue *based on message content*
> >>> > > *
> >>> > >
> >>> > > I need *camel java DSL*sample code for above requirement.*
> >>> > > *
> >>> > > *
> >>> > > *
> >>> > > *Thanks in advance*
> >>> > >
> >>> > >
> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
> >>> > > [hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
> >>> > wrote:
> >>> > >
> >>> > >> Hi
> >>> > >>
> >>> > >> Do as the exception tells you. Check route 2. You route from
> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
> >>> > >>
> >>> > >> Maybe you need to add "activemq:" as prefix so its
> >>> > >> "activemq:Inbound.SSS.TestEvent".
> >>> > >>
> >>> > >>
> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
> >>> > >> <[hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730109&i=1
> >>> >>
> >>> >
> >>> > >> wrote:
> >>> > >>
> >>> > >>>
> >>> > >>> I have activemmq  Project in that i have following requirement
> >>> > >>>
> >>> > >>> 1.Move message from Inbound queue to type based inbound queue.
> >>> > >>> 2.Move message from Message type inbound queue to outbound queue
> >>> > >>>
> >>> > >>> I have created two bean for to achieve this.
> >>> > >>>
> >>> > >>> 1.one for move from inbound to message type  inbound queue
> >>> > >>> 2.one for move from inbound to outbound queue.
> >>> > >>>
> >>> > >>> I have following entry in camel.xml
> >>> > >>>
> >>> > >>>   <camelContext id="camel" xmlns="
> >>> > http://camel.apache.org/schema/spring">
> >>> > >>
> >>> > >>>
> >>> > >>>                <routeBuilder ref="routeBuilder" />
> >>> > >>>            <routeBuilder ref="routeBuilder1" />
> >>> > >>>
> >>> > >>>    </camelContext>
> >>> > >>>
> >>> > >>>    <bean id="routeBuilder"
> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
> >>> > >>>    <bean id="recipientsGenerator"
> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
> >>> > >>>    <bean id="routeBuilder1"
> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
> >>> > >>>    <bean id="recipientsGenerator1"
> >>> > >>> class="com.camel.routes.RecipientListBean"/>
> >>> > >>>
> >>> > >>> When i run application i am getting following error.
> >>> > >>>
> >>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
> >>> > >>> org.apache.camel.Fa
> >>> > >>> iledToCreateRouteException: Failed to create route route2:
> >>> > >>> Route[[From[Inbound.G
> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
> >>> > could
> >>> > >> be
> >>> > >>> found
> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains
> the
> >>> > >> needed
> >>> > >>> Cam
> >>> > >>> el component jar.*
> >>> > >>>
> >>> > >>> I am not sure i am missing any configuration,Please kindly help
> me
> >>> > >>>
> >>> > >>>
> >>> > >>>
> >>> > >>>
> >>> > >>> --
> >>> > >>> View this message in context:
> >>> > >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> >>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>> > >>
> >>> > >>
> >>> > >>
> >>> > >> --
> >>> > >> Claus Ibsen
> >>> > >> -----------------
> >>> > >> Red Hat, Inc.
> >>> > >> FuseSource is now part of Red Hat
> >>> > >> Email: [hidden email]<
> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
> >>> > >> Web: http://fusesource.com
> >>> > >> Twitter: davsclaus
> >>> > >> Blog: http://davsclaus.com
> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
> >>> > >> > >>> >

> >>> >
> >>> > >>
> >>> > >
> >>> > >
> >>> > >
> >>> > > --
> >>> > > Thanks & Regards
> >>> > > Prabu.N
> >>> > >
> >>> > >
> >>> > >
> >>> > >
> >>> > > --
> >>> > > View this message in context:
> >>> >
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
> >>> >

> >>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >>> >
> >>> >
> >>> >
> >>> > ------------------------------
> >>> >  If you reply to this email, your message will be added to the
> discussion
> >>> > below:
> >>> >
> >>> >
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
> >>> >  To unsubscribe from Camel routing issue, click here<
> >>>
> >>> >
> >>> > .
> >>> > NAML<
> >>>
>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >>> >

> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Thanks & Regards
> >>>  Prabu.N
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
> >>> Sent from the Camel - Users mailing list archive at Nabble.com.

> >>>
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> Red Hat, Inc.
> >> FuseSource is now part of Red Hat
> >> Email: [hidden email]
> >> Web: http://fusesource.com
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
>



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen



If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730152.html
To unsubscribe from Camel routing issue, click here.
NAML



--
Thanks & Regards
 Prabu.N
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

prabumca06@gmail.com
In reply to this post by Claus Ibsen-2
Chris,The following code worked fine.

.choice().when(header("Type").isNotNull())
         .recipientList(simple("activemq.Inbound.${header.Type}"))
.endChoice()

but,one issue is that.I added .otherwise() , it giving error.

.choice().when(header("Type").isNotNull())
     .recipientList(simple("activemq.Inbound.${header.Type}"))
.otherwise()                   
    .to("activemq:queue:Invalid.queue")

.endChoice();

please kindly help me.



On Mon, Apr 1, 2013 at 2:32 PM, Prabu <[hidden email]> wrote:
Like Chris suggest i tried below way


 .when(header("TYPE").isNotNull())
               .to("activemq:queue.Inbound.${header.Type}")  


But queue created ${header.Type} like this not Inbound.test

Please kindly give me example.

Regards
Prabu.N



On Mon, Apr 1, 2013 at 2:03 PM, Claus Ibsen-2 [via Camel] <[hidden email]> wrote:
Hi

See this EIP
http://camel.apache.org/content-enricher.html

About pollEnrich.

Though pollEnrich currently does support dynamic uris. Its on the roadmap,
for Camel 3.0.
It requires an API change and thus isn't so easy to implement currently on
2.x.

You can always use a java bean / camel processor, and consume the ftp file
from java code.
For example using consumer template.

As you use FTP you may want to set disconnect=true so the connect is not
remained open after usage.



On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]> wrote:

> Ok, I'm starting to get it - a little bit.  As for my concrete
> example, so far, I have:
>
>                 from("direct:start")
>                 .beanRef("config")
>                 .convertBodyTo(Document.class)
>                 .recipientList().xquery(
>                     "concat('ftp://'" +
>                     ",//remote[vendorId/@value='CBOE34']/server/@value" +
>
>
> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
> +
>                     ",'?noop=true&amp;username='" +
>                     ",//remote[vendorId/@value='CBOE34']/username/@value" +
>                     ",'&amp;password='" +
>
> ",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);
>
> Here's the problem - this will create an FTP Producer - that's not
> what I need.  I need a dynamically
> constructed URI for a polling FTP consumer.  I don't think
> "recipientList" will work...   Any ideas?
>
> Thanks,
>
> Chris
>
> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]> wrote:
> > Hi Claus,
> >
> > I hate to ask this - but I still don't get it.  I thought
> > "recipientList" was for sending to multiple, runtime-defined
> > recipients.  I don't see how this
> > answers the question of sending to one, single recipient, whose URI is
> > dynamically constructed - and in my use-case the dynamic settings
> > are not in properties - so "simple" (property place-holders) won't help
> me.
> >
> > Let me give you a concrete example.  I need to do an ftp download and
> > the connection information comes from up-stream in the route in the
> > form of XML (DOM - a Document instance).  Currently, I am trying to do
> > this with bean binding and method params decorated with @XPath
> > pointing into the Document with the ftp settings and inside the
> > this method doing:
> >
> > FtpComponent ftpComponent = context.getComponent("ftp",
> FtpComponent.class);
> >
> > ..and then attempt to get the endpoint and call createConsumer(...).
> > I'm sure this is not the right way to do it, but I don't see how else
> > - any ideas?
> >
> > Thanks,
> >
> >
> > Chris
> >
> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]>
> wrote:
> >> Hi
> >>
> >> See this FAQ
> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> >>
> >>
> >>
> >>
> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
> >> <[hidden email]>wrote:
> >>
> >>> Thanks Walzer..
> >>> *
> >>> *
> >>> *Queston1:
> >>>
> >>> *
> >>> *Example*
> >>>
> >>> .when(header("foo").isEqualTo("bar"))
> >>>                     .to("direct:b")
> >>>
> >>> In my case i have to add more than 80 condition and forwards to 80
> >>> different queues.
> >>>
> >>> Above example i can only hard-code queue name,But what i want is below.
> >>>
> >>> * .when(header("Type").isNotNull())
> >>>     .to("activemq.Inbound."+header("Type"))
> >>> *
> >>>
> >>> Example:If queue type is test,It should forward to *Inbound.test*
> queue.
> >>>
> >>> Above example i tried,but it did not worked,created queue something
> >>> like this *Inbound.header("type")*
> >>>
> >>> *Question2*:
> >>>
> >>> from("direct:a")
> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
> >>>
> >>> Based on messages header and content type i want forward to different
> >>> queue.
> >>>
> >>> condition will be *OR *and *AND*.How can i do that like above example.*
> >>> *
> >>>
> >>> Thanks in advance*
> >>> *
> >>>
> >>> *Regards*
> >>>
> >>> Prabu.N
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
> >>> [hidden email]> wrote:
> >>>
> >>> > Hi,
> >>> >
> >>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
> >>> > example or http://camel.apache.org/content-based-router.html (just
> >>> > replace the direct: with your queues).
> >>> > If you need to fire your messages to multiple queues:
> >>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
> >>> > various ways.
> >>> > When you get the concepts you can just "lego" them together.
> >>> >
> >>> > Regards, Thomas.
> >>> >
> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
> >>> > <[hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
> >>> >
> >>> > > Hi Claus,
> >>> > >
> >>> > > Thanks so much Clus for help.It is working now.
> >>> > >
> >>> > > I need your guidance for the following requirement.
> >>> > >
> >>> > > 1.I have one *inbound queue* it will receive message frequently
> from my
> >>> > > application.
> >>> > > 2.From *inbound queue* i need camel routing to move message from
> >>> > > another *message
> >>> > > based inbound queue* based on message header value.
> >>> > > 3.From *message based inbound queue *i* *need camel routing to move
> >>> > message
> >>> > > to *one or more outbound queue *based on message content*
> >>> > > *
> >>> > >
> >>> > > I need *camel java DSL*sample code for above requirement.*
> >>> > > *
> >>> > > *
> >>> > > *
> >>> > > *Thanks in advance*
> >>> > >
> >>> > >
> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
> >>> > > [hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
> >>> > wrote:
> >>> > >
> >>> > >> Hi
> >>> > >>
> >>> > >> Do as the exception tells you. Check route 2. You route from
> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
> >>> > >>
> >>> > >> Maybe you need to add "activemq:" as prefix so its
> >>> > >> "activemq:Inbound.SSS.TestEvent".
> >>> > >>
> >>> > >>
> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
> >>> > >> <[hidden email] <
> http://user/SendEmail.jtp?type=node&node=5730109&i=1
> >>> >>
> >>> >
> >>> > >> wrote:
> >>> > >>
> >>> > >>>
> >>> > >>> I have activemmq  Project in that i have following requirement
> >>> > >>>
> >>> > >>> 1.Move message from Inbound queue to type based inbound queue.
> >>> > >>> 2.Move message from Message type inbound queue to outbound queue
> >>> > >>>
> >>> > >>> I have created two bean for to achieve this.
> >>> > >>>
> >>> > >>> 1.one for move from inbound to message type  inbound queue
> >>> > >>> 2.one for move from inbound to outbound queue.
> >>> > >>>
> >>> > >>> I have following entry in camel.xml
> >>> > >>>
> >>> > >>>   <camelContext id="camel" xmlns="
> >>> > http://camel.apache.org/schema/spring">
> >>> > >>
> >>> > >>>
> >>> > >>>                <routeBuilder ref="routeBuilder" />
> >>> > >>>            <routeBuilder ref="routeBuilder1" />
> >>> > >>>
> >>> > >>>    </camelContext>
> >>> > >>>
> >>> > >>>    <bean id="routeBuilder"
> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
> >>> > >>>    <bean id="recipientsGenerator"
> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
> >>> > >>>    <bean id="routeBuilder1"
> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
> >>> > >>>    <bean id="recipientsGenerator1"
> >>> > >>> class="com.camel.routes.RecipientListBean"/>
> >>> > >>>
> >>> > >>> When i run application i am getting following error.
> >>> > >>>
> >>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
> >>> > >>> org.apache.camel.Fa
> >>> > >>> iledToCreateRouteException: Failed to create route route2:
> >>> > >>> Route[[From[Inbound.G
> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
> >>> > could
> >>> > >> be
> >>> > >>> found
> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains
> the
> >>> > >> needed
> >>> > >>> Cam
> >>> > >>> el component jar.*
> >>> > >>>
> >>> > >>> I am not sure i am missing any configuration,Please kindly help
> me
> >>> > >>>
> >>> > >>>
> >>> > >>>
> >>> > >>>
> >>> > >>> --
> >>> > >>> View this message in context:
> >>> > >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> >>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>> > >>
> >>> > >>
> >>> > >>
> >>> > >> --
> >>> > >> Claus Ibsen
> >>> > >> -----------------
> >>> > >> Red Hat, Inc.
> >>> > >> FuseSource is now part of Red Hat
> >>> > >> Email: [hidden email]<
> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
> >>> > >> Web: http://fusesource.com
> >>> > >> Twitter: davsclaus
> >>> > >> Blog: http://davsclaus.com
> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
> >>> > >> > >>> >

> >>> >
> >>> > >>
> >>> > >
> >>> > >
> >>> > >
> >>> > > --
> >>> > > Thanks & Regards
> >>> > > Prabu.N
> >>> > >
> >>> > >
> >>> > >
> >>> > >
> >>> > > --
> >>> > > View this message in context:
> >>> >
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
> >>> >

> >>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >>> >
> >>> >
> >>> >
> >>> > ------------------------------
> >>> >  If you reply to this email, your message will be added to the
> discussion
> >>> > below:
> >>> >
> >>> >
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
> >>> >  To unsubscribe from Camel routing issue, click here<
> >>>
> >>> >
> >>> > .
> >>> > NAML<
> >>>
>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >>> >

> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Thanks & Regards
> >>>  Prabu.N
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
> >>> Sent from the Camel - Users mailing list archive at Nabble.com.

> >>>
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> Red Hat, Inc.
> >> FuseSource is now part of Red Hat
> >> Email: [hidden email]
> >> Web: http://fusesource.com
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
>



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen



If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730152.html
To unsubscribe from Camel routing issue, click here.
NAML



--
Thanks & Regards
 Prabu.N



--
Thanks & Regards
 Prabu.N
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Chris Wolf
Prabu,

There's a note on the Camel website about a potential compiler error
when using "otherwise()", along with a workaround. Unfortunately, I
can't find it now.

On the other hand, I think this might work:

                from("direct:start")
                .choice().when(header("Type").isNotNull())
                    .recipientList(simple("activemq.Inbound.${header.Type}"))
                .end() // <=== added this to close "when" block
                .otherwise()
                    .to("activemq:queue:Invalid.queue")
                .endChoice();

N.B. this only solved compilation - I didn't actually do a runtime test.

    -Chris

On Mon, Apr 1, 2013 at 7:18 AM, [hidden email]
<[hidden email]> wrote:

> Chris,The following code worked fine.
>
> .choice().when(header("Type").isNotNull())
>          .recipientList(simple("activemq.Inbound.${header.Type}"))
> .endChoice()
>
> but,one issue is that.I added *.otherwise()* , it giving error.
>
> .choice().when(header("Type").isNotNull())
>      .recipientList(simple("activemq.Inbound.${header.Type}"))
> *.otherwise()
>     .to("activemq:queue:Invalid.queue")*
> .endChoice();
>
> please kindly help me.
>
>
>
> On Mon, Apr 1, 2013 at 2:32 PM, Prabu <[hidden email]> wrote:
>
>> Like Chris suggest i tried below way
>>
>>
>>  .when(header("TYPE").isNotNull())
>>                .to("activemq:queue.Inbound.${header.Type}")
>>
>>
>> But queue created *${header.Type}* like this not *Inbound.test*
>>
>> Please kindly give me example.
>>
>> *Regards*
>> Prabu.N
>>
>>
>>
>> On Mon, Apr 1, 2013 at 2:03 PM, Claus Ibsen-2 [via Camel] <
>> [hidden email]> wrote:
>>
>>> Hi
>>>
>>> See this EIP
>>> http://camel.apache.org/content-enricher.html
>>>
>>> About pollEnrich.
>>>
>>> Though pollEnrich currently does support dynamic uris. Its on the
>>> roadmap,
>>> for Camel 3.0.
>>> It requires an API change and thus isn't so easy to implement currently
>>> on
>>> 2.x.
>>>
>>> You can always use a java bean / camel processor, and consume the ftp
>>> file
>>> from java code.
>>> For example using consumer template.
>>>
>>> As you use FTP you may want to set disconnect=true so the connect is not
>>> remained open after usage.
>>>
>>>
>>>
>>> On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]<http://user/SendEmail.jtp?type=node&node=5730152&i=0>>
>>> wrote:
>>>
>>> > Ok, I'm starting to get it - a little bit.  As for my concrete
>>> > example, so far, I have:
>>> >
>>> >                 from("direct:start")
>>> >                 .beanRef("config")
>>> >                 .convertBodyTo(Document.class)
>>> >                 .recipientList().xquery(
>>> >                     "concat('ftp://'" +
>>> >                     ",//remote[vendorId/@value='CBOE34']/server/@value"
>>> +
>>> >
>>> >
>>> >
>>> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
>>>
>>> > +
>>> >                     ",'?noop=true&amp;username='" +
>>> >
>>> ",//remote[vendorId/@value='CBOE34']/username/@value" +
>>> >                     ",'&amp;password='" +
>>> >
>>> > ",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);
>>> >
>>> > Here's the problem - this will create an FTP Producer - that's not
>>> > what I need.  I need a dynamically
>>> > constructed URI for a polling FTP consumer.  I don't think
>>> > "recipientList" will work...   Any ideas?
>>> >
>>> > Thanks,
>>> >
>>> > Chris
>>> >
>>> > On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]<http://user/SendEmail.jtp?type=node&node=5730152&i=1>>
>>> wrote:
>>> > > Hi Claus,
>>> > >
>>> > > I hate to ask this - but I still don't get it.  I thought
>>> > > "recipientList" was for sending to multiple, runtime-defined
>>> > > recipients.  I don't see how this
>>> > > answers the question of sending to one, single recipient, whose URI
>>> is
>>> > > dynamically constructed - and in my use-case the dynamic settings
>>> > > are not in properties - so "simple" (property place-holders) won't
>>> help
>>> > me.
>>> > >
>>> > > Let me give you a concrete example.  I need to do an ftp download and
>>> > > the connection information comes from up-stream in the route in the
>>> > > form of XML (DOM - a Document instance).  Currently, I am trying to
>>> do
>>> > > this with bean binding and method params decorated with @XPath
>>> > > pointing into the Document with the ftp settings and inside the
>>> > > this method doing:
>>> > >
>>> > > FtpComponent ftpComponent = context.getComponent("ftp",
>>> > FtpComponent.class);
>>> > >
>>> > > ..and then attempt to get the endpoint and call createConsumer(...).
>>> > > I'm sure this is not the right way to do it, but I don't see how else
>>> > > - any ideas?
>>> > >
>>> > > Thanks,
>>> > >
>>> > >
>>> > > Chris
>>> > >
>>> > > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]<http://user/SendEmail.jtp?type=node&node=5730152&i=2>>
>>>
>>> > wrote:
>>> > >> Hi
>>> > >>
>>> > >> See this FAQ
>>> > >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]<http://user/SendEmail.jtp?type=node&node=5730152&i=3>
>>> > >> <[hidden email]<http://user/SendEmail.jtp?type=node&node=5730152&i=4>>wrote:
>>>
>>> > >>
>>> > >>> Thanks Walzer..
>>> > >>> *
>>> > >>> *
>>> > >>> *Queston1:
>>> > >>>
>>> > >>> *
>>> > >>> *Example*
>>> > >>>
>>> > >>> .when(header("foo").isEqualTo("bar"))
>>> > >>>                     .to("direct:b")
>>> > >>>
>>> > >>> In my case i have to add more than 80 condition and forwards to 80
>>> > >>> different queues.
>>> > >>>
>>> > >>> Above example i can only hard-code queue name,But what i want is
>>> below.
>>> > >>>
>>> > >>> * .when(header("Type").isNotNull())
>>> > >>>     .to("activemq.Inbound."+header("Type"))
>>> > >>> *
>>> > >>>
>>> > >>> Example:If queue type is test,It should forward to *Inbound.test*
>>> > queue.
>>> > >>>
>>> > >>> Above example i tried,but it did not worked,created queue something
>>> > >>> like this *Inbound.header("type")*
>>> > >>>
>>> > >>> *Question2*:
>>> > >>>
>>> > >>> from("direct:a")
>>> > >>>             .multicast().to("direct:b", "direct:c", "direct:d");
>>> > >>>
>>> > >>> Based on messages header and content type i want forward to
>>> different
>>> > >>> queue.
>>> > >>>
>>> > >>> condition will be *OR *and *AND*.How can i do that like above
>>> example.*
>>> > >>> *
>>> > >>>
>>> > >>> Thanks in advance*
>>> > >>> *
>>> > >>>
>>> > >>> *Regards*
>>> > >>>
>>> > >>> Prabu.N
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
>>> > >>> [hidden email]<http://user/SendEmail.jtp?type=node&node=5730152&i=5>>
>>> wrote:
>>> > >>>
>>> > >>> > Hi,
>>> > >>> >
>>> > >>> > you could start by reading Claus´ book (p. 44ff) which has a
>>> perfect
>>> > >>> > example or http://camel.apache.org/content-based-router.html (just
>>>
>>> > >>> > replace the direct: with your queues).
>>> > >>> > If you need to fire your messages to multiple queues:
>>> > >>> > http://camel.apache.org/publish-subscribe-channel.html shows you
>>> the
>>> > >>> > various ways.
>>> > >>> > When you get the concepts you can just "lego" them together.
>>> > >>> >
>>> > >>> > Regards, Thomas.
>>> > >>> >
>>> > >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
>>> > >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
>>> > >>> > <[hidden email] <
>>> > http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
>>> > >>> >
>>> > >>> > > Hi Claus,
>>> > >>> > >
>>> > >>> > > Thanks so much Clus for help.It is working now.
>>> > >>> > >
>>> > >>> > > I need your guidance for the following requirement.
>>> > >>> > >
>>> > >>> > > 1.I have one *inbound queue* it will receive message frequently
>>> > from my
>>> > >>> > > application.
>>> > >>> > > 2.From *inbound queue* i need camel routing to move message
>>> from
>>> > >>> > > another *message
>>> > >>> > > based inbound queue* based on message header value.
>>> > >>> > > 3.From *message based inbound queue *i* *need camel routing to
>>> move
>>> > >>> > message
>>> > >>> > > to *one or more outbound queue *based on message content*
>>> > >>> > > *
>>> > >>> > >
>>> > >>> > > I need *camel java DSL*sample code for above requirement.*
>>> > >>> > > *
>>> > >>> > > *
>>> > >>> > > *
>>> > >>> > > *Thanks in advance*
>>> > >>> > >
>>> > >>> > >
>>> > >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
>>> > >>> > > [hidden email] <
>>> > http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
>>> > >>> > wrote:
>>> > >>> > >
>>> > >>> > >> Hi
>>> > >>> > >>
>>> > >>> > >> Do as the exception tells you. Check route 2. You route from
>>> > >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
>>> > >>> > >>
>>> > >>> > >> Maybe you need to add "activemq:" as prefix so its
>>> > >>> > >> "activemq:Inbound.SSS.TestEvent".
>>> > >>> > >>
>>> > >>> > >>
>>> > >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
>>> > >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>>> > >>> > >> <[hidden email] <
>>> > http://user/SendEmail.jtp?type=node&node=5730109&i=1
>>> > >>> >>
>>> > >>> >
>>> > >>> > >> wrote:
>>> > >>> > >>
>>> > >>> > >>>
>>> > >>> > >>> I have activemmq  Project in that i have following
>>> requirement
>>> > >>> > >>>
>>> > >>> > >>> 1.Move message from Inbound queue to type based inbound
>>> queue.
>>> > >>> > >>> 2.Move message from Message type inbound queue to outbound
>>> queue
>>> > >>> > >>>
>>> > >>> > >>> I have created two bean for to achieve this.
>>> > >>> > >>>
>>> > >>> > >>> 1.one for move from inbound to message type  inbound queue
>>> > >>> > >>> 2.one for move from inbound to outbound queue.
>>> > >>> > >>>
>>> > >>> > >>> I have following entry in camel.xml
>>> > >>> > >>>
>>> > >>> > >>>   <camelContext id="camel" xmlns="
>>> > >>> > http://camel.apache.org/schema/spring">
>>> > >>> > >>
>>> > >>> > >>>
>>> > >>> > >>>                <routeBuilder ref="routeBuilder" />
>>> > >>> > >>>            <routeBuilder ref="routeBuilder1" />
>>> > >>> > >>>
>>> > >>> > >>>    </camelContext>
>>> > >>> > >>>
>>> > >>> > >>>    <bean id="routeBuilder"
>>> > >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
>>> > >>> > >>>    <bean id="recipientsGenerator"
>>> > >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
>>> > >>> > >>>    <bean id="routeBuilder1"
>>> > >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
>>> > >>> > >>>    <bean id="recipientsGenerator1"
>>> > >>> > >>> class="com.camel.routes.RecipientListBean"/>
>>> > >>> > >>>
>>> > >>> > >>> When i run application i am getting following error.
>>> > >>> > >>>
>>> > >>> > >>> * java.lang.Exception:
>>> org.apache.camel.RuntimeCamelException:
>>> > >>> > >>> org.apache.camel.Fa
>>> > >>> > >>> iledToCreateRouteException: Failed to create route route2:
>>> > >>> > >>> Route[[From[Inbound.G
>>> > >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No
>>> endpoint
>>> > >>> > could
>>> > >>> > >> be
>>> > >>> > >>> found
>>> > >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath
>>> contains
>>> > the
>>> > >>> > >> needed
>>> > >>> > >>> Cam
>>> > >>> > >>> el component jar.*
>>> > >>> > >>>
>>> > >>> > >>> I am not sure i am missing any configuration,Please kindly
>>> help
>>> > me
>>> > >>> > >>>
>>> > >>> > >>>
>>> > >>> > >>>
>>> > >>> > >>>
>>> > >>> > >>> --
>>> > >>> > >>> View this message in context:
>>> > >>> > >>
>>> > http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>>> > >>> > >>> Sent from the Camel - Users mailing list archive at
>>> Nabble.com.
>>> > >>> > >>
>>> > >>> > >>
>>> > >>> > >>
>>> > >>> > >> --
>>> > >>> > >> Claus Ibsen
>>> > >>> > >> -----------------
>>> > >>> > >> Red Hat, Inc.
>>> > >>> > >> FuseSource is now part of Red Hat
>>> > >>> > >> Email: [hidden email]<
>>> > >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>>> > >>> > >> Web: http://fusesource.com
>>> > >>> > >> Twitter: davsclaus
>>> > >>> > >> Blog: http://davsclaus.com
>>> > >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>>> > >>> > >>
>>> > >>> > >>
>>> > >>> > >> ------------------------------
>>> > >>> > >> If you reply to this email, your message will be added to the
>>> > >>> > discussion
>>> > >>> > >> below:
>>> > >>> > >>
>>> > >>> > >>
>>> > >>> >
>>> > >>> > >> .
>>> > >>> > >> NAML<
>>> > >>> >
>>> > >>>
>>> >
>>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>> > >>> >
>>> > >>> >
>>> > >>> > >>
>>> > >>> > >
>>> > >>> > >
>>> > >>> > >
>>> > >>> > > --
>>> > >>> > > Thanks & Regards
>>> > >>> > > Prabu.N
>>> > >>> > >
>>> > >>> > >
>>> > >>> > >
>>> > >>> > >
>>> > >>> > > --
>>> > >>> > > View this message in context:
>>> > >>> >
>>> > >>>
>>> >
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
>>> > >>> >
>>> > >>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>>> > >>> >
>>> > >>> >
>>> > >>> >
>>> > >>> > ------------------------------
>>> > >>> >  If you reply to this email, your message will be added to the
>>> > discussion
>>> > >>> > below:
>>> > >>> >
>>> > >>> >
>>> > >>>
>>> >
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
>>> > >>> >  To unsubscribe from Camel routing issue, click here<
>>> > >>>
>>> > >>> >
>>> > >>> > .
>>> > >>> > NAML<
>>> > >>>
>>> >
>>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>> > >>> >
>>> > >>> >
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>> --
>>> > >>> Thanks & Regards
>>> > >>>  Prabu.N
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>> --
>>> > >>> View this message in context:
>>> > >>>
>>> >
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
>>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>> > >>>
>>> > >>
>>> > >>
>>> > >>
>>> > >> --
>>> > >> Claus Ibsen
>>> > >> -----------------
>>> > >> Red Hat, Inc.
>>> > >> FuseSource is now part of Red Hat
>>> > >> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5730152&i=6>
>>> > >> Web: http://fusesource.com
>>> > >> Twitter: davsclaus
>>> > >> Blog: http://davsclaus.com
>>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>>> >
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5730152&i=7>
>>> Web: http://fusesource.com
>>> Twitter: davsclaus
>>> Blog: http://davsclaus.com
>>> Author of Camel in Action: http://www.manning.com/ibsen
>>>
>>>
>>> ------------------------------
>>>  If you reply to this email, your message will be added to the
>>> discussion below:
>>>
>>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730152.html
>>>  To unsubscribe from Camel routing issue, click here<
>>> .
>>> NAML<
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>
>>
>>
>> --
>> Thanks & Regards
>>  Prabu.N
>>
>
>
>
> --
> Thanks & Regards
>  Prabu.N
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730157.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Chris Wolf
In reply to this post by Claus Ibsen-2
Hi Claus,

Thanks for the response - I could not see any obvious way to configure
an FTP Consumer at ***runtime***,
either via bean, processor or consumer template.  If you have a
concrete example, that would be great to see...

...otherwise, here's the solution I came up with:


    -Chris



  // simulate incoming message from JMS...
  from("timer:kickoff?repeatCount=1")
  .to("direct:start");

  // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
to reconfigure
  // FTP route, then start it...
  from("direct:start")
  .beanRef("configRdr") // config reader bean not shown here
  .convertBodyTo(Document.class)
  // sets a bunch of headers from DOM, e.g.:
  .setHeader("ftp-config.host").xquery("//remote[remoteId/@value='CBOE34']/server/@value",
String.class)
  .setHeader("ftp-route-id", constant("ftp.route"))
  .beanRef("ftpConfigurer");

  // FTP route will only be started by FtpConfigurer bean after it's
dynamically re-configured...
  from("ftp://bogushost/bogusdir?startScheduler=false") // the  URI
will be reconfigured...
  .routeId("ftp.route").noAutoStartup()
  .log("Received file ${file:onlyname}")
  .to("file:/tmp/local/data");

  public class FtpConfigurer {
    public void configureFtpConsumer(Exchange exchange) throws Exception {
        CamelContext context = exchange.getContext();
        Map<String, Object> headers = exchange.getIn().getHeaders();
        Map<String, Object> parameters = new HashMap<String, Object>();

        // Filter headers for ftp-config specific headers...
        for (Map.Entry<String, Object> entry : headers.entrySet()) {
            String key = entry.getKey();
            if (key.startsWith("ftp-config."))
                parameters.put(key.substring("ftp-config.".length()),
entry.getValue());
        }

        String routeId = exchange.getIn().getHeader("ftp-route-id",
String.class);
        Route ftpRoute = context.getRoute(routeId);
        FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
        FtpEndpoint<FTPFile> rfe = (FtpEndpoint<FTPFile>) c.getEndpoint();
        FtpConfiguration rfc = rfe.getConfiguration();

        // Need to crack open FtpConsumer's "endpointPath" field since
        // there's no mutator (setter)
        Class<?> cls = c.getClass();
        Field endpointPath_fld = cls.getDeclaredField("endpointPath");
        endpointPath_fld.setAccessible(true);
        endpointPath_fld.set(c, (String)parameters.get("directory"));

        // Need to crack open FtpEndpoint, actually DefaultEndpoint -
the ultimate base class
        // since there's no mutator (setter) for the "endpointUri" field
        cls = rfe.getClass();
        Field endpointUri_fld = null;
        while (endpointUri_fld == null) {
            // TODO: maybe change logic to just stop at class=DefaultEndpoint
            // rather then using NoSuchFieldException
            try {
                endpointUri_fld = cls.getDeclaredField("endpointUri");
            } catch (NoSuchFieldException nsfe) {
                cls = cls.getSuperclass();
            }
        }
        endpointUri_fld.setAccessible(true);
        endpointUri_fld.set(rfe,
            String.format("ftp://%s/%s",
(String)parameters.get("host"), (String)parameters.get("directory")));

        // set reference properties first as they use # syntax that
fools the regular properties setter
        EndpointHelper.setReferenceProperties(context, rfc, parameters);
        EndpointHelper.setProperties(context, rfc, parameters);
        EndpointHelper.setReferenceProperties(context, rfe, parameters);
        EndpointHelper.setProperties(context, rfe, parameters);
        c.setStartScheduler(true);

        context.startRoute(routeId);
  }
}

On Mon, Apr 1, 2013 at 4:32 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> See this EIP
> http://camel.apache.org/content-enricher.html
>
> About pollEnrich.
>
> Though pollEnrich currently does support dynamic uris. Its on the roadmap,
> for Camel 3.0.
> It requires an API change and thus isn't so easy to implement currently on
> 2.x.
>
> You can always use a java bean / camel processor, and consume the ftp file
> from java code.
> For example using consumer template.
>
> As you use FTP you may want to set disconnect=true so the connect is not
> remained open after usage.
>
>
>
> On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]> wrote:
>
>> Ok, I'm starting to get it - a little bit.  As for my concrete
>> example, so far, I have:
>>
>>                 from("direct:start")
>>                 .beanRef("config")
>>                 .convertBodyTo(Document.class)
>>                 .recipientList().xquery(
>>                     "concat('ftp://'" +
>>                     ",//remote[vendorId/@value='CBOE34']/server/@value" +
>>
>>
>> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
>> +
>>                     ",'?noop=true&amp;username='" +
>>                     ",//remote[vendorId/@value='CBOE34']/username/@value" +
>>                     ",'&amp;password='" +
>>
>> ",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);
>>
>> Here's the problem - this will create an FTP Producer - that's not
>> what I need.  I need a dynamically
>> constructed URI for a polling FTP consumer.  I don't think
>> "recipientList" will work...   Any ideas?
>>
>> Thanks,
>>
>> Chris
>>
>> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]> wrote:
>> > Hi Claus,
>> >
>> > I hate to ask this - but I still don't get it.  I thought
>> > "recipientList" was for sending to multiple, runtime-defined
>> > recipients.  I don't see how this
>> > answers the question of sending to one, single recipient, whose URI is
>> > dynamically constructed - and in my use-case the dynamic settings
>> > are not in properties - so "simple" (property place-holders) won't help
>> me.
>> >
>> > Let me give you a concrete example.  I need to do an ftp download and
>> > the connection information comes from up-stream in the route in the
>> > form of XML (DOM - a Document instance).  Currently, I am trying to do
>> > this with bean binding and method params decorated with @XPath
>> > pointing into the Document with the ftp settings and inside the
>> > this method doing:
>> >
>> > FtpComponent ftpComponent = context.getComponent("ftp",
>> FtpComponent.class);
>> >
>> > ..and then attempt to get the endpoint and call createConsumer(...).
>> > I'm sure this is not the right way to do it, but I don't see how else
>> > - any ideas?
>> >
>> > Thanks,
>> >
>> >
>> > Chris
>> >
>> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]>
>> wrote:
>> >> Hi
>> >>
>> >> See this FAQ
>> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>> >>
>> >>
>> >>
>> >>
>> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
>> >> <[hidden email]>wrote:
>> >>
>> >>> Thanks Walzer..
>> >>> *
>> >>> *
>> >>> *Queston1:
>> >>>
>> >>> *
>> >>> *Example*
>> >>>
>> >>> .when(header("foo").isEqualTo("bar"))
>> >>>                     .to("direct:b")
>> >>>
>> >>> In my case i have to add more than 80 condition and forwards to 80
>> >>> different queues.
>> >>>
>> >>> Above example i can only hard-code queue name,But what i want is below.
>> >>>
>> >>> * .when(header("Type").isNotNull())
>> >>>     .to("activemq.Inbound."+header("Type"))
>> >>> *
>> >>>
>> >>> Example:If queue type is test,It should forward to *Inbound.test*
>> queue.
>> >>>
>> >>> Above example i tried,but it did not worked,created queue something
>> >>> like this *Inbound.header("type")*
>> >>>
>> >>> *Question2*:
>> >>>
>> >>> from("direct:a")
>> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
>> >>>
>> >>> Based on messages header and content type i want forward to different
>> >>> queue.
>> >>>
>> >>> condition will be *OR *and *AND*.How can i do that like above example.*
>> >>> *
>> >>>
>> >>> Thanks in advance*
>> >>> *
>> >>>
>> >>> *Regards*
>> >>>
>> >>> Prabu.N
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
>> >>> [hidden email]> wrote:
>> >>>
>> >>> > Hi,
>> >>> >
>> >>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
>> >>> > example or http://camel.apache.org/content-based-router.html (just
>> >>> > replace the direct: with your queues).
>> >>> > If you need to fire your messages to multiple queues:
>> >>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
>> >>> > various ways.
>> >>> > When you get the concepts you can just "lego" them together.
>> >>> >
>> >>> > Regards, Thomas.
>> >>> >
>> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
>> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
>> >>> > <[hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
>> >>> >
>> >>> > > Hi Claus,
>> >>> > >
>> >>> > > Thanks so much Clus for help.It is working now.
>> >>> > >
>> >>> > > I need your guidance for the following requirement.
>> >>> > >
>> >>> > > 1.I have one *inbound queue* it will receive message frequently
>> from my
>> >>> > > application.
>> >>> > > 2.From *inbound queue* i need camel routing to move message from
>> >>> > > another *message
>> >>> > > based inbound queue* based on message header value.
>> >>> > > 3.From *message based inbound queue *i* *need camel routing to move
>> >>> > message
>> >>> > > to *one or more outbound queue *based on message content*
>> >>> > > *
>> >>> > >
>> >>> > > I need *camel java DSL*sample code for above requirement.*
>> >>> > > *
>> >>> > > *
>> >>> > > *
>> >>> > > *Thanks in advance*
>> >>> > >
>> >>> > >
>> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
>> >>> > > [hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
>> >>> > wrote:
>> >>> > >
>> >>> > >> Hi
>> >>> > >>
>> >>> > >> Do as the exception tells you. Check route 2. You route from
>> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
>> >>> > >>
>> >>> > >> Maybe you need to add "activemq:" as prefix so its
>> >>> > >> "activemq:Inbound.SSS.TestEvent".
>> >>> > >>
>> >>> > >>
>> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
>> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>> >>> > >> <[hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730109&i=1
>> >>> >>
>> >>> >
>> >>> > >> wrote:
>> >>> > >>
>> >>> > >>>
>> >>> > >>> I have activemmq  Project in that i have following requirement
>> >>> > >>>
>> >>> > >>> 1.Move message from Inbound queue to type based inbound queue.
>> >>> > >>> 2.Move message from Message type inbound queue to outbound queue
>> >>> > >>>
>> >>> > >>> I have created two bean for to achieve this.
>> >>> > >>>
>> >>> > >>> 1.one for move from inbound to message type  inbound queue
>> >>> > >>> 2.one for move from inbound to outbound queue.
>> >>> > >>>
>> >>> > >>> I have following entry in camel.xml
>> >>> > >>>
>> >>> > >>>   <camelContext id="camel" xmlns="
>> >>> > http://camel.apache.org/schema/spring">
>> >>> > >>
>> >>> > >>>
>> >>> > >>>                <routeBuilder ref="routeBuilder" />
>> >>> > >>>            <routeBuilder ref="routeBuilder1" />
>> >>> > >>>
>> >>> > >>>    </camelContext>
>> >>> > >>>
>> >>> > >>>    <bean id="routeBuilder"
>> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
>> >>> > >>>    <bean id="recipientsGenerator"
>> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
>> >>> > >>>    <bean id="routeBuilder1"
>> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
>> >>> > >>>    <bean id="recipientsGenerator1"
>> >>> > >>> class="com.camel.routes.RecipientListBean"/>
>> >>> > >>>
>> >>> > >>> When i run application i am getting following error.
>> >>> > >>>
>> >>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
>> >>> > >>> org.apache.camel.Fa
>> >>> > >>> iledToCreateRouteException: Failed to create route route2:
>> >>> > >>> Route[[From[Inbound.G
>> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
>> >>> > could
>> >>> > >> be
>> >>> > >>> found
>> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains
>> the
>> >>> > >> needed
>> >>> > >>> Cam
>> >>> > >>> el component jar.*
>> >>> > >>>
>> >>> > >>> I am not sure i am missing any configuration,Please kindly help
>> me
>> >>> > >>>
>> >>> > >>>
>> >>> > >>>
>> >>> > >>>
>> >>> > >>> --
>> >>> > >>> View this message in context:
>> >>> > >>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>> >>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>> > >>
>> >>> > >>
>> >>> > >>
>> >>> > >> --
>> >>> > >> Claus Ibsen
>> >>> > >> -----------------
>> >>> > >> Red Hat, Inc.
>> >>> > >> FuseSource is now part of Red Hat
>> >>> > >> Email: [hidden email]<
>> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>> >>> > >> Web: http://fusesource.com
>> >>> > >> Twitter: davsclaus
>> >>> > >> Blog: http://davsclaus.com
>> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>> >>> > >>
>> >>> > >>
>> >>> > >> ------------------------------
>> >>> > >> If you reply to this email, your message will be added to the
>> >>> > discussion
>> >>> > >> below:
>> >>> > >>
>> >>> > >>
>> >>> >
>> >>> > >> .
>> >>> > >> NAML<
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >>> >
>> >>> >
>> >>> > >>
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > --
>> >>> > > Thanks & Regards
>> >>> > > Prabu.N
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > --
>> >>> > > View this message in context:
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
>> >>> >
>> >>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>> >
>> >>> >
>> >>> >
>> >>> > ------------------------------
>> >>> >  If you reply to this email, your message will be added to the
>> discussion
>> >>> > below:
>> >>> >
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
>> >>> >  To unsubscribe from Camel routing issue, click here<
>> >>>
>> >>> >
>> >>> > .
>> >>> > NAML<
>> >>>
>>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >>> >
>> >>> >
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Thanks & Regards
>> >>>  Prabu.N
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
>> >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -----------------
>> >> Red Hat, Inc.
>> >> FuseSource is now part of Red Hat
>> >> Email: [hidden email]
>> >> Web: http://fusesource.com
>> >> Twitter: davsclaus
>> >> Blog: http://davsclaus.com
>> >> Author of Camel in Action: http://www.manning.com/ibsen
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

prabumca06@gmail.com
Hi Chris / Claus,

I have one Inbound queue,based on header and content type,I want forward to outbound queue.

Example 1:

Inbound.queue name :
Inbound.Test.DDD
Outbound.queue name : SOURH
QueueName

Criteria or Condition :
Message property PAST_EVENT_INTERVAL type is : 0
  AND
Message Type value is : card.test or card.expiry.test

Example 2:

Inbound.queue name : Inbound.Test.SSS
Outbound.queue name : WEST
QueueName

Criteria or Condition :
Message property PAST_EVENT_INTERVAL type is : 0
 AND
Message Type value start with :card.event

I want achieve this using camel routing java DSL.

Please help me.How can i use AND,OR and regular expression in camel routing
 
Regards
Prabu.N


On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] <[hidden email]> wrote:
Hi Claus,

Thanks for the response - I could not see any obvious way to configure
an FTP Consumer at ***runtime***,
either via bean, processor or consumer template.  If you have a
concrete example, that would be great to see...

...otherwise, here's the solution I came up with:


    -Chris



  // simulate incoming message from JMS...
  from("timer:kickoff?repeatCount=1")
  .to("direct:start");

  // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
to reconfigure
  // FTP route, then start it...
  from("direct:start")
  .beanRef("configRdr") // config reader bean not shown here
  .convertBodyTo(Document.class)
  // sets a bunch of headers from DOM, e.g.:
  .setHeader("ftp-config.host").xquery("//remote[remoteId/@value='CBOE34']/server/@value",
String.class)
  .setHeader("ftp-route-id", constant("ftp.route"))
  .beanRef("ftpConfigurer");

  // FTP route will only be started by FtpConfigurer bean after it's
dynamically re-configured...
  from("ftp://bogushost/bogusdir?startScheduler=false") // the  URI
will be reconfigured...
  .routeId("ftp.route").noAutoStartup()
  .log("Received file ${file:onlyname}")
  .to("file:/tmp/local/data");

  public class FtpConfigurer {
    public void configureFtpConsumer(Exchange exchange) throws Exception {
        CamelContext context = exchange.getContext();
        Map<String, Object> headers = exchange.getIn().getHeaders();
        Map<String, Object> parameters = new HashMap<String, Object>();

        // Filter headers for ftp-config specific headers...
        for (Map.Entry<String, Object> entry : headers.entrySet()) {
            String key = entry.getKey();
            if (key.startsWith("ftp-config."))
                parameters.put(key.substring("ftp-config.".length()),
entry.getValue());
        }

        String routeId = exchange.getIn().getHeader("ftp-route-id",
String.class);
        Route ftpRoute = context.getRoute(routeId);
        FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
        FtpEndpoint<FTPFile> rfe = (FtpEndpoint<FTPFile>) c.getEndpoint();
        FtpConfiguration rfc = rfe.getConfiguration();

        // Need to crack open FtpConsumer's "endpointPath" field since
        // there's no mutator (setter)
        Class<?> cls = c.getClass();
        Field endpointPath_fld = cls.getDeclaredField("endpointPath");
        endpointPath_fld.setAccessible(true);
        endpointPath_fld.set(c, (String)parameters.get("directory"));

        // Need to crack open FtpEndpoint, actually DefaultEndpoint -
the ultimate base class
        // since there's no mutator (setter) for the "endpointUri" field
        cls = rfe.getClass();
        Field endpointUri_fld = null;
        while (endpointUri_fld == null) {
            // TODO: maybe change logic to just stop at class=DefaultEndpoint
            // rather then using NoSuchFieldException
            try {
                endpointUri_fld = cls.getDeclaredField("endpointUri");
            } catch (NoSuchFieldException nsfe) {
                cls = cls.getSuperclass();
            }
        }
        endpointUri_fld.setAccessible(true);
        endpointUri_fld.set(rfe,
            String.format("ftp://%s/%s",
(String)parameters.get("host"), (String)parameters.get("directory")));

        // set reference properties first as they use # syntax that
fools the regular properties setter
        EndpointHelper.setReferenceProperties(context, rfc, parameters);
        EndpointHelper.setProperties(context, rfc, parameters);
        EndpointHelper.setReferenceProperties(context, rfe, parameters);
        EndpointHelper.setProperties(context, rfe, parameters);
        c.setStartScheduler(true);

        context.startRoute(routeId);
  }
}

On Mon, Apr 1, 2013 at 4:32 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> See this EIP
> http://camel.apache.org/content-enricher.html
>
> About pollEnrich.
>
> Though pollEnrich currently does support dynamic uris. Its on the roadmap,
> for Camel 3.0.
> It requires an API change and thus isn't so easy to implement currently on
> 2.x.
>
> You can always use a java bean / camel processor, and consume the ftp file
> from java code.
> For example using consumer template.
>
> As you use FTP you may want to set disconnect=true so the connect is not
> remained open after usage.
>
>
>
> On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]> wrote:
>
>> Ok, I'm starting to get it - a little bit.  As for my concrete
>> example, so far, I have:
>>
>>                 from("direct:start")
>>                 .beanRef("config")
>>                 .convertBodyTo(Document.class)
>>                 .recipientList().xquery(
>>                     "concat('ftp://'" +
>>                     ",//remote[vendorId/@value='CBOE34']/server/@value" +
>>
>>
>> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
>> +
>>                     ",'?noop=true&amp;username='" +
>>                     ",//remote[vendorId/@value='CBOE34']/username/@value" +
>>                     ",'&amp;password='" +
>>
>> ",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);
>>
>> Here's the problem - this will create an FTP Producer - that's not
>> what I need.  I need a dynamically
>> constructed URI for a polling FTP consumer.  I don't think
>> "recipientList" will work...   Any ideas?
>>
>> Thanks,
>>
>> Chris
>>
>> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]> wrote:
>> > Hi Claus,
>> >
>> > I hate to ask this - but I still don't get it.  I thought
>> > "recipientList" was for sending to multiple, runtime-defined
>> > recipients.  I don't see how this
>> > answers the question of sending to one, single recipient, whose URI is
>> > dynamically constructed - and in my use-case the dynamic settings
>> > are not in properties - so "simple" (property place-holders) won't help
>> me.
>> >
>> > Let me give you a concrete example.  I need to do an ftp download and
>> > the connection information comes from up-stream in the route in the
>> > form of XML (DOM - a Document instance).  Currently, I am trying to do
>> > this with bean binding and method params decorated with @XPath
>> > pointing into the Document with the ftp settings and inside the
>> > this method doing:
>> >
>> > FtpComponent ftpComponent = context.getComponent("ftp",
>> FtpComponent.class);
>> >
>> > ..and then attempt to get the endpoint and call createConsumer(...).
>> > I'm sure this is not the right way to do it, but I don't see how else
>> > - any ideas?
>> >
>> > Thanks,
>> >
>> >
>> > Chris
>> >
>> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]>
>> wrote:
>> >> Hi
>> >>
>> >> See this FAQ
>> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>> >>
>> >>
>> >>
>> >>
>> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
>> >> <[hidden email]>wrote:
>> >>
>> >>> Thanks Walzer..
>> >>> *
>> >>> *
>> >>> *Queston1:
>> >>>
>> >>> *
>> >>> *Example*
>> >>>
>> >>> .when(header("foo").isEqualTo("bar"))
>> >>>                     .to("direct:b")
>> >>>
>> >>> In my case i have to add more than 80 condition and forwards to 80
>> >>> different queues.
>> >>>
>> >>> Above example i can only hard-code queue name,But what i want is below.
>> >>>
>> >>> * .when(header("Type").isNotNull())
>> >>>     .to("activemq.Inbound."+header("Type"))
>> >>> *
>> >>>
>> >>> Example:If queue type is test,It should forward to *Inbound.test*
>> queue.
>> >>>
>> >>> Above example i tried,but it did not worked,created queue something
>> >>> like this *Inbound.header("type")*
>> >>>
>> >>> *Question2*:
>> >>>
>> >>> from("direct:a")
>> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
>> >>>
>> >>> Based on messages header and content type i want forward to different
>> >>> queue.
>> >>>
>> >>> condition will be *OR *and *AND*.How can i do that like above example.*
>> >>> *
>> >>>
>> >>> Thanks in advance*
>> >>> *
>> >>>
>> >>> *Regards*
>> >>>
>> >>> Prabu.N
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
>> >>> [hidden email]> wrote:
>> >>>
>> >>> > Hi,
>> >>> >
>> >>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
>> >>> > example or http://camel.apache.org/content-based-router.html (just
>> >>> > replace the direct: with your queues).
>> >>> > If you need to fire your messages to multiple queues:
>> >>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
>> >>> > various ways.
>> >>> > When you get the concepts you can just "lego" them together.
>> >>> >
>> >>> > Regards, Thomas.
>> >>> >
>> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
>> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
>> >>> > <[hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
>> >>> >
>> >>> > > Hi Claus,
>> >>> > >
>> >>> > > Thanks so much Clus for help.It is working now.
>> >>> > >
>> >>> > > I need your guidance for the following requirement.
>> >>> > >
>> >>> > > 1.I have one *inbound queue* it will receive message frequently
>> from my
>> >>> > > application.
>> >>> > > 2.From *inbound queue* i need camel routing to move message from
>> >>> > > another *message
>> >>> > > based inbound queue* based on message header value.
>> >>> > > 3.From *message based inbound queue *i* *need camel routing to move
>> >>> > message
>> >>> > > to *one or more outbound queue *based on message content*
>> >>> > > *
>> >>> > >
>> >>> > > I need *camel java DSL*sample code for above requirement.*
>> >>> > > *
>> >>> > > *
>> >>> > > *
>> >>> > > *Thanks in advance*
>> >>> > >
>> >>> > >
>> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
>> >>> > > [hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
>> >>> > wrote:
>> >>> > >
>> >>> > >> Hi
>> >>> > >>
>> >>> > >> Do as the exception tells you. Check route 2. You route from
>> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
>> >>> > >>
>> >>> > >> Maybe you need to add "activemq:" as prefix so its
>> >>> > >> "activemq:Inbound.SSS.TestEvent".
>> >>> > >>
>> >>> > >>
>> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
>> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>> >>> > >> <[hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730109&i=1
>> >>> >>
>> >>> >
>> >>> > >> wrote:
>> >>> > >>
>> >>> > >>>
>> >>> > >>> I have activemmq  Project in that i have following requirement
>> >>> > >>>
>> >>> > >>> 1.Move message from Inbound queue to type based inbound queue.
>> >>> > >>> 2.Move message from Message type inbound queue to outbound queue
>> >>> > >>>
>> >>> > >>> I have created two bean for to achieve this.
>> >>> > >>>
>> >>> > >>> 1.one for move from inbound to message type  inbound queue
>> >>> > >>> 2.one for move from inbound to outbound queue.
>> >>> > >>>
>> >>> > >>> I have following entry in camel.xml
>> >>> > >>>
>> >>> > >>>   <camelContext id="camel" xmlns="
>> >>> > http://camel.apache.org/schema/spring">
>> >>> > >>
>> >>> > >>>
>> >>> > >>>                <routeBuilder ref="routeBuilder" />
>> >>> > >>>            <routeBuilder ref="routeBuilder1" />
>> >>> > >>>
>> >>> > >>>    </camelContext>
>> >>> > >>>
>> >>> > >>>    <bean id="routeBuilder"
>> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
>> >>> > >>>    <bean id="recipientsGenerator"
>> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
>> >>> > >>>    <bean id="routeBuilder1"
>> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
>> >>> > >>>    <bean id="recipientsGenerator1"
>> >>> > >>> class="com.camel.routes.RecipientListBean"/>
>> >>> > >>>
>> >>> > >>> When i run application i am getting following error.
>> >>> > >>>
>> >>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
>> >>> > >>> org.apache.camel.Fa
>> >>> > >>> iledToCreateRouteException: Failed to create route route2:
>> >>> > >>> Route[[From[Inbound.G
>> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
>> >>> > could
>> >>> > >> be
>> >>> > >>> found
>> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains
>> the
>> >>> > >> needed
>> >>> > >>> Cam
>> >>> > >>> el component jar.*
>> >>> > >>>
>> >>> > >>> I am not sure i am missing any configuration,Please kindly help
>> me
>> >>> > >>>
>> >>> > >>>
>> >>> > >>>
>> >>> > >>>
>> >>> > >>> --
>> >>> > >>> View this message in context:
>> >>> > >>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>> >>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>> > >>
>> >>> > >>
>> >>> > >>
>> >>> > >> --
>> >>> > >> Claus Ibsen
>> >>> > >> -----------------
>> >>> > >> Red Hat, Inc.
>> >>> > >> FuseSource is now part of Red Hat
>> >>> > >> Email: [hidden email]<
>> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>> >>> > >> Web: http://fusesource.com
>> >>> > >> Twitter: davsclaus
>> >>> > >> Blog: http://davsclaus.com
>> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>> >>> > >>

>> >>> > >>
>> >>> > >> ------------------------------
>> >>> > >> If you reply to this email, your message will be added to the
>> >>> > discussion
>> >>> > >> below:
>> >>> > >>
>> >>> > >>
>> >>> >
>> >>> > >> .
>> >>> > >> NAML<
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >>> >

>> >>> >
>> >>> > >>
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > --
>> >>> > > Thanks & Regards
>> >>> > > Prabu.N
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > --
>> >>> > > View this message in context:
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
>> >>> >

>> >>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>> >
>> >>> >
>> >>> >
>> >>> > ------------------------------
>> >>> >  If you reply to this email, your message will be added to the
>> discussion
>> >>> > below:
>> >>> >
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
>> >>> >  To unsubscribe from Camel routing issue, click here<
>> >>>
>> >>> >
>> >>> > .
>> >>> > NAML<
>> >>>
>>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >>> >

>> >>> >
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Thanks & Regards
>> >>>  Prabu.N
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
>> >>> Sent from the Camel - Users mailing list archive at Nabble.com.

>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -----------------
>> >> Red Hat, Inc.
>> >> FuseSource is now part of Red Hat
>> >> Email: [hidden email]
>> >> Web: http://fusesource.com
>> >> Twitter: davsclaus
>> >> Blog: http://davsclaus.com
>> >> Author of Camel in Action: http://www.manning.com/ibsen
>>

>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730166.html
To unsubscribe from Camel routing issue, click here.
NAML



--
Thanks & Regards
 Prabu.N
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

prabumca06@gmail.com
In reply to this post by Chris Wolf
I have found solution in internet using Predicate  we can achieve this,

But,one doubt in the link http://camel.apache.org/predicate.html,They mentioned that we can use AND and OR in Predicate

I have added below code in project,But i am getting compilation error.Please kindly help

Predicate god = and(admin, or(body().contains("Camel Rider"), header("type").isEqualTo("god")));

Thanks
Prabu.N


On Mon, Apr 1, 2013 at 9:05 PM, Prabu <[hidden email]> wrote:
Hi Chris / Claus,

I have one Inbound queue,based on header and content type,I want forward to outbound queue.

Example 1:

Inbound.queue name :
Inbound.Test.DDD
Outbound.queue name : SOURH
QueueName

Criteria or Condition :
Message property PAST_EVENT_INTERVAL type is : 0
  AND
Message Type value is : card.test or card.expiry.test

Example 2:

Inbound.queue name : Inbound.Test.SSS
Outbound.queue name : WEST
QueueName

Criteria or Condition :
Message property PAST_EVENT_INTERVAL type is : 0
 AND
Message Type value start with :card.event

I want achieve this using camel routing java DSL.

Please help me.How can i use AND,OR and regular expression in camel routing
 
Regards
Prabu.N


On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] <[hidden email]> wrote:
Hi Claus,

Thanks for the response - I could not see any obvious way to configure
an FTP Consumer at ***runtime***,
either via bean, processor or consumer template.  If you have a
concrete example, that would be great to see...

...otherwise, here's the solution I came up with:


    -Chris



  // simulate incoming message from JMS...
  from("timer:kickoff?repeatCount=1")
  .to("direct:start");

  // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
to reconfigure
  // FTP route, then start it...
  from("direct:start")
  .beanRef("configRdr") // config reader bean not shown here
  .convertBodyTo(Document.class)
  // sets a bunch of headers from DOM, e.g.:
  .setHeader("ftp-config.host").xquery("//remote[remoteId/@value='CBOE34']/server/@value",
String.class)
  .setHeader("ftp-route-id", constant("ftp.route"))
  .beanRef("ftpConfigurer");

  // FTP route will only be started by FtpConfigurer bean after it's
dynamically re-configured...
  from("ftp://bogushost/bogusdir?startScheduler=false") // the  URI
will be reconfigured...
  .routeId("ftp.route").noAutoStartup()
  .log("Received file ${file:onlyname}")
  .to("file:/tmp/local/data");

  public class FtpConfigurer {
    public void configureFtpConsumer(Exchange exchange) throws Exception {
        CamelContext context = exchange.getContext();
        Map<String, Object> headers = exchange.getIn().getHeaders();
        Map<String, Object> parameters = new HashMap<String, Object>();

        // Filter headers for ftp-config specific headers...
        for (Map.Entry<String, Object> entry : headers.entrySet()) {
            String key = entry.getKey();
            if (key.startsWith("ftp-config."))
                parameters.put(key.substring("ftp-config.".length()),
entry.getValue());
        }

        String routeId = exchange.getIn().getHeader("ftp-route-id",
String.class);
        Route ftpRoute = context.getRoute(routeId);
        FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
        FtpEndpoint<FTPFile> rfe = (FtpEndpoint<FTPFile>) c.getEndpoint();
        FtpConfiguration rfc = rfe.getConfiguration();

        // Need to crack open FtpConsumer's "endpointPath" field since
        // there's no mutator (setter)
        Class<?> cls = c.getClass();
        Field endpointPath_fld = cls.getDeclaredField("endpointPath");
        endpointPath_fld.setAccessible(true);
        endpointPath_fld.set(c, (String)parameters.get("directory"));

        // Need to crack open FtpEndpoint, actually DefaultEndpoint -
the ultimate base class
        // since there's no mutator (setter) for the "endpointUri" field
        cls = rfe.getClass();
        Field endpointUri_fld = null;
        while (endpointUri_fld == null) {
            // TODO: maybe change logic to just stop at class=DefaultEndpoint
            // rather then using NoSuchFieldException
            try {
                endpointUri_fld = cls.getDeclaredField("endpointUri");
            } catch (NoSuchFieldException nsfe) {
                cls = cls.getSuperclass();
            }
        }
        endpointUri_fld.setAccessible(true);
        endpointUri_fld.set(rfe,
            String.format("ftp://%s/%s",
(String)parameters.get("host"), (String)parameters.get("directory")));

        // set reference properties first as they use # syntax that
fools the regular properties setter
        EndpointHelper.setReferenceProperties(context, rfc, parameters);
        EndpointHelper.setProperties(context, rfc, parameters);
        EndpointHelper.setReferenceProperties(context, rfe, parameters);
        EndpointHelper.setProperties(context, rfe, parameters);
        c.setStartScheduler(true);

        context.startRoute(routeId);
  }
}

On Mon, Apr 1, 2013 at 4:32 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> See this EIP
> http://camel.apache.org/content-enricher.html
>
> About pollEnrich.
>
> Though pollEnrich currently does support dynamic uris. Its on the roadmap,
> for Camel 3.0.
> It requires an API change and thus isn't so easy to implement currently on
> 2.x.
>
> You can always use a java bean / camel processor, and consume the ftp file
> from java code.
> For example using consumer template.
>
> As you use FTP you may want to set disconnect=true so the connect is not
> remained open after usage.
>
>
>
> On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]> wrote:
>
>> Ok, I'm starting to get it - a little bit.  As for my concrete
>> example, so far, I have:
>>
>>                 from("direct:start")
>>                 .beanRef("config")
>>                 .convertBodyTo(Document.class)
>>                 .recipientList().xquery(
>>                     "concat('ftp://'" +
>>                     ",//remote[vendorId/@value='CBOE34']/server/@value" +
>>
>>
>> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
>> +
>>                     ",'?noop=true&amp;username='" +
>>                     ",//remote[vendorId/@value='CBOE34']/username/@value" +
>>                     ",'&amp;password='" +
>>
>> ",//remote[vendorId/@value='CBOE34']/password/@value)", String.class);
>>
>> Here's the problem - this will create an FTP Producer - that's not
>> what I need.  I need a dynamically
>> constructed URI for a polling FTP consumer.  I don't think
>> "recipientList" will work...   Any ideas?
>>
>> Thanks,
>>
>> Chris
>>
>> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]> wrote:
>> > Hi Claus,
>> >
>> > I hate to ask this - but I still don't get it.  I thought
>> > "recipientList" was for sending to multiple, runtime-defined
>> > recipients.  I don't see how this
>> > answers the question of sending to one, single recipient, whose URI is
>> > dynamically constructed - and in my use-case the dynamic settings
>> > are not in properties - so "simple" (property place-holders) won't help
>> me.
>> >
>> > Let me give you a concrete example.  I need to do an ftp download and
>> > the connection information comes from up-stream in the route in the
>> > form of XML (DOM - a Document instance).  Currently, I am trying to do
>> > this with bean binding and method params decorated with @XPath
>> > pointing into the Document with the ftp settings and inside the
>> > this method doing:
>> >
>> > FtpComponent ftpComponent = context.getComponent("ftp",
>> FtpComponent.class);
>> >
>> > ..and then attempt to get the endpoint and call createConsumer(...).
>> > I'm sure this is not the right way to do it, but I don't see how else
>> > - any ideas?
>> >
>> > Thanks,
>> >
>> >
>> > Chris
>> >
>> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]>
>> wrote:
>> >> Hi
>> >>
>> >> See this FAQ
>> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
>> >>
>> >>
>> >>
>> >>
>> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]
>> >> <[hidden email]>wrote:
>> >>
>> >>> Thanks Walzer..
>> >>> *
>> >>> *
>> >>> *Queston1:
>> >>>
>> >>> *
>> >>> *Example*
>> >>>
>> >>> .when(header("foo").isEqualTo("bar"))
>> >>>                     .to("direct:b")
>> >>>
>> >>> In my case i have to add more than 80 condition and forwards to 80
>> >>> different queues.
>> >>>
>> >>> Above example i can only hard-code queue name,But what i want is below.
>> >>>
>> >>> * .when(header("Type").isNotNull())
>> >>>     .to("activemq.Inbound."+header("Type"))
>> >>> *
>> >>>
>> >>> Example:If queue type is test,It should forward to *Inbound.test*
>> queue.
>> >>>
>> >>> Above example i tried,but it did not worked,created queue something
>> >>> like this *Inbound.header("type")*
>> >>>
>> >>> *Question2*:
>> >>>
>> >>> from("direct:a")
>> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
>> >>>
>> >>> Based on messages header and content type i want forward to different
>> >>> queue.
>> >>>
>> >>> condition will be *OR *and *AND*.How can i do that like above example.*
>> >>> *
>> >>>
>> >>> Thanks in advance*
>> >>> *
>> >>>
>> >>> *Regards*
>> >>>
>> >>> Prabu.N
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
>> >>> [hidden email]> wrote:
>> >>>
>> >>> > Hi,
>> >>> >
>> >>> > you could start by reading Claus´ book (p. 44ff) which has a perfect
>> >>> > example or http://camel.apache.org/content-based-router.html (just
>> >>> > replace the direct: with your queues).
>> >>> > If you need to fire your messages to multiple queues:
>> >>> > http://camel.apache.org/publish-subscribe-channel.html shows you the
>> >>> > various ways.
>> >>> > When you get the concepts you can just "lego" them together.
>> >>> >
>> >>> > Regards, Thomas.
>> >>> >
>> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
>> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
>> >>> > <[hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
>> >>> >
>> >>> > > Hi Claus,
>> >>> > >
>> >>> > > Thanks so much Clus for help.It is working now.
>> >>> > >
>> >>> > > I need your guidance for the following requirement.
>> >>> > >
>> >>> > > 1.I have one *inbound queue* it will receive message frequently
>> from my
>> >>> > > application.
>> >>> > > 2.From *inbound queue* i need camel routing to move message from
>> >>> > > another *message
>> >>> > > based inbound queue* based on message header value.
>> >>> > > 3.From *message based inbound queue *i* *need camel routing to move
>> >>> > message
>> >>> > > to *one or more outbound queue *based on message content*
>> >>> > > *
>> >>> > >
>> >>> > > I need *camel java DSL*sample code for above requirement.*
>> >>> > > *
>> >>> > > *
>> >>> > > *
>> >>> > > *Thanks in advance*
>> >>> > >
>> >>> > >
>> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
>> >>> > > [hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
>> >>> > wrote:
>> >>> > >
>> >>> > >> Hi
>> >>> > >>
>> >>> > >> Do as the exception tells you. Check route 2. You route from
>> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
>> >>> > >>
>> >>> > >> Maybe you need to add "activemq:" as prefix so its
>> >>> > >> "activemq:Inbound.SSS.TestEvent".
>> >>> > >>
>> >>> > >>
>> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
>> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
>> >>> > >> <[hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5730109&i=1
>> >>> >>
>> >>> >
>> >>> > >> wrote:
>> >>> > >>
>> >>> > >>>
>> >>> > >>> I have activemmq  Project in that i have following requirement
>> >>> > >>>
>> >>> > >>> 1.Move message from Inbound queue to type based inbound queue.
>> >>> > >>> 2.Move message from Message type inbound queue to outbound queue
>> >>> > >>>
>> >>> > >>> I have created two bean for to achieve this.
>> >>> > >>>
>> >>> > >>> 1.one for move from inbound to message type  inbound queue
>> >>> > >>> 2.one for move from inbound to outbound queue.
>> >>> > >>>
>> >>> > >>> I have following entry in camel.xml
>> >>> > >>>
>> >>> > >>>   <camelContext id="camel" xmlns="
>> >>> > http://camel.apache.org/schema/spring">
>> >>> > >>
>> >>> > >>>
>> >>> > >>>                <routeBuilder ref="routeBuilder" />
>> >>> > >>>            <routeBuilder ref="routeBuilder1" />
>> >>> > >>>
>> >>> > >>>    </camelContext>
>> >>> > >>>
>> >>> > >>>    <bean id="routeBuilder"
>> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
>> >>> > >>>    <bean id="recipientsGenerator"
>> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
>> >>> > >>>    <bean id="routeBuilder1"
>> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
>> >>> > >>>    <bean id="recipientsGenerator1"
>> >>> > >>> class="com.camel.routes.RecipientListBean"/>
>> >>> > >>>
>> >>> > >>> When i run application i am getting following error.
>> >>> > >>>
>> >>> > >>> * java.lang.Exception: org.apache.camel.RuntimeCamelException:
>> >>> > >>> org.apache.camel.Fa
>> >>> > >>> iledToCreateRouteException: Failed to create route route2:
>> >>> > >>> Route[[From[Inbound.G
>> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No endpoint
>> >>> > could
>> >>> > >> be
>> >>> > >>> found
>> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath contains
>> the
>> >>> > >> needed
>> >>> > >>> Cam
>> >>> > >>> el component jar.*
>> >>> > >>>
>> >>> > >>> I am not sure i am missing any configuration,Please kindly help
>> me
>> >>> > >>>
>> >>> > >>>
>> >>> > >>>
>> >>> > >>>
>> >>> > >>> --
>> >>> > >>> View this message in context:
>> >>> > >>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
>> >>> > >>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>> > >>
>> >>> > >>
>> >>> > >>
>> >>> > >> --
>> >>> > >> Claus Ibsen
>> >>> > >> -----------------
>> >>> > >> Red Hat, Inc.
>> >>> > >> FuseSource is now part of Red Hat
>> >>> > >> Email: [hidden email]<
>> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
>> >>> > >> Web: http://fusesource.com
>> >>> > >> Twitter: davsclaus
>> >>> > >> Blog: http://davsclaus.com
>> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
>> >>> > >>

>> >>> > >>
>> >>> > >> ------------------------------
>> >>> > >> If you reply to this email, your message will be added to the
>> >>> > discussion
>> >>> > >> below:
>> >>> > >>
>> >>> > >>
>> >>> >
>> >>> > >> .
>> >>> > >> NAML<
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >>> >

>> >>> >
>> >>> > >>
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > --
>> >>> > > Thanks & Regards
>> >>> > > Prabu.N
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > --
>> >>> > > View this message in context:
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
>> >>> >

>> >>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>> >
>> >>> >
>> >>> >
>> >>> > ------------------------------
>> >>> >  If you reply to this email, your message will be added to the
>> discussion
>> >>> > below:
>> >>> >
>> >>> >
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
>> >>> >  To unsubscribe from Camel routing issue, click here<
>> >>>
>> >>> >
>> >>> > .
>> >>> > NAML<
>> >>>
>>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >>> >

>> >>> >
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Thanks & Regards
>> >>>  Prabu.N
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
>> >>> Sent from the Camel - Users mailing list archive at Nabble.com.

>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -----------------
>> >> Red Hat, Inc.
>> >> FuseSource is now part of Red Hat
>> >> Email: [hidden email]
>> >> Web: http://fusesource.com
>> >> Twitter: davsclaus
>> >> Blog: http://davsclaus.com
>> >> Author of Camel in Action: http://www.manning.com/ibsen
>>

>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730166.html
To unsubscribe from Camel routing issue, click here.
NAML



--
Thanks & Regards
 Prabu.N



--
Thanks & Regards
 Prabu.N
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Claus Ibsen-2
Hi

You should static import those methods: and, or
on the class org.apache.camel.builder.PredicateBuilder
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/builder/PredicateBuilder.html



On Tue, Apr 2, 2013 at 10:17 AM, [hidden email]
<[hidden email]>wrote:

> I have found solution in internet using Predicate  we can achieve this,
>
> But,one doubt in the link
> http://camel.apache.org/predicate.html,Theymentioned that we can use
> AND and OR in Predicate
>
> I have added below code in project,But i am getting compilation
> error.Please kindly help
>
> *Predicate god = and(admin, or(body().contains("Camel Rider"),
> header("type").isEqualTo("god")));*
>
> *Thanks*
> Prabu.N
>
>
> On Mon, Apr 1, 2013 at 9:05 PM, Prabu <[hidden email]> wrote:
>
> > Hi *Chris / **Claus*,
> >
> > I have one *Inbound* queue,based on header and content type,I want
> > forward to outbound queue.
> > *
> > Example 1:
> > *
> > *
> > Inbound.queue name : **Inbound.Test.DDD
> > Outbound.queue name : SOURHQueueName
> >
> > *
> > *Criteria or Condition :
> > *
> > Message property *PAST_EVENT_INTERVAL type* is : *0*
> >    *AND*
> > Message *Type* value is : *card.test *or* card.expiry.test*
> >
> > *Example 2:*
> >
> > *Inbound.queue name : **Inbound.Test.SSS
> > Outbound.queue name : WESTQueueName
> > *
> > *Criteria or Condition :*
> > Message property *PAST_EVENT_INTERVAL type* is : *0*
> >  *AND
> > *
> > Message *Type *value *start with* :*card.event*
> >
> > I want achieve this using camel routing java DSL.
> >
> > Please help me.How can i use AND,OR and regular expression in camel
> routing
> >
> > *Regards*
> > Prabu.N
> >
> >
> > On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] <
> > [hidden email]> wrote:
> >
> >> Hi Claus,
> >>
> >> Thanks for the response - I could not see any obvious way to configure
> >> an FTP Consumer at ***runtime***,
> >> either via bean, processor or consumer template.  If you have a
> >> concrete example, that would be great to see...
> >>
> >> ...otherwise, here's the solution I came up with:
> >>
> >>
> >>     -Chris
> >>
> >>
> >>
> >>   // simulate incoming message from JMS...
> >>   from("timer:kickoff?repeatCount=1")
> >>   .to("direct:start");
> >>
> >>   // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
> >> to reconfigure
> >>   // FTP route, then start it...
> >>   from("direct:start")
> >>   .beanRef("configRdr") // config reader bean not shown here
> >>   .convertBodyTo(Document.class)
> >>   // sets a bunch of headers from DOM, e.g.:
> >>
> >>
> .setHeader("ftp-config.host").xquery("//remote[remoteId/@value='CBOE34']/server/@value",
> >>
> >> String.class)
> >>   .setHeader("ftp-route-id", constant("ftp.route"))
> >>   .beanRef("ftpConfigurer");
> >>
> >>   // FTP route will only be started by FtpConfigurer bean after it's
> >> dynamically re-configured...
> >>   from("ftp://bogushost/bogusdir?startScheduler=false") // the  URI
> >> will be reconfigured...
> >>   .routeId("ftp.route").noAutoStartup()
> >>   .log("Received file ${file:onlyname}")
> >>   .to("file:/tmp/local/data");
> >>
> >>   public class FtpConfigurer {
> >>     public void configureFtpConsumer(Exchange exchange) throws Exception
> >> {
> >>         CamelContext context = exchange.getContext();
> >>         Map<String, Object> headers = exchange.getIn().getHeaders();
> >>         Map<String, Object> parameters = new HashMap<String, Object>();
> >>
> >>         // Filter headers for ftp-config specific headers...
> >>         for (Map.Entry<String, Object> entry : headers.entrySet()) {
> >>             String key = entry.getKey();
> >>             if (key.startsWith("ftp-config."))
> >>                 parameters.put(key.substring("ftp-config.".length()),
> >> entry.getValue());
> >>         }
> >>
> >>         String routeId = exchange.getIn().getHeader("ftp-route-id",
> >> String.class);
> >>         Route ftpRoute = context.getRoute(routeId);
> >>         FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
> >>         FtpEndpoint<FTPFile> rfe = (FtpEndpoint<FTPFile>)
> >> c.getEndpoint();
> >>         FtpConfiguration rfc = rfe.getConfiguration();
> >>
> >>         // Need to crack open FtpConsumer's "endpointPath" field since
> >>         // there's no mutator (setter)
> >>         Class<?> cls = c.getClass();
> >>         Field endpointPath_fld = cls.getDeclaredField("endpointPath");
> >>         endpointPath_fld.setAccessible(true);
> >>         endpointPath_fld.set(c, (String)parameters.get("directory"));
> >>
> >>         // Need to crack open FtpEndpoint, actually DefaultEndpoint -
> >> the ultimate base class
> >>         // since there's no mutator (setter) for the "endpointUri" field
> >>         cls = rfe.getClass();
> >>         Field endpointUri_fld = null;
> >>         while (endpointUri_fld == null) {
> >>             // TODO: maybe change logic to just stop at
> >> class=DefaultEndpoint
> >>             // rather then using NoSuchFieldException
> >>             try {
> >>                 endpointUri_fld = cls.getDeclaredField("endpointUri");
> >>             } catch (NoSuchFieldException nsfe) {
> >>                 cls = cls.getSuperclass();
> >>             }
> >>         }
> >>         endpointUri_fld.setAccessible(true);
> >>         endpointUri_fld.set(rfe,
> >>             String.format("ftp://%s/%s",
> >> (String)parameters.get("host"), (String)parameters.get("directory")));
> >>
> >>         // set reference properties first as they use # syntax that
> >> fools the regular properties setter
> >>         EndpointHelper.setReferenceProperties(context, rfc, parameters);
> >>         EndpointHelper.setProperties(context, rfc, parameters);
> >>         EndpointHelper.setReferenceProperties(context, rfe, parameters);
> >>         EndpointHelper.setProperties(context, rfe, parameters);
> >>         c.setStartScheduler(true);
> >>
> >>         context.startRoute(routeId);
> >>   }
> >> }
> >>
> >> On Mon, Apr 1, 2013 at 4:32 AM, Claus Ibsen <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=0>>
> >> wrote:
> >>
> >> > Hi
> >> >
> >> > See this EIP
> >> > http://camel.apache.org/content-enricher.html
> >> >
> >> > About pollEnrich.
> >> >
> >> > Though pollEnrich currently does support dynamic uris. Its on the
> >> roadmap,
> >> > for Camel 3.0.
> >> > It requires an API change and thus isn't so easy to implement
> currently
> >> on
> >> > 2.x.
> >> >
> >> > You can always use a java bean / camel processor, and consume the ftp
> >> file
> >> > from java code.
> >> > For example using consumer template.
> >> >
> >> > As you use FTP you may want to set disconnect=true so the connect is
> >> not
> >> > remained open after usage.
> >> >
> >> >
> >> >
> >> > On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=1>>
> >> wrote:
> >> >
> >> >> Ok, I'm starting to get it - a little bit.  As for my concrete
> >> >> example, so far, I have:
> >> >>
> >> >>                 from("direct:start")
> >> >>                 .beanRef("config")
> >> >>                 .convertBodyTo(Document.class)
> >> >>                 .recipientList().xquery(
> >> >>                     "concat('ftp://'" +
> >> >>
> >> ",//remote[vendorId/@value='CBOE34']/server/@value" +
> >> >>
> >> >>
> >> >>
> >>
> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
> >>
> >> >> +
> >> >>                     ",'?noop=true&amp;username='" +
> >> >>
> >> ",//remote[vendorId/@value='CBOE34']/username/@value" +
> >> >>                     ",'&amp;password='" +
> >> >>
> >> >> ",//remote[vendorId/@value='CBOE34']/password/@value)",
> String.class);
> >> >>
> >> >> Here's the problem - this will create an FTP Producer - that's not
> >> >> what I need.  I need a dynamically
> >> >> constructed URI for a polling FTP consumer.  I don't think
> >> >> "recipientList" will work...   Any ideas?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Chris
> >> >>
> >> >> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=2>>
> >> wrote:
> >> >> > Hi Claus,
> >> >> >
> >> >> > I hate to ask this - but I still don't get it.  I thought
> >> >> > "recipientList" was for sending to multiple, runtime-defined
> >> >> > recipients.  I don't see how this
> >> >> > answers the question of sending to one, single recipient, whose URI
> >> is
> >> >> > dynamically constructed - and in my use-case the dynamic settings
> >> >> > are not in properties - so "simple" (property place-holders) won't
> >> help
> >> >> me.
> >> >> >
> >> >> > Let me give you a concrete example.  I need to do an ftp download
> >> and
> >> >> > the connection information comes from up-stream in the route in the
> >> >> > form of XML (DOM - a Document instance).  Currently, I am trying to
> >> do
> >> >> > this with bean binding and method params decorated with @XPath
> >> >> > pointing into the Document with the ftp settings and inside the
> >> >> > this method doing:
> >> >> >
> >> >> > FtpComponent ftpComponent = context.getComponent("ftp",
> >> >> FtpComponent.class);
> >> >> >
> >> >> > ..and then attempt to get the endpoint and call
> createConsumer(...).
> >> >> > I'm sure this is not the right way to do it, but I don't see how
> >> else
> >> >> > - any ideas?
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> >
> >> >> > Chris
> >> >> >
> >> >> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=3>>
> >>
> >> >> wrote:
> >> >> >> Hi
> >> >> >>
> >> >> >> See this FAQ
> >> >> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=4>
> >> >> >> <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=5>>wrote:
> >>
> >> >> >>
> >> >> >>> Thanks Walzer..
> >> >> >>> *
> >> >> >>> *
> >> >> >>> *Queston1:
> >> >> >>>
> >> >> >>> *
> >> >> >>> *Example*
> >> >> >>>
> >> >> >>> .when(header("foo").isEqualTo("bar"))
> >> >> >>>                     .to("direct:b")
> >> >> >>>
> >> >> >>> In my case i have to add more than 80 condition and forwards to
> 80
> >> >> >>> different queues.
> >> >> >>>
> >> >> >>> Above example i can only hard-code queue name,But what i want is
> >> below.
> >> >> >>>
> >> >> >>> * .when(header("Type").isNotNull())
> >> >> >>>     .to("activemq.Inbound."+header("Type"))
> >> >> >>> *
> >> >> >>>
> >> >> >>> Example:If queue type is test,It should forward to *Inbound.test*
> >> >> queue.
> >> >> >>>
> >> >> >>> Above example i tried,but it did not worked,created queue
> >> something
> >> >> >>> like this *Inbound.header("type")*
> >> >> >>>
> >> >> >>> *Question2*:
> >> >> >>>
> >> >> >>> from("direct:a")
> >> >> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
> >> >> >>>
> >> >> >>> Based on messages header and content type i want forward to
> >> different
> >> >> >>> queue.
> >> >> >>>
> >> >> >>> condition will be *OR *and *AND*.How can i do that like above
> >> example.*
> >> >> >>> *
> >> >> >>>
> >> >> >>> Thanks in advance*
> >> >> >>> *
> >> >> >>>
> >> >> >>> *Regards*
> >> >> >>>
> >> >> >>> Prabu.N
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
> >> >> >>> [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=6>>
> >> wrote:
> >> >> >>>
> >> >> >>> > Hi,
> >> >> >>> >
> >> >> >>> > you could start by reading Claus´ book (p. 44ff) which has a
> >> perfect
> >> >> >>> > example or http://camel.apache.org/content-based-router.html(just
> >>
> >> >> >>> > replace the direct: with your queues).
> >> >> >>> > If you need to fire your messages to multiple queues:
> >> >> >>> > http://camel.apache.org/publish-subscribe-channel.html shows
> >> you the
> >> >> >>> > various ways.
> >> >> >>> > When you get the concepts you can just "lego" them together.
> >> >> >>> >
> >> >> >>> > Regards, Thomas.
> >> >> >>> >
> >> >> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
> >> >> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
> >> >> >>> > <[hidden email] <
> >> >> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
> >> >> >>> >
> >> >> >>> > > Hi Claus,
> >> >> >>> > >
> >> >> >>> > > Thanks so much Clus for help.It is working now.
> >> >> >>> > >
> >> >> >>> > > I need your guidance for the following requirement.
> >> >> >>> > >
> >> >> >>> > > 1.I have one *inbound queue* it will receive message
> >> frequently
> >> >> from my
> >> >> >>> > > application.
> >> >> >>> > > 2.From *inbound queue* i need camel routing to move message
> >> from
> >> >> >>> > > another *message
> >> >> >>> > > based inbound queue* based on message header value.
> >> >> >>> > > 3.From *message based inbound queue *i* *need camel routing
> to
> >> move
> >> >> >>> > message
> >> >> >>> > > to *one or more outbound queue *based on message content*
> >> >> >>> > > *
> >> >> >>> > >
> >> >> >>> > > I need *camel java DSL*sample code for above requirement.*
> >> >> >>> > > *
> >> >> >>> > > *
> >> >> >>> > > *
> >> >> >>> > > *Thanks in advance*
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
> >> >> >>> > > [hidden email] <
> >> >> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
> >> >> >>> > wrote:
> >> >> >>> > >
> >> >> >>> > >> Hi
> >> >> >>> > >>
> >> >> >>> > >> Do as the exception tells you. Check route 2. You route from
> >> >> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
> >> >> >>> > >>
> >> >> >>> > >> Maybe you need to add "activemq:" as prefix so its
> >> >> >>> > >> "activemq:Inbound.SSS.TestEvent".
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
> >> >> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
> >> >> >>> > >> <[hidden email] <
> >> >> http://user/SendEmail.jtp?type=node&node=5730109&i=1
> >> >> >>> >>
> >> >> >>> >
> >> >> >>> > >> wrote:
> >> >> >>> > >>
> >> >> >>> > >>>
> >> >> >>> > >>> I have activemmq  Project in that i have following
> >> requirement
> >> >> >>> > >>>
> >> >> >>> > >>> 1.Move message from Inbound queue to type based inbound
> >> queue.
> >> >> >>> > >>> 2.Move message from Message type inbound queue to outbound
> >> queue
> >> >> >>> > >>>
> >> >> >>> > >>> I have created two bean for to achieve this.
> >> >> >>> > >>>
> >> >> >>> > >>> 1.one for move from inbound to message type  inbound queue
> >> >> >>> > >>> 2.one for move from inbound to outbound queue.
> >> >> >>> > >>>
> >> >> >>> > >>> I have following entry in camel.xml
> >> >> >>> > >>>
> >> >> >>> > >>>   <camelContext id="camel" xmlns="
> >> >> >>> > http://camel.apache.org/schema/spring">
> >> >> >>> > >>
> >> >> >>> > >>>
> >> >> >>> > >>>                <routeBuilder ref="routeBuilder" />
> >> >> >>> > >>>            <routeBuilder ref="routeBuilder1" />
> >> >> >>> > >>>
> >> >> >>> > >>>    </camelContext>
> >> >> >>> > >>>
> >> >> >>> > >>>    <bean id="routeBuilder"
> >> >> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
> >> >> >>> > >>>    <bean id="recipientsGenerator"
> >> >> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
> >> >> >>> > >>>    <bean id="routeBuilder1"
> >> >> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
> >> >> >>> > >>>    <bean id="recipientsGenerator1"
> >> >> >>> > >>> class="com.camel.routes.RecipientListBean"/>
> >> >> >>> > >>>
> >> >> >>> > >>> When i run application i am getting following error.
> >> >> >>> > >>>
> >> >> >>> > >>> * java.lang.Exception:
> >> org.apache.camel.RuntimeCamelException:
> >> >> >>> > >>> org.apache.camel.Fa
> >> >> >>> > >>> iledToCreateRouteException: Failed to create route route2:
> >> >> >>> > >>> Route[[From[Inbound.G
> >> >> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No
> >> endpoint
> >> >> >>> > could
> >> >> >>> > >> be
> >> >> >>> > >>> found
> >> >> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath
> >> contains
> >> >> the
> >> >> >>> > >> needed
> >> >> >>> > >>> Cam
> >> >> >>> > >>> el component jar.*
> >> >> >>> > >>>
> >> >> >>> > >>> I am not sure i am missing any configuration,Please kindly
> >> help
> >> >> me
> >> >> >>> > >>>
> >> >> >>> > >>>
> >> >> >>> > >>>
> >> >> >>> > >>>
> >> >> >>> > >>> --
> >> >> >>> > >>> View this message in context:
> >> >> >>> > >>
> >> >> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> >> >> >>> > >>> Sent from the Camel - Users mailing list archive at
> >> Nabble.com.
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> > >> --
> >> >> >>> > >> Claus Ibsen
> >> >> >>> > >> -----------------
> >> >> >>> > >> Red Hat, Inc.
> >> >> >>> > >> FuseSource is now part of Red Hat
> >> >> >>> > >> Email: [hidden email]<
> >> >> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
> >> >> >>> > >> Web: http://fusesource.com
> >> >> >>> > >> Twitter: davsclaus
> >> >> >>> > >> Blog: http://davsclaus.com
> >> >> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> > >> ------------------------------
> >> >> >>> > >> If you reply to this email, your message will be added to
> the
> >> >> >>> > discussion
> >> >> >>> > >> below:
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> >
> >> >> >>> > >> .
> >> >> >>> > >> NAML<
> >> >> >>> >
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >> >> >>> >
> >> >> >>> >
> >> >> >>> > >>
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > > --
> >> >> >>> > > Thanks & Regards
> >> >> >>> > > Prabu.N
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > > --
> >> >> >>> > > View this message in context:
> >> >> >>> >
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
> >> >> >>> >
> >> >> >>> > > Sent from the Camel - Users mailing list archive at
> >> Nabble.com.
> >> >> >>> >
> >> >> >>> >
> >> >> >>> >
> >> >> >>> > ------------------------------
> >> >> >>> >  If you reply to this email, your message will be added to the
> >> >> discussion
> >> >> >>> > below:
> >> >> >>> >
> >> >> >>> >
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
> >> >> >>> >  To unsubscribe from Camel routing issue, click here<
> >> >> >>>
> >> >> >>> >
> >> >> >>> > .
> >> >> >>> > NAML<
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >> >> >>> >
> >> >> >>> >
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> --
> >> >> >>> Thanks & Regards
> >> >> >>>  Prabu.N
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> --
> >> >> >>> View this message in context:
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
> >> >> >>> Sent from the Camel - Users mailing list archive at Nabble.com.
> >> >> >>>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> Claus Ibsen
> >> >> >> -----------------
> >> >> >> Red Hat, Inc.
> >> >> >> FuseSource is now part of Red Hat
> >> >> >> Email: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=7>
> >> >> >> Web: http://fusesource.com
> >> >> >> Twitter: davsclaus
> >> >> >> Blog: http://davsclaus.com
> >> >> >> Author of Camel in Action: http://www.manning.com/ibsen
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Claus Ibsen
> >> > -----------------
> >> > Red Hat, Inc.
> >> > FuseSource is now part of Red Hat
> >> > Email: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=8>
> >> > Web: http://fusesource.com
> >> > Twitter: davsclaus
> >> > Blog: http://davsclaus.com
> >> > Author of Camel in Action: http://www.manning.com/ibsen
> >>
> >>
> >> ------------------------------
> >>  If you reply to this email, your message will be added to the
> >> discussion below:
> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730166.html
> >>  To unsubscribe from Camel routing issue, click here<
> >
> >> .
> >> NAML<
>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >>
> >
> >
> >
> > --
> > Thanks & Regards
> >  Prabu.N
> >
>
>
>
> --
> Thanks & Regards
>  Prabu.N
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730194.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

prabumca06@gmail.com
So can i use like this..

Predicate god = PredicateBuilder.and(admin,PredicateBuilder.or(body().contains("Camel Rider"), header("type").isEqualTo("god")));


On Tue, Apr 2, 2013 at 2:05 PM, Claus Ibsen-2 [via Camel] <[hidden email]> wrote:
Hi

You should static import those methods: and, or
on the class org.apache.camel.builder.PredicateBuilder
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/builder/PredicateBuilder.html



On Tue, Apr 2, 2013 at 10:17 AM, [hidden email]
<[hidden email]>wrote:

> I have found solution in internet using Predicate  we can achieve this,
>
> But,one doubt in the link
> http://camel.apache.org/predicate.html,Theymentioned that we can use
> AND and OR in Predicate
>
> I have added below code in project,But i am getting compilation
> error.Please kindly help
>
> *Predicate god = and(admin, or(body().contains("Camel Rider"),

> header("type").isEqualTo("god")));*
>
> *Thanks*
> Prabu.N
>
>
> On Mon, Apr 1, 2013 at 9:05 PM, Prabu <[hidden email]> wrote:
>
> > Hi *Chris / **Claus*,
> >
> > I have one *Inbound* queue,based on header and content type,I want
> > forward to outbound queue.
> > *
> > Example 1:
> > *
> > *
> > Inbound.queue name : **Inbound.Test.DDD
> > Outbound.queue name : SOURHQueueName
> >
> > *
> > *Criteria or Condition :
> > *
> > Message property *PAST_EVENT_INTERVAL type* is : *0*
> >    *AND*
> > Message *Type* value is : *card.test *or* card.expiry.test*
> >
> > *Example 2:*
> >
> > *Inbound.queue name : **Inbound.Test.SSS
> > Outbound.queue name : WESTQueueName
> > *
> > *Criteria or Condition :*
> > Message property *PAST_EVENT_INTERVAL type* is : *0*
> >  *AND
> > *
> > Message *Type *value *start with* :*card.event*
> >
> > I want achieve this using camel routing java DSL.
> >
> > Please help me.How can i use AND,OR and regular expression in camel
> routing
> >
> > *Regards*
> > Prabu.N
> >
> >
> > On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] <
> > [hidden email]> wrote:
> >
> >> Hi Claus,
> >>
> >> Thanks for the response - I could not see any obvious way to configure

> >> an FTP Consumer at ***runtime***,
> >> either via bean, processor or consumer template.  If you have a
> >> concrete example, that would be great to see...
> >>
> >> ...otherwise, here's the solution I came up with:
> >>
> >>
> >>     -Chris
> >>
> >>
> >>
> >>   // simulate incoming message from JMS...
> >>   from("timer:kickoff?repeatCount=1")
> >>   .to("direct:start");
> >>
> >>   // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
> >> to reconfigure
> >>   // FTP route, then start it...
> >>   from("direct:start")
> >>   .beanRef("configRdr") // config reader bean not shown here
> >>   .convertBodyTo(Document.class)
> >>   // sets a bunch of headers from DOM, e.g.:
> >>
> >>
> .setHeader("ftp-config.host").xquery("//remote[remoteId/@value='CBOE34']/server/@value",
> >>
> >> String.class)
> >>   .setHeader("ftp-route-id", constant("ftp.route"))
> >>   .beanRef("ftpConfigurer");
> >>
> >>   // FTP route will only be started by FtpConfigurer bean after it's
> >> dynamically re-configured...
> >>   from("ftp://bogushost/bogusdir?startScheduler=false") // the  URI
> >> will be reconfigured...
> >>   .routeId("ftp.route").noAutoStartup()
> >>   .log("Received file ${file:onlyname}")
> >>   .to("file:/tmp/local/data");
> >>
> >>   public class FtpConfigurer {
> >>     public void configureFtpConsumer(Exchange exchange) throws Exception
> >> {
> >>         CamelContext context = exchange.getContext();
> >>         Map<String, Object> headers = exchange.getIn().getHeaders();
> >>         Map<String, Object> parameters = new HashMap<String, Object>();
> >>
> >>         // Filter headers for ftp-config specific headers...
> >>         for (Map.Entry<String, Object> entry : headers.entrySet()) {
> >>             String key = entry.getKey();
> >>             if (key.startsWith("ftp-config."))
> >>                 parameters.put(key.substring("ftp-config.".length()),
> >> entry.getValue());
> >>         }
> >>
> >>         String routeId = exchange.getIn().getHeader("ftp-route-id",
> >> String.class);
> >>         Route ftpRoute = context.getRoute(routeId);
> >>         FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
> >>         FtpEndpoint<FTPFile> rfe = (FtpEndpoint<FTPFile>)
> >> c.getEndpoint();
> >>         FtpConfiguration rfc = rfe.getConfiguration();
> >>
> >>         // Need to crack open FtpConsumer's "endpointPath" field since
> >>         // there's no mutator (setter)
> >>         Class<?> cls = c.getClass();
> >>         Field endpointPath_fld = cls.getDeclaredField("endpointPath");
> >>         endpointPath_fld.setAccessible(true);
> >>         endpointPath_fld.set(c, (String)parameters.get("directory"));
> >>
> >>         // Need to crack open FtpEndpoint, actually DefaultEndpoint -
> >> the ultimate base class
> >>         // since there's no mutator (setter) for the "endpointUri" field
> >>         cls = rfe.getClass();
> >>         Field endpointUri_fld = null;
> >>         while (endpointUri_fld == null) {
> >>             // TODO: maybe change logic to just stop at
> >> class=DefaultEndpoint
> >>             // rather then using NoSuchFieldException
> >>             try {
> >>                 endpointUri_fld = cls.getDeclaredField("endpointUri");
> >>             } catch (NoSuchFieldException nsfe) {
> >>                 cls = cls.getSuperclass();
> >>             }
> >>         }
> >>         endpointUri_fld.setAccessible(true);
> >>         endpointUri_fld.set(rfe,
> >>             String.format("ftp://%s/%s",
> >> (String)parameters.get("host"), (String)parameters.get("directory")));
> >>
> >>         // set reference properties first as they use # syntax that
> >> fools the regular properties setter
> >>         EndpointHelper.setReferenceProperties(context, rfc, parameters);
> >>         EndpointHelper.setProperties(context, rfc, parameters);
> >>         EndpointHelper.setReferenceProperties(context, rfe, parameters);
> >>         EndpointHelper.setProperties(context, rfe, parameters);
> >>         c.setStartScheduler(true);
> >>
> >>         context.startRoute(routeId);
> >>   }
> >> }
> >>
> >> On Mon, Apr 1, 2013 at 4:32 AM, Claus Ibsen <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=0>>
> >> wrote:

> >>
> >> > Hi
> >> >
> >> > See this EIP
> >> > http://camel.apache.org/content-enricher.html
> >> >
> >> > About pollEnrich.
> >> >
> >> > Though pollEnrich currently does support dynamic uris. Its on the
> >> roadmap,
> >> > for Camel 3.0.
> >> > It requires an API change and thus isn't so easy to implement
> currently
> >> on
> >> > 2.x.
> >> >
> >> > You can always use a java bean / camel processor, and consume the ftp
> >> file
> >> > from java code.
> >> > For example using consumer template.
> >> >
> >> > As you use FTP you may want to set disconnect=true so the connect is
> >> not
> >> > remained open after usage.
> >> >
> >> >
> >> >
> >> > On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=1>>
> >> wrote:

> >> >
> >> >> Ok, I'm starting to get it - a little bit.  As for my concrete
> >> >> example, so far, I have:
> >> >>
> >> >>                 from("direct:start")
> >> >>                 .beanRef("config")
> >> >>                 .convertBodyTo(Document.class)
> >> >>                 .recipientList().xquery(
> >> >>                     "concat('ftp://'" +
> >> >>
> >> ",//remote[vendorId/@value='CBOE34']/server/@value" +
> >> >>
> >> >>
> >> >>
> >>
> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
> >>
> >> >> +
> >> >>                     ",'?noop=true&amp;username='" +
> >> >>
> >> ",//remote[vendorId/@value='CBOE34']/username/@value" +
> >> >>                     ",'&amp;password='" +
> >> >>
> >> >> ",//remote[vendorId/@value='CBOE34']/password/@value)",
> String.class);
> >> >>
> >> >> Here's the problem - this will create an FTP Producer - that's not
> >> >> what I need.  I need a dynamically
> >> >> constructed URI for a polling FTP consumer.  I don't think
> >> >> "recipientList" will work...   Any ideas?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Chris
> >> >>
> >> >> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=2>>
> >> wrote:

> >> >> > Hi Claus,
> >> >> >
> >> >> > I hate to ask this - but I still don't get it.  I thought
> >> >> > "recipientList" was for sending to multiple, runtime-defined
> >> >> > recipients.  I don't see how this
> >> >> > answers the question of sending to one, single recipient, whose URI
> >> is
> >> >> > dynamically constructed - and in my use-case the dynamic settings
> >> >> > are not in properties - so "simple" (property place-holders) won't
> >> help
> >> >> me.
> >> >> >
> >> >> > Let me give you a concrete example.  I need to do an ftp download
> >> and
> >> >> > the connection information comes from up-stream in the route in the
> >> >> > form of XML (DOM - a Document instance).  Currently, I am trying to
> >> do
> >> >> > this with bean binding and method params decorated with @XPath
> >> >> > pointing into the Document with the ftp settings and inside the
> >> >> > this method doing:
> >> >> >
> >> >> > FtpComponent ftpComponent = context.getComponent("ftp",
> >> >> FtpComponent.class);
> >> >> >
> >> >> > ..and then attempt to get the endpoint and call
> createConsumer(...).
> >> >> > I'm sure this is not the right way to do it, but I don't see how
> >> else
> >> >> > - any ideas?
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> >
> >> >> > Chris
> >> >> >
> >> >> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=3>>
> >>
> >> >> wrote:
> >> >> >> Hi
> >> >> >>
> >> >> >> See this FAQ
> >> >> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=4>
> >> >> >> <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=5>>wrote:
> >>

> >> >> >>
> >> >> >>> Thanks Walzer..
> >> >> >>> *
> >> >> >>> *
> >> >> >>> *Queston1:
> >> >> >>>
> >> >> >>> *
> >> >> >>> *Example*
> >> >> >>>
> >> >> >>> .when(header("foo").isEqualTo("bar"))
> >> >> >>>                     .to("direct:b")
> >> >> >>>
> >> >> >>> In my case i have to add more than 80 condition and forwards to
> 80
> >> >> >>> different queues.
> >> >> >>>
> >> >> >>> Above example i can only hard-code queue name,But what i want is
> >> below.
> >> >> >>>
> >> >> >>> * .when(header("Type").isNotNull())
> >> >> >>>     .to("activemq.Inbound."+header("Type"))
> >> >> >>> *
> >> >> >>>
> >> >> >>> Example:If queue type is test,It should forward to *Inbound.test*
> >> >> queue.
> >> >> >>>
> >> >> >>> Above example i tried,but it did not worked,created queue
> >> something
> >> >> >>> like this *Inbound.header("type")*
> >> >> >>>
> >> >> >>> *Question2*:
> >> >> >>>
> >> >> >>> from("direct:a")
> >> >> >>>             .multicast().to("direct:b", "direct:c", "direct:d");
> >> >> >>>
> >> >> >>> Based on messages header and content type i want forward to
> >> different
> >> >> >>> queue.
> >> >> >>>
> >> >> >>> condition will be *OR *and *AND*.How can i do that like above
> >> example.*
> >> >> >>> *
> >> >> >>>
> >> >> >>> Thanks in advance*
> >> >> >>> *
> >> >> >>>
> >> >> >>> *Regards*
> >> >> >>>
> >> >> >>> Prabu.N
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
> >> >> >>> [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=6>>
> >> wrote:
> >> >> >>>
> >> >> >>> > Hi,
> >> >> >>> >
> >> >> >>> > you could start by reading Claus´ book (p. 44ff) which has a
> >> perfect
> >> >> >>> > example or http://camel.apache.org/content-based-router.html(just
> >>

> >> >> >>> > replace the direct: with your queues).
> >> >> >>> > If you need to fire your messages to multiple queues:
> >> >> >>> > http://camel.apache.org/publish-subscribe-channel.html shows
> >> you the
> >> >> >>> > various ways.
> >> >> >>> > When you get the concepts you can just "lego" them together.
> >> >> >>> >
> >> >> >>> > Regards, Thomas.
> >> >> >>> >
> >> >> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
> >> >> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
> >> >> >>> > <[hidden email] <
> >> >> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
> >> >> >>> >
> >> >> >>> > > Hi Claus,
> >> >> >>> > >
> >> >> >>> > > Thanks so much Clus for help.It is working now.
> >> >> >>> > >
> >> >> >>> > > I need your guidance for the following requirement.
> >> >> >>> > >
> >> >> >>> > > 1.I have one *inbound queue* it will receive message
> >> frequently
> >> >> from my
> >> >> >>> > > application.
> >> >> >>> > > 2.From *inbound queue* i need camel routing to move message
> >> from
> >> >> >>> > > another *message
> >> >> >>> > > based inbound queue* based on message header value.
> >> >> >>> > > 3.From *message based inbound queue *i* *need camel routing
> to
> >> move
> >> >> >>> > message
> >> >> >>> > > to *one or more outbound queue *based on message content*
> >> >> >>> > > *
> >> >> >>> > >
> >> >> >>> > > I need *camel java DSL*sample code for above requirement.*
> >> >> >>> > > *
> >> >> >>> > > *
> >> >> >>> > > *
> >> >> >>> > > *Thanks in advance*
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via Camel] <
> >> >> >>> > > [hidden email] <
> >> >> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
> >> >> >>> > wrote:
> >> >> >>> > >
> >> >> >>> > >> Hi
> >> >> >>> > >>
> >> >> >>> > >> Do as the exception tells you. Check route 2. You route from
> >> >> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
> >> >> >>> > >>
> >> >> >>> > >> Maybe you need to add "activemq:" as prefix so its
> >> >> >>> > >> "activemq:Inbound.SSS.TestEvent".
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
> >> >> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
> >> >> >>> > >> <[hidden email] <
> >> >> http://user/SendEmail.jtp?type=node&node=5730109&i=1
> >> >> >>> >>
> >> >> >>> >
> >> >> >>> > >> wrote:
> >> >> >>> > >>
> >> >> >>> > >>>
> >> >> >>> > >>> I have activemmq  Project in that i have following
> >> requirement
> >> >> >>> > >>>
> >> >> >>> > >>> 1.Move message from Inbound queue to type based inbound
> >> queue.
> >> >> >>> > >>> 2.Move message from Message type inbound queue to outbound
> >> queue
> >> >> >>> > >>>
> >> >> >>> > >>> I have created two bean for to achieve this.
> >> >> >>> > >>>
> >> >> >>> > >>> 1.one for move from inbound to message type  inbound queue
> >> >> >>> > >>> 2.one for move from inbound to outbound queue.
> >> >> >>> > >>>
> >> >> >>> > >>> I have following entry in camel.xml
> >> >> >>> > >>>
> >> >> >>> > >>>   <camelContext id="camel" xmlns="
> >> >> >>> > http://camel.apache.org/schema/spring">
> >> >> >>> > >>
> >> >> >>> > >>>
> >> >> >>> > >>>                <routeBuilder ref="routeBuilder" />
> >> >> >>> > >>>            <routeBuilder ref="routeBuilder1" />
> >> >> >>> > >>>
> >> >> >>> > >>>    </camelContext>
> >> >> >>> > >>>
> >> >> >>> > >>>    <bean id="routeBuilder"
> >> >> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
> >> >> >>> > >>>    <bean id="recipientsGenerator"
> >> >> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
> >> >> >>> > >>>    <bean id="routeBuilder1"
> >> >> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
> >> >> >>> > >>>    <bean id="recipientsGenerator1"
> >> >> >>> > >>> class="com.camel.routes.RecipientListBean"/>
> >> >> >>> > >>>
> >> >> >>> > >>> When i run application i am getting following error.
> >> >> >>> > >>>
> >> >> >>> > >>> * java.lang.Exception:
> >> org.apache.camel.RuntimeCamelException:
> >> >> >>> > >>> org.apache.camel.Fa
> >> >> >>> > >>> iledToCreateRouteException: Failed to create route route2:
> >> >> >>> > >>> Route[[From[Inbound.G
> >> >> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of No
> >> endpoint
> >> >> >>> > could
> >> >> >>> > >> be
> >> >> >>> > >>> found
> >> >> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath
> >> contains
> >> >> the
> >> >> >>> > >> needed
> >> >> >>> > >>> Cam
> >> >> >>> > >>> el component jar.*
> >> >> >>> > >>>
> >> >> >>> > >>> I am not sure i am missing any configuration,Please kindly
> >> help
> >> >> me
> >> >> >>> > >>>
> >> >> >>> > >>>
> >> >> >>> > >>>
> >> >> >>> > >>>
> >> >> >>> > >>> --
> >> >> >>> > >>> View this message in context:
> >> >> >>> > >>
> >> >> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> >> >> >>> > >>> Sent from the Camel - Users mailing list archive at

> >> Nabble.com.
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> > >> --
> >> >> >>> > >> Claus Ibsen
> >> >> >>> > >> -----------------
> >> >> >>> > >> Red Hat, Inc.
> >> >> >>> > >> FuseSource is now part of Red Hat
> >> >> >>> > >> Email: [hidden email]<
> >> >> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
> >> >> >>> > >> Web: http://fusesource.com
> >> >> >>> > >> Twitter: davsclaus
> >> >> >>> > >> Blog: http://davsclaus.com
> >> >> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
> >> >> >>> > >>

> >> >> >>> > >>
> >> >> >>> > >> ------------------------------
> >> >> >>> > >> If you reply to this email, your message will be added to
> the
> >> >> >>> > discussion
> >> >> >>> > >> below:
> >> >> >>> > >>
> >> >> >>> > >>
> >> >> >>> >
> >> >> >>> > >> .
> >> >> >>> > >> NAML<
> >> >> >>> >
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >> >> >>> >

> >> >> >>> >
> >> >> >>> > >>
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > > --
> >> >> >>> > > Thanks & Regards
> >> >> >>> > > Prabu.N
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > >
> >> >> >>> > > --
> >> >> >>> > > View this message in context:
> >> >> >>> >
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
> >> >> >>> >

> >> >> >>> > > Sent from the Camel - Users mailing list archive at
> >> Nabble.com.
> >> >> >>> >
> >> >> >>> >
> >> >> >>> >
> >> >> >>> > ------------------------------
> >> >> >>> >  If you reply to this email, your message will be added to the
> >> >> discussion
> >> >> >>> > below:
> >> >> >>> >
> >> >> >>> >
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
> >> >> >>> >  To unsubscribe from Camel routing issue, click here<
> >> >> >>>
> >> >> >>> >
> >> >> >>> > .
> >> >> >>> > NAML<
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >> >> >>> >

> >> >> >>> >
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> --
> >> >> >>> Thanks & Regards
> >> >> >>>  Prabu.N
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> --
> >> >> >>> View this message in context:
> >> >> >>>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
> >> >> >>> Sent from the Camel - Users mailing list archive at Nabble.com.

> >> >> >>>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> Claus Ibsen
> >> >> >> -----------------
> >> >> >> Red Hat, Inc.
> >> >> >> FuseSource is now part of Red Hat
> >> >> >> Email: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=7>
> >> >> >> Web: http://fusesource.com
> >> >> >> Twitter: davsclaus
> >> >> >> Blog: http://davsclaus.com
> >> >> >> Author of Camel in Action: http://www.manning.com/ibsen
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Claus Ibsen
> >> > -----------------
> >> > Red Hat, Inc.
> >> > FuseSource is now part of Red Hat
> >> > Email: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730166&i=8>
> >> > Web: http://fusesource.com
> >> > Twitter: davsclaus
> >> > Blog: http://davsclaus.com
> >> > Author of Camel in Action: http://www.manning.com/ibsen
> >>
> >>
> >> ------------------------------
> >>  If you reply to this email, your message will be added to the
> >> discussion below:
> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730166.html

> >>  To unsubscribe from Camel routing issue, click here<
>
>
> Thanks & Regards
>  Prabu.N
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730194.html

> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen



If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730195.html
To unsubscribe from Camel routing issue, click here.
NAML



--
Thanks & Regards
 Prabu.N
Reply | Threaded
Open this post in threaded view
|

Re: Camel routing issue

Claus Ibsen-2
Yeah or jus static import those methods to make it easier to read

import static org.apache.camel.builder.PredicateBuilder.and;
import static org.apache.camel.builder.PredicateBuilder.or;



On Tue, Apr 2, 2013 at 10:38 AM, [hidden email]
<[hidden email]>wrote:

> So can i use like this..
>
> Predicate god =
> PredicateBuilder.and(admin,PredicateBuilder.or(body().contains("Camel
> Rider"), header("type").isEqualTo("god")));
>
>
> On Tue, Apr 2, 2013 at 2:05 PM, Claus Ibsen-2 [via Camel] <
> [hidden email]> wrote:
>
> > Hi
> >
> > You should static import those methods: and, or
> > on the class org.apache.camel.builder.PredicateBuilder
> >
> >
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/builder/PredicateBuilder.html
> >
> >
> >
> > On Tue, Apr 2, 2013 at 10:17 AM, [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730195&i=0>
> > <[hidden email] <http://user/SendEmail.jtp?type=node&node=5730195&i=1
> >>wrote:
> >
> >
> > > I have found solution in internet using Predicate  we can achieve this,
> > >
> > > But,one doubt in the link
> > > http://camel.apache.org/predicate.html,Theymentioned that we can use
> > > AND and OR in Predicate
> > >
> > > I have added below code in project,But i am getting compilation
> > > error.Please kindly help
> > >
> > > *Predicate god = and(admin, or(body().contains("Camel Rider"),
> > > header("type").isEqualTo("god")));*
> > >
> > > *Thanks*
> > > Prabu.N
> > >
> > >
> > > On Mon, Apr 1, 2013 at 9:05 PM, Prabu <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730195&i=2>>
> > wrote:
> > >
> > > > Hi *Chris / **Claus*,
> > > >
> > > > I have one *Inbound* queue,based on header and content type,I want
> > > > forward to outbound queue.
> > > > *
> > > > Example 1:
> > > > *
> > > > *
> > > > Inbound.queue name : **Inbound.Test.DDD
> > > > Outbound.queue name : SOURHQueueName
> > > >
> > > > *
> > > > *Criteria or Condition :
> > > > *
> > > > Message property *PAST_EVENT_INTERVAL type* is : *0*
> > > >    *AND*
> > > > Message *Type* value is : *card.test *or* card.expiry.test*
> > > >
> > > > *Example 2:*
> > > >
> > > > *Inbound.queue name : **Inbound.Test.SSS
> > > > Outbound.queue name : WESTQueueName
> > > > *
> > > > *Criteria or Condition :*
> > > > Message property *PAST_EVENT_INTERVAL type* is : *0*
> > > >  *AND
> > > > *
> > > > Message *Type *value *start with* :*card.event*
> > > >
> > > > I want achieve this using camel routing java DSL.
> > > >
> > > > Please help me.How can i use AND,OR and regular expression in camel
> > > routing
> > > >
> > > > *Regards*
> > > > Prabu.N
> > > >
> > > >
> > > > On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] <
> > > > [hidden email] <http://user/SendEmail.jtp?type=node&node=5730195&i=3
> >>
> > wrote:
> > > >
> > > >> Hi Claus,
> > > >>
> > > >> Thanks for the response - I could not see any obvious way to
> > configure
> > > >> an FTP Consumer at ***runtime***,
> > > >> either via bean, processor or consumer template.  If you have a
> > > >> concrete example, that would be great to see...
> > > >>
> > > >> ...otherwise, here's the solution I came up with:
> > > >>
> > > >>
> > > >>     -Chris
> > > >>
> > > >>
> > > >>
> > > >>   // simulate incoming message from JMS...
> > > >>   from("timer:kickoff?repeatCount=1")
> > > >>   .to("direct:start");
> > > >>
> > > >>   // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
> > > >> to reconfigure
> > > >>   // FTP route, then start it...
> > > >>   from("direct:start")
> > > >>   .beanRef("configRdr") // config reader bean not shown here
> > > >>   .convertBodyTo(Document.class)
> > > >>   // sets a bunch of headers from DOM, e.g.:
> > > >>
> > > >>
> > >
> >
> .setHeader("ftp-config.host").xquery("//remote[remoteId/@value='CBOE34']/server/@value",
> >
> > > >>
> > > >> String.class)
> > > >>   .setHeader("ftp-route-id", constant("ftp.route"))
> > > >>   .beanRef("ftpConfigurer");
> > > >>
> > > >>   // FTP route will only be started by FtpConfigurer bean after it's
> > > >> dynamically re-configured...
> > > >>   from("ftp://bogushost/bogusdir?startScheduler=false") // the  URI
> > > >> will be reconfigured...
> > > >>   .routeId("ftp.route").noAutoStartup()
> > > >>   .log("Received file ${file:onlyname}")
> > > >>   .to("file:/tmp/local/data");
> > > >>
> > > >>   public class FtpConfigurer {
> > > >>     public void configureFtpConsumer(Exchange exchange) throws
> > Exception
> > > >> {
> > > >>         CamelContext context = exchange.getContext();
> > > >>         Map<String, Object> headers = exchange.getIn().getHeaders();
> > > >>         Map<String, Object> parameters = new HashMap<String,
> > Object>();
> > > >>
> > > >>         // Filter headers for ftp-config specific headers...
> > > >>         for (Map.Entry<String, Object> entry : headers.entrySet()) {
> > > >>             String key = entry.getKey();
> > > >>             if (key.startsWith("ftp-config."))
> > > >>
> parameters.put(key.substring("ftp-config.".length()),
> > > >> entry.getValue());
> > > >>         }
> > > >>
> > > >>         String routeId = exchange.getIn().getHeader("ftp-route-id",
> > > >> String.class);
> > > >>         Route ftpRoute = context.getRoute(routeId);
> > > >>         FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
> > > >>         FtpEndpoint<FTPFile> rfe = (FtpEndpoint<FTPFile>)
> > > >> c.getEndpoint();
> > > >>         FtpConfiguration rfc = rfe.getConfiguration();
> > > >>
> > > >>         // Need to crack open FtpConsumer's "endpointPath" field
> > since
> > > >>         // there's no mutator (setter)
> > > >>         Class<?> cls = c.getClass();
> > > >>         Field endpointPath_fld =
> > cls.getDeclaredField("endpointPath");
> > > >>         endpointPath_fld.setAccessible(true);
> > > >>         endpointPath_fld.set(c,
> (String)parameters.get("directory"));
> > > >>
> > > >>         // Need to crack open FtpEndpoint, actually DefaultEndpoint
> -
> > > >> the ultimate base class
> > > >>         // since there's no mutator (setter) for the "endpointUri"
> > field
> > > >>         cls = rfe.getClass();
> > > >>         Field endpointUri_fld = null;
> > > >>         while (endpointUri_fld == null) {
> > > >>             // TODO: maybe change logic to just stop at
> > > >> class=DefaultEndpoint
> > > >>             // rather then using NoSuchFieldException
> > > >>             try {
> > > >>                 endpointUri_fld =
> > cls.getDeclaredField("endpointUri");
> > > >>             } catch (NoSuchFieldException nsfe) {
> > > >>                 cls = cls.getSuperclass();
> > > >>             }
> > > >>         }
> > > >>         endpointUri_fld.setAccessible(true);
> > > >>         endpointUri_fld.set(rfe,
> > > >>             String.format("ftp://%s/%s",
> > > >> (String)parameters.get("host"),
> > (String)parameters.get("directory")));
> > > >>
> > > >>         // set reference properties first as they use # syntax that
> > > >> fools the regular properties setter
> > > >>         EndpointHelper.setReferenceProperties(context, rfc,
> > parameters);
> > > >>         EndpointHelper.setProperties(context, rfc, parameters);
> > > >>         EndpointHelper.setReferenceProperties(context, rfe,
> > parameters);
> > > >>         EndpointHelper.setProperties(context, rfe, parameters);
> > > >>         c.setStartScheduler(true);
> > > >>
> > > >>         context.startRoute(routeId);
> > > >>   }
> > > >> }
> > > >>
> > > >> On Mon, Apr 1, 2013 at 4:32 AM, Claus Ibsen <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=0>>
> > > >> wrote:
> > > >>
> > > >> > Hi
> > > >> >
> > > >> > See this EIP
> > > >> > http://camel.apache.org/content-enricher.html
> > > >> >
> > > >> > About pollEnrich.
> > > >> >
> > > >> > Though pollEnrich currently does support dynamic uris. Its on the
> > > >> roadmap,
> > > >> > for Camel 3.0.
> > > >> > It requires an API change and thus isn't so easy to implement
> > > currently
> > > >> on
> > > >> > 2.x.
> > > >> >
> > > >> > You can always use a java bean / camel processor, and consume the
> > ftp
> > > >> file
> > > >> > from java code.
> > > >> > For example using consumer template.
> > > >> >
> > > >> > As you use FTP you may want to set disconnect=true so the connect
> > is
> > > >> not
> > > >> > remained open after usage.
> > > >> >
> > > >> >
> > > >> >
> > > >> > On Sun, Mar 31, 2013 at 7:51 PM, Chris Wolf <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=1>>
> > > >> wrote:
> > > >> >
> > > >> >> Ok, I'm starting to get it - a little bit.  As for my concrete
> > > >> >> example, so far, I have:
> > > >> >>
> > > >> >>                 from("direct:start")
> > > >> >>                 .beanRef("config")
> > > >> >>                 .convertBodyTo(Document.class)
> > > >> >>                 .recipientList().xquery(
> > > >> >>                     "concat('ftp://'" +
> > > >> >>
> > > >> ",//remote[vendorId/@value='CBOE34']/server/@value" +
> > > >> >>
> > > >> >>
> > > >> >>
> > > >>
> > >
> >
> ",//remote[vendorId/@value='CBOE34']/param[name/@value='directory']/value/@value"
> >
> > > >>
> > > >> >> +
> > > >> >>                     ",'?noop=true&amp;username='" +
> > > >> >>
> > > >> ",//remote[vendorId/@value='CBOE34']/username/@value" +
> > > >> >>                     ",'&amp;password='" +
> > > >> >>
> > > >> >> ",//remote[vendorId/@value='CBOE34']/password/@value)",
> > > String.class);
> > > >> >>
> > > >> >> Here's the problem - this will create an FTP Producer - that's
> not
> > > >> >> what I need.  I need a dynamically
> > > >> >> constructed URI for a polling FTP consumer.  I don't think
> > > >> >> "recipientList" will work...   Any ideas?
> > > >> >>
> > > >> >> Thanks,
> > > >> >>
> > > >> >> Chris
> > > >> >>
> > > >> >> On Sun, Mar 31, 2013 at 10:27 AM, Chris Wolf <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=2>>
> > > >> wrote:
> > > >> >> > Hi Claus,
> > > >> >> >
> > > >> >> > I hate to ask this - but I still don't get it.  I thought
> > > >> >> > "recipientList" was for sending to multiple, runtime-defined
> > > >> >> > recipients.  I don't see how this
> > > >> >> > answers the question of sending to one, single recipient, whose
> > URI
> > > >> is
> > > >> >> > dynamically constructed - and in my use-case the dynamic
> > settings
> > > >> >> > are not in properties - so "simple" (property place-holders)
> > won't
> > > >> help
> > > >> >> me.
> > > >> >> >
> > > >> >> > Let me give you a concrete example.  I need to do an ftp
> > download
> > > >> and
> > > >> >> > the connection information comes from up-stream in the route in
> > the
> > > >> >> > form of XML (DOM - a Document instance).  Currently, I am
> trying
> > to
> > > >> do
> > > >> >> > this with bean binding and method params decorated with @XPath
> > > >> >> > pointing into the Document with the ftp settings and inside the
> > > >> >> > this method doing:
> > > >> >> >
> > > >> >> > FtpComponent ftpComponent = context.getComponent("ftp",
> > > >> >> FtpComponent.class);
> > > >> >> >
> > > >> >> > ..and then attempt to get the endpoint and call
> > > createConsumer(...).
> > > >> >> > I'm sure this is not the right way to do it, but I don't see
> how
> > > >> else
> > > >> >> > - any ideas?
> > > >> >> >
> > > >> >> > Thanks,
> > > >> >> >
> > > >> >> >
> > > >> >> > Chris
> > > >> >> >
> > > >> >> > On Sun, Mar 31, 2013 at 2:28 AM, Claus Ibsen <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=3>>
> > > >>
> > > >> >> wrote:
> > > >> >> >> Hi
> > > >> >> >>
> > > >> >> >> See this FAQ
> > > >> >> >> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> > > >> >> >>
> > > >> >> >>
> > > >> >> >>
> > > >> >> >>
> > > >> >> >> On Sun, Mar 31, 2013 at 5:22 AM, [hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=4>
> > > >> >> >> <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=5>>wrote:
> > > >>
> > > >> >> >>
> > > >> >> >>> Thanks Walzer..
> > > >> >> >>> *
> > > >> >> >>> *
> > > >> >> >>> *Queston1:
> > > >> >> >>>
> > > >> >> >>> *
> > > >> >> >>> *Example*
> > > >> >> >>>
> > > >> >> >>> .when(header("foo").isEqualTo("bar"))
> > > >> >> >>>                     .to("direct:b")
> > > >> >> >>>
> > > >> >> >>> In my case i have to add more than 80 condition and forwards
> > to
> > > 80
> > > >> >> >>> different queues.
> > > >> >> >>>
> > > >> >> >>> Above example i can only hard-code queue name,But what i want
> > is
> > > >> below.
> > > >> >> >>>
> > > >> >> >>> * .when(header("Type").isNotNull())
> > > >> >> >>>     .to("activemq.Inbound."+header("Type"))
> > > >> >> >>> *
> > > >> >> >>>
> > > >> >> >>> Example:If queue type is test,It should forward to
> > *Inbound.test*
> > > >> >> queue.
> > > >> >> >>>
> > > >> >> >>> Above example i tried,but it did not worked,created queue
> > > >> something
> > > >> >> >>> like this *Inbound.header("type")*
> > > >> >> >>>
> > > >> >> >>> *Question2*:
> > > >> >> >>>
> > > >> >> >>> from("direct:a")
> > > >> >> >>>             .multicast().to("direct:b", "direct:c",
> > "direct:d");
> > > >> >> >>>
> > > >> >> >>> Based on messages header and content type i want forward to
> > > >> different
> > > >> >> >>> queue.
> > > >> >> >>>
> > > >> >> >>> condition will be *OR *and *AND*.How can i do that like above
> > > >> example.*
> > > >> >> >>> *
> > > >> >> >>>
> > > >> >> >>> Thanks in advance*
> > > >> >> >>> *
> > > >> >> >>>
> > > >> >> >>> *Regards*
> > > >> >> >>>
> > > >> >> >>> Prabu.N
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>> On Sun, Mar 31, 2013 at 2:43 AM, Walzer, Thomas [via Camel] <
> > > >> >> >>> [hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=6>>
> > > >> wrote:
> > > >> >> >>>
> > > >> >> >>> > Hi,
> > > >> >> >>> >
> > > >> >> >>> > you could start by reading Claus´ book (p. 44ff) which has
> a
> > > >> perfect
> > > >> >> >>> > example or
> > http://camel.apache.org/content-based-router.html(just
> > > >>
> > > >> >> >>> > replace the direct: with your queues).
> > > >> >> >>> > If you need to fire your messages to multiple queues:
> > > >> >> >>> > http://camel.apache.org/publish-subscribe-channel.htmlshows
> >
> > > >> you the
> > > >> >> >>> > various ways.
> > > >> >> >>> > When you get the concepts you can just "lego" them
> together.
> > > >> >> >>> >
> > > >> >> >>> > Regards, Thomas.
> > > >> >> >>> >
> > > >> >> >>> > Am 30.03.2013 um 19:05 schrieb "[hidden email]<
> > > >> >> >>> http://user/SendEmail.jtp?type=node&node=5730116&i=0>"
> > > >> >> >>> > <[hidden email] <
> > > >> >> http://user/SendEmail.jtp?type=node&node=5730116&i=1>>:
> > > >> >> >>> >
> > > >> >> >>> > > Hi Claus,
> > > >> >> >>> > >
> > > >> >> >>> > > Thanks so much Clus for help.It is working now.
> > > >> >> >>> > >
> > > >> >> >>> > > I need your guidance for the following requirement.
> > > >> >> >>> > >
> > > >> >> >>> > > 1.I have one *inbound queue* it will receive message
> > > >> frequently
> > > >> >> from my
> > > >> >> >>> > > application.
> > > >> >> >>> > > 2.From *inbound queue* i need camel routing to move
> > message
> > > >> from
> > > >> >> >>> > > another *message
> > > >> >> >>> > > based inbound queue* based on message header value.
> > > >> >> >>> > > 3.From *message based inbound queue *i* *need camel
> > routing
> > > to
> > > >> move
> > > >> >> >>> > message
> > > >> >> >>> > > to *one or more outbound queue *based on message content*
> > > >> >> >>> > > *
> > > >> >> >>> > >
> > > >> >> >>> > > I need *camel java DSL*sample code for above
> requirement.*
> > > >> >> >>> > > *
> > > >> >> >>> > > *
> > > >> >> >>> > > *
> > > >> >> >>> > > *Thanks in advance*
> > > >> >> >>> > >
> > > >> >> >>> > >
> > > >> >> >>> > > On Sat, Mar 30, 2013 at 3:10 PM, Claus Ibsen-2 [via
> Camel]
> > <
> > > >> >> >>> > > [hidden email] <
> > > >> >> http://user/SendEmail.jtp?type=node&node=5730116&i=2>>
> > > >> >> >>> > wrote:
> > > >> >> >>> > >
> > > >> >> >>> > >> Hi
> > > >> >> >>> > >>
> > > >> >> >>> > >> Do as the exception tells you. Check route 2. You route
> > from
> > > >> >> >>> > >> "Inbound.SSS.TestEvent". And that is now know to Camel.
> > > >> >> >>> > >>
> > > >> >> >>> > >> Maybe you need to add "activemq:" as prefix so its
> > > >> >> >>> > >> "activemq:Inbound.SSS.TestEvent".
> > > >> >> >>> > >>
> > > >> >> >>> > >>
> > > >> >> >>> > >> On Fri, Mar 29, 2013 at 7:01 PM, [hidden email]<
> > > >> >> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=0>
> > > >> >> >>> > >> <[hidden email] <
> > > >> >> http://user/SendEmail.jtp?type=node&node=5730109&i=1
> > > >> >> >>> >>
> > > >> >> >>> >
> > > >> >> >>> > >> wrote:
> > > >> >> >>> > >>
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> I have activemmq  Project in that i have following
> > > >> requirement
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> 1.Move message from Inbound queue to type based inbound
> > > >> queue.
> > > >> >> >>> > >>> 2.Move message from Message type inbound queue to
> > outbound
> > > >> queue
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> I have created two bean for to achieve this.
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> 1.one for move from inbound to message type  inbound
> > queue
> > > >> >> >>> > >>> 2.one for move from inbound to outbound queue.
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> I have following entry in camel.xml
> > > >> >> >>> > >>>
> > > >> >> >>> > >>>   <camelContext id="camel" xmlns="
> > > >> >> >>> > http://camel.apache.org/schema/spring">
> > > >> >> >>> > >>
> > > >> >> >>> > >>>
> > > >> >> >>> > >>>                <routeBuilder ref="routeBuilder" />
> > > >> >> >>> > >>>            <routeBuilder ref="routeBuilder1" />
> > > >> >> >>> > >>>
> > > >> >> >>> > >>>    </camelContext>
> > > >> >> >>> > >>>
> > > >> >> >>> > >>>    <bean id="routeBuilder"
> > > >> >> >>> > >>> class="com.camel.routes.SinglecastRouteBuilder"/>
> > > >> >> >>> > >>>    <bean id="recipientsGenerator"
> > > >> >> >>> > >>> class="com.camel.routes.TypeSpecificListBean"/>
> > > >> >> >>> > >>>    <bean id="routeBuilder1"
> > > >> >> >>> > >>> class="com.camel.routes.MulticastRouteBuilder"/>
> > > >> >> >>> > >>>    <bean id="recipientsGenerator1"
> > > >> >> >>> > >>> class="com.camel.routes.RecipientListBean"/>
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> When i run application i am getting following error.
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> * java.lang.Exception:
> > > >> org.apache.camel.RuntimeCamelException:
> > > >> >> >>> > >>> org.apache.camel.Fa
> > > >> >> >>> > >>> iledToCreateRouteException: Failed to create route
> > route2:
> > > >> >> >>> > >>> Route[[From[Inbound.G
> > > >> >> >>> > >>> MD.TestEvent]] -> [Multicast[[Bean[ref:... because of
> No
> > > >> endpoint
> > > >> >> >>> > could
> > > >> >> >>> > >> be
> > > >> >> >>> > >>> found
> > > >> >> >>> > >>> for: Inbound.SSS.TestEvent, please check your classpath
> > > >> contains
> > > >> >> the
> > > >> >> >>> > >> needed
> > > >> >> >>> > >>> Cam
> > > >> >> >>> > >>> el component jar.*
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> I am not sure i am missing any configuration,Please
> > kindly
> > > >> help
> > > >> >> me
> > > >> >> >>> > >>>
> > > >> >> >>> > >>>
> > > >> >> >>> > >>>
> > > >> >> >>> > >>>
> > > >> >> >>> > >>> --
> > > >> >> >>> > >>> View this message in context:
> > > >> >> >>> > >>
> > > >> >>
> > http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094.html
> > > >> >> >>> > >>> Sent from the Camel - Users mailing list archive at
> > > >> Nabble.com.
> > > >> >> >>> > >>
> > > >> >> >>> > >>
> > > >> >> >>> > >>
> > > >> >> >>> > >> --
> > > >> >> >>> > >> Claus Ibsen
> > > >> >> >>> > >> -----------------
> > > >> >> >>> > >> Red Hat, Inc.
> > > >> >> >>> > >> FuseSource is now part of Red Hat
> > > >> >> >>> > >> Email: [hidden email]<
> > > >> >> >>> > http://user/SendEmail.jtp?type=node&node=5730109&i=2>
> > > >> >> >>> > >> Web: http://fusesource.com
> > > >> >> >>> > >> Twitter: davsclaus
> > > >> >> >>> > >> Blog: http://davsclaus.com
> > > >> >> >>> > >> Author of Camel in Action: http://www.manning.com/ibsen
> > > >> >> >>> > >>
> > > >> >> >>> > >>
> > > >> >> >>> > >> ------------------------------
> > > >> >> >>> > >> If you reply to this email, your message will be added
> to
> > > the
> > > >> >> >>> > discussion
> > > >> >> >>> > >> below:
> > > >> >> >>> > >>
> > > >> >> >>> > >>
> > > >> >> >>> >
> > > >> >> >>> > >> .
> > > >> >> >>> > >> NAML<
> > > >> >> >>> >
> > > >> >> >>>
> > > >> >>
> > > >>
> > >
> >
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >> >> >>> >
> > > >> >> >>> >
> > > >> >> >>> > >>
> > > >> >> >>> > >
> > > >> >> >>> > >
> > > >> >> >>> > >
> > > >> >> >>> > > --
> > > >> >> >>> > > Thanks & Regards
> > > >> >> >>> > > Prabu.N
> > > >> >> >>> > >
> > > >> >> >>> > >
> > > >> >> >>> > >
> > > >> >> >>> > >
> > > >> >> >>> > > --
> > > >> >> >>> > > View this message in context:
> > > >> >> >>> >
> > > >> >> >>>
> > > >> >>
> > > >>
> > >
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730115.html
> > > >> >> >>> >
> > > >> >> >>> > > Sent from the Camel - Users mailing list archive at
> > > >> Nabble.com.
> > > >> >> >>> >
> > > >> >> >>> >
> > > >> >> >>> >
> > > >> >> >>> > ------------------------------
> > > >> >> >>> >  If you reply to this email, your message will be added to
> > the
> > > >> >> discussion
> > > >> >> >>> > below:
> > > >> >> >>> >
> > > >> >> >>> >
> > > >> >> >>>
> > > >> >>
> > > >>
> > >
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730116.html
> > > >> >> >>> >  To unsubscribe from Camel routing issue, click here<
> > > >> >> >>>
> > > >> >> >>> >
> > > >> >> >>> > .
> > > >> >> >>> > NAML<
> > > >> >> >>>
> > > >> >>
> > > >>
> > >
> >
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >> >> >>> >
> > > >> >> >>> >
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>> --
> > > >> >> >>> Thanks & Regards
> > > >> >> >>>  Prabu.N
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>>
> > > >> >> >>> --
> > > >> >> >>> View this message in context:
> > > >> >> >>>
> > > >> >>
> > > >>
> > >
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730118.html
> > > >> >> >>> Sent from the Camel - Users mailing list archive at
> > Nabble.com.
> > > >> >> >>>
> > > >> >> >>
> > > >> >> >>
> > > >> >> >>
> > > >> >> >> --
> > > >> >> >> Claus Ibsen
> > > >> >> >> -----------------
> > > >> >> >> Red Hat, Inc.
> > > >> >> >> FuseSource is now part of Red Hat
> > > >> >> >> Email: [hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=7>
> > > >> >> >> Web: http://fusesource.com
> > > >> >> >> Twitter: davsclaus
> > > >> >> >> Blog: http://davsclaus.com
> > > >> >> >> Author of Camel in Action: http://www.manning.com/ibsen
> > > >> >>
> > > >> >
> > > >> >
> > > >> >
> > > >> > --
> > > >> > Claus Ibsen
> > > >> > -----------------
> > > >> > Red Hat, Inc.
> > > >> > FuseSource is now part of Red Hat
> > > >> > Email: [hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5730166&i=8>
> > > >> > Web: http://fusesource.com
> > > >> > Twitter: davsclaus
> > > >> > Blog: http://davsclaus.com
> > > >> > Author of Camel in Action: http://www.manning.com/ibsen
> > > >>
> > > >>
> > > >> ------------------------------
> > > >>  If you reply to this email, your message will be added to the
> > > >> discussion below:
> > > >>
> > > >>
> > >
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730166.html
> >
> > > >>  To unsubscribe from Camel routing issue, click here<
> > >
> > >
> > > >> .
> > > >> NAML<
> > >
> >
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks & Regards
> > > >  Prabu.N
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks & Regards
> > >  Prabu.N
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730194.html
> >
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > Red Hat, Inc.
> > FuseSource is now part of Red Hat
> > Email: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5730195&i=4>
> > Web: http://fusesource.com
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730195.html
> >  To unsubscribe from Camel routing issue, click here<
> >
> > .
> > NAML<
>
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
> --
> Thanks & Regards
>  Prabu.N
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5730196.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
123