Grokbase Groups Camel users May 2008
FAQ
I have a simple jms:endpoint node configurted to receive messages on a
"my.queue" in Servicemix. It currently receives messages and sends to a
TraceBean configured as a targetservice. Now I would like to replace the
TraceBean and apply the Camel routing to the incoming message to send the
message to an other jms:endpoint (provider) to a queue defined in JBoss.

This seems like a simple message forwarding scenario, but, I cant seem to
find docs on how to tie the jms:consumer/endpoint to camel. Is there a way
to specify the targetService of the Jms:consumer/endpoint as the
camel-context id? or will Camel-context pick up the message and forward as
per routing defined in the context?

thanx
-ram
--
View this message in context: http://www.nabble.com/camel-context-node-as-a-targetservice-for-jms%3Aendpoint---tp17275939s22882p17275939.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Roman Kalukiewicz at May 16, 2008 at 4:08 pm
    2008/5/16 rmunjuluri <rmunjuluri@yahoo.com>:
    I have a simple jms:endpoint node configurted to receive messages on a
    "my.queue" in Servicemix. It currently receives messages and sends to a
    TraceBean configured as a targetservice. Now I would like to replace the
    TraceBean and apply the Camel routing to the incoming message to send the
    message to an other jms:endpoint (provider) to a queue defined in JBoss.

    This seems like a simple message forwarding scenario, but, I cant seem to
    find docs on how to tie the jms:consumer/endpoint to camel. Is there a way
    to specify the targetService of the Jms:consumer/endpoint as the
    camel-context id? or will Camel-context pick up the message and forward as
    per routing defined in the context?
    Here you have some documentation:

    http://activemq.apache.org/camel/jbi.html

    Maybe it is not very clearly stated at the wiki page, but when you write

    from("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint")

    you automatically expose the endpoint to the bus where service qname
    is {http://foo.bar.org}MyService and endpoint name is MyEndpoint.

    All you have to do is to send messages from jms:endpoint to this JBI
    endpoint (the same way as you send messages to EIP endpoints) and it
    will pick it up the same way as it picks any other message messages.

    Sending works in the same way: you use
    to("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint") to send
    messages to JBI endpoint deployed to the bus. It could be jms:endpoint
    or anything else.

    I noticed that people are used to somehow 'declaring' endpoints in
    SMX. In camel it is enough to simply start a flow from a jbi endpoint
    and camel will create it automatically.

    Roman
  • Claus Ibsen at May 17, 2008 at 5:45 am
    Great question and answer. Roman, it would be nice if it was added to the FAQ of Camel and/or Servicemix.

    Med venlig hilsen

    Claus Ibsen
    ......................................
    Silverbullet
    Skovsgårdsvænget 21
    8362 Hørning
    Tlf. +45 2962 7576
    Web: www.silverbullet.dk
    -----Original Message-----
    From: Roman Kalukiewicz
    Sent: 16. maj 2008 18:08
    To: camel-user@activemq.apache.org
    Subject: Re: camel-context node as a targetservice for jms:endpoint ?

    2008/5/16 rmunjuluri <rmunjuluri@yahoo.com>:
    I have a simple jms:endpoint node configurted to receive messages on a
    "my.queue" in Servicemix. It currently receives messages and sends to a
    TraceBean configured as a targetservice. Now I would like to replace the
    TraceBean and apply the Camel routing to the incoming message to send the
    message to an other jms:endpoint (provider) to a queue defined in JBoss.

    This seems like a simple message forwarding scenario, but, I cant seem to
    find docs on how to tie the jms:consumer/endpoint to camel. Is there a way
    to specify the targetService of the Jms:consumer/endpoint as the
    camel-context id? or will Camel-context pick up the message and forward as
    per routing defined in the context?
    Here you have some documentation:

    http://activemq.apache.org/camel/jbi.html

    Maybe it is not very clearly stated at the wiki page, but when you write

    from("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint")

    you automatically expose the endpoint to the bus where service qname
    is {http://foo.bar.org}MyService and endpoint name is MyEndpoint.

    All you have to do is to send messages from jms:endpoint to this JBI
    endpoint (the same way as you send messages to EIP endpoints) and it
    will pick it up the same way as it picks any other message messages.

    Sending works in the same way: you use
    to("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint") to send
    messages to JBI endpoint deployed to the bus. It could be jms:endpoint
    or anything else.

    I noticed that people are used to somehow 'declaring' endpoints in
    SMX. In camel it is enough to simply start a flow from a jbi endpoint
    and camel will create it automatically.

    Roman
  • James Strachan at May 20, 2008 at 8:49 am
    Great idea...

    http://cwiki.apache.org/CAMEL/how-do-i-invoke-camel-routes-from-jbi.html

    2008/5/17 Claus Ibsen <ci@silverbullet.dk>:
    Great question and answer. Roman, it would be nice if it was added to the FAQ of Camel and/or Servicemix.

    Med venlig hilsen

    Claus Ibsen
    ......................................
    Silverbullet
    Skovsgårdsvænget 21
    8362 Hørning
    Tlf. +45 2962 7576
    Web: www.silverbullet.dk
    -----Original Message-----
    From: Roman Kalukiewicz
    Sent: 16. maj 2008 18:08
    To: camel-user@activemq.apache.org
    Subject: Re: camel-context node as a targetservice for jms:endpoint ?

    2008/5/16 rmunjuluri <rmunjuluri@yahoo.com>:
    I have a simple jms:endpoint node configurted to receive messages on a
    "my.queue" in Servicemix. It currently receives messages and sends to a
    TraceBean configured as a targetservice. Now I would like to replace the
    TraceBean and apply the Camel routing to the incoming message to send the
    message to an other jms:endpoint (provider) to a queue defined in JBoss.

    This seems like a simple message forwarding scenario, but, I cant seem to
    find docs on how to tie the jms:consumer/endpoint to camel. Is there a way
    to specify the targetService of the Jms:consumer/endpoint as the
    camel-context id? or will Camel-context pick up the message and forward as
    per routing defined in the context?
    Here you have some documentation:

    http://activemq.apache.org/camel/jbi.html

    Maybe it is not very clearly stated at the wiki page, but when you write

    from("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint")

    you automatically expose the endpoint to the bus where service qname
    is {http://foo.bar.org}MyService and endpoint name is MyEndpoint.

    All you have to do is to send messages from jms:endpoint to this JBI
    endpoint (the same way as you send messages to EIP endpoints) and it
    will pick it up the same way as it picks any other message messages.

    Sending works in the same way: you use
    to("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint") to send
    messages to JBI endpoint deployed to the bus. It could be jms:endpoint
    or anything else.

    I noticed that people are used to somehow 'declaring' endpoints in
    SMX. In camel it is enough to simply start a flow from a jbi endpoint
    and camel will create it automatically.

    Roman


    --
    James
    -------
    http://macstrac.blogspot.com/

    Open Source Integration
    http://open.iona.com
  • Rmunjuluri at May 19, 2008 at 10:04 am
    Thank you very much Roman. That worked great. I have two new issues:

    1. The simple message forward works for about 4 messages and then SMX seems
    to block the forwarding the 5 message onwards to the target service. Have
    you seen this behaviour? Is there any configuration issue with this?

    2. Also I tried was to make the camel context a static recipientList router
    to send the message to more than one target service (queues, oneway
    senders). Every time, the message is sent to the first target only and is
    not forwarded to the next target on the list. Is this a bug in the statis
    recipient list pattern implementation in camel?

    =======================================================
    <camelContext id="staticRecipientList"
    xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
    <from
    uri="jbi:service:http://www.pictorsolutions.com/ServiceConsumers/CamelRoutingService"/>
    <to
    uri="jbi:service:http://www.pictorsolutions.com/ServiceProviders/RequestProcessProvider"/>
    <to
    uri="jbi:service:http://www.pictorsolutions.com/ServiceProviders/TraceService"/>
    </route>
    </camelContext>
    =======================================================

    thanx in advance again
    -ram



    RomKal wrote:
    2008/5/16 rmunjuluri <rmunjuluri@yahoo.com>:
    I have a simple jms:endpoint node configurted to receive messages on a
    "my.queue" in Servicemix. It currently receives messages and sends to a
    TraceBean configured as a targetservice. Now I would like to replace the
    TraceBean and apply the Camel routing to the incoming message to send the
    message to an other jms:endpoint (provider) to a queue defined in JBoss.

    This seems like a simple message forwarding scenario, but, I cant seem to
    find docs on how to tie the jms:consumer/endpoint to camel. Is there a
    way
    to specify the targetService of the Jms:consumer/endpoint as the
    camel-context id? or will Camel-context pick up the message and forward
    as
    per routing defined in the context?
    Here you have some documentation:

    http://activemq.apache.org/camel/jbi.html

    Maybe it is not very clearly stated at the wiki page, but when you write

    from("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint")

    you automatically expose the endpoint to the bus where service qname
    is {http://foo.bar.org}MyService and endpoint name is MyEndpoint.

    All you have to do is to send messages from jms:endpoint to this JBI
    endpoint (the same way as you send messages to EIP endpoints) and it
    will pick it up the same way as it picks any other message messages.

    Sending works in the same way: you use
    to("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint") to send
    messages to JBI endpoint deployed to the bus. It could be jms:endpoint
    or anything else.

    I noticed that people are used to somehow 'declaring' endpoints in
    SMX. In camel it is enough to simply start a flow from a jbi endpoint
    and camel will create it automatically.

    Roman
    --
    View this message in context: http://www.nabble.com/camel-context-node-as-a-targetservice-for-jms%3Aendpoint---tp17275939s22882p17315169.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • James Strachan at May 20, 2008 at 8:49 am
    Which version of ServiceMix are you using?

    2008/5/19 rmunjuluri <rmunjuluri@yahoo.com>:
    Thank you very much Roman. That worked great. I have two new issues:

    1. The simple message forward works for about 4 messages and then SMX seems
    to block the forwarding the 5 message onwards to the target service. Have
    you seen this behaviour? Is there any configuration issue with this?

    2. Also I tried was to make the camel context a static recipientList router
    to send the message to more than one target service (queues, oneway
    senders). Every time, the message is sent to the first target only and is
    not forwarded to the next target on the list. Is this a bug in the statis
    recipient list pattern implementation in camel?

    =======================================================
    <camelContext id="staticRecipientList"
    xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
    <from
    uri="jbi:service:http://www.pictorsolutions.com/ServiceConsumers/CamelRoutingService"/>
    <to
    uri="jbi:service:http://www.pictorsolutions.com/ServiceProviders/RequestProcessProvider"/>
    <to
    uri="jbi:service:http://www.pictorsolutions.com/ServiceProviders/TraceService"/>
    </route>
    </camelContext>
    =======================================================

    thanx in advance again
    -ram



    RomKal wrote:
    2008/5/16 rmunjuluri <rmunjuluri@yahoo.com>:
    I have a simple jms:endpoint node configurted to receive messages on a
    "my.queue" in Servicemix. It currently receives messages and sends to a
    TraceBean configured as a targetservice. Now I would like to replace the
    TraceBean and apply the Camel routing to the incoming message to send the
    message to an other jms:endpoint (provider) to a queue defined in JBoss.

    This seems like a simple message forwarding scenario, but, I cant seem to
    find docs on how to tie the jms:consumer/endpoint to camel. Is there a
    way
    to specify the targetService of the Jms:consumer/endpoint as the
    camel-context id? or will Camel-context pick up the message and forward
    as
    per routing defined in the context?
    Here you have some documentation:

    http://activemq.apache.org/camel/jbi.html

    Maybe it is not very clearly stated at the wiki page, but when you write

    from("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint")

    you automatically expose the endpoint to the bus where service qname
    is {http://foo.bar.org}MyService and endpoint name is MyEndpoint.

    All you have to do is to send messages from jms:endpoint to this JBI
    endpoint (the same way as you send messages to EIP endpoints) and it
    will pick it up the same way as it picks any other message messages.

    Sending works in the same way: you use
    to("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint") to send
    messages to JBI endpoint deployed to the bus. It could be jms:endpoint
    or anything else.

    I noticed that people are used to somehow 'declaring' endpoints in
    SMX. In camel it is enough to simply start a flow from a jbi endpoint
    and camel will create it automatically.

    Roman
    --
    View this message in context: http://www.nabble.com/camel-context-node-as-a-targetservice-for-jms%3Aendpoint---tp17275939s22882p17315169.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    James
    -------
    http://macstrac.blogspot.com/

    Open Source Integration
    http://open.iona.com
  • Rmunjuluri at May 20, 2008 at 9:49 am
    It is the IONA version of FUSE - servicemix-eip-3.3.1.0-fuse

    thanx
    -ram



    James.Strachan wrote:
    Which version of ServiceMix are you using?

    2008/5/19 rmunjuluri <rmunjuluri@yahoo.com>:
    Thank you very much Roman. That worked great. I have two new issues:

    1. The simple message forward works for about 4 messages and then SMX
    seems
    to block the forwarding the 5 message onwards to the target service. Have
    you seen this behaviour? Is there any configuration issue with this?

    2. Also I tried was to make the camel context a static recipientList
    router
    to send the message to more than one target service (queues, oneway
    senders). Every time, the message is sent to the first target only and is
    not forwarded to the next target on the list. Is this a bug in the statis
    recipient list pattern implementation in camel?

    =======================================================
    <camelContext id="staticRecipientList"
    xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
    <from
    uri="jbi:service:http://www.pictorsolutions.com/ServiceConsumers/CamelRoutingService"/>
    <to
    uri="jbi:service:http://www.pictorsolutions.com/ServiceProviders/RequestProcessProvider"/>
    <to
    uri="jbi:service:http://www.pictorsolutions.com/ServiceProviders/TraceService"/>
    </route>
    </camelContext>
    =======================================================

    thanx in advance again
    -ram



    RomKal wrote:
    2008/5/16 rmunjuluri <rmunjuluri@yahoo.com>:
    I have a simple jms:endpoint node configurted to receive messages on a
    "my.queue" in Servicemix. It currently receives messages and sends to a
    TraceBean configured as a targetservice. Now I would like to replace
    the
    TraceBean and apply the Camel routing to the incoming message to send
    the
    message to an other jms:endpoint (provider) to a queue defined in
    JBoss.

    This seems like a simple message forwarding scenario, but, I cant seem
    to
    find docs on how to tie the jms:consumer/endpoint to camel. Is there a
    way
    to specify the targetService of the Jms:consumer/endpoint as the
    camel-context id? or will Camel-context pick up the message and forward
    as
    per routing defined in the context?
    Here you have some documentation:

    http://activemq.apache.org/camel/jbi.html

    Maybe it is not very clearly stated at the wiki page, but when you write

    from("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint")

    you automatically expose the endpoint to the bus where service qname
    is {http://foo.bar.org}MyService and endpoint name is MyEndpoint.

    All you have to do is to send messages from jms:endpoint to this JBI
    endpoint (the same way as you send messages to EIP endpoints) and it
    will pick it up the same way as it picks any other message messages.

    Sending works in the same way: you use
    to("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint") to send
    messages to JBI endpoint deployed to the bus. It could be jms:endpoint
    or anything else.

    I noticed that people are used to somehow 'declaring' endpoints in
    SMX. In camel it is enough to simply start a flow from a jbi endpoint
    and camel will create it automatically.

    Roman
    --
    View this message in context:
    http://www.nabble.com/camel-context-node-as-a-targetservice-for-jms%3Aendpoint---tp17275939s22882p17315169.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    James
    -------
    http://macstrac.blogspot.com/

    Open Source Integration
    http://open.iona.com
    --
    View this message in context: http://www.nabble.com/camel-context-node-as-a-targetservice-for-jms%3Aendpoint---tp17275939s22882p17336772.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Rmunjuluri at May 20, 2008 at 11:00 am
    I worked thru the URI and the namespace issues and got it to work. Now the
    static recipient list pattern under servicemix-camel component works.
    basically I learnt is the "from uri" is mapped internally to a different
    Endpoint address (jconsole shows this) than the usual consumer/provider
    endpoints that are not camel endpoints. I am not sure if this is a typo on
    the webpage or my hack to make it work :-) or a bug in servicemix-camel but
    it worked.

    ========================= CAMEL STATIC RECIPIENT LIST ============
    <from
    uri="jbi:endpoint:http://consumers.pictor.com//CamelStaticRecipientListService/CamelStaticRecipientListEndpoint"/>
    <to
    uri="jbi:service:http://services.pictor.com//RequestProcessProvider"/>
    <to uri="jbi:service:http://services.pictor.com//TraceBeanService"/>
    ==============================================================
    the slashes at the end of pictor.com made the diffirence. If I had a single
    slash, the endpoint URI mapped to
    "http:__consumers.pictor.com}CamelStaticRecipientListService...". I could
    see the endpoint URI in jconsole. when the jms:endpoint was forwarding the
    message to this service it was trying (i am guessing at this point on how
    the NMR maps the targetService internally) to send locate the
    "http://consumers.pictor.com/" which is
    http:__consumers.pictor.com_}CamelStaticRecipientListService. So, I simply
    hacked my way through by adding a double slash at the end of the pictor.com
    to generate
    "http:__consumers.pictor.com_}CamelStaticRecipientListService....
    etc.(verified in jconsole) and that worked. jms:endpoint was able to send to
    the correct Camel endpoint.

    well, is this my hack or a bug in NMR or works as designed?

    thanx
    -ram





    rmunjuluri wrote:
    It is the IONA version of FUSE - servicemix-eip-3.3.1.0-fuse

    thanx
    -ram



    James.Strachan wrote:
    Which version of ServiceMix are you using?

    2008/5/19 rmunjuluri <rmunjuluri@yahoo.com>:
    Thank you very much Roman. That worked great. I have two new issues:

    1. The simple message forward works for about 4 messages and then SMX
    seems
    to block the forwarding the 5 message onwards to the target service.
    Have
    you seen this behaviour? Is there any configuration issue with this?

    2. Also I tried was to make the camel context a static recipientList
    router
    to send the message to more than one target service (queues, oneway
    senders). Every time, the message is sent to the first target only and
    is
    not forwarded to the next target on the list. Is this a bug in the
    statis
    recipient list pattern implementation in camel?

    =======================================================
    <camelContext id="staticRecipientList"
    xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
    <from
    uri="jbi:service:http://www.pictorsolutions.com/ServiceConsumers/CamelRoutingService"/>
    <to
    uri="jbi:service:http://www.pictorsolutions.com/ServiceProviders/RequestProcessProvider"/>
    <to
    uri="jbi:service:http://www.pictorsolutions.com/ServiceProviders/TraceService"/>
    </route>
    </camelContext>
    =======================================================

    thanx in advance again
    -ram



    RomKal wrote:
    2008/5/16 rmunjuluri <rmunjuluri@yahoo.com>:
    I have a simple jms:endpoint node configurted to receive messages on a
    "my.queue" in Servicemix. It currently receives messages and sends to
    a
    TraceBean configured as a targetservice. Now I would like to replace
    the
    TraceBean and apply the Camel routing to the incoming message to send
    the
    message to an other jms:endpoint (provider) to a queue defined in
    JBoss.

    This seems like a simple message forwarding scenario, but, I cant seem
    to
    find docs on how to tie the jms:consumer/endpoint to camel. Is there a
    way
    to specify the targetService of the Jms:consumer/endpoint as the
    camel-context id? or will Camel-context pick up the message and
    forward
    as
    per routing defined in the context?
    Here you have some documentation:

    http://activemq.apache.org/camel/jbi.html

    Maybe it is not very clearly stated at the wiki page, but when you
    write

    from("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint")

    you automatically expose the endpoint to the bus where service qname
    is {http://foo.bar.org}MyService and endpoint name is MyEndpoint.

    All you have to do is to send messages from jms:endpoint to this JBI
    endpoint (the same way as you send messages to EIP endpoints) and it
    will pick it up the same way as it picks any other message messages.

    Sending works in the same way: you use
    to("jbi:endpoint:http://foo.bar.org/MyService/MyEndpoint") to send
    messages to JBI endpoint deployed to the bus. It could be jms:endpoint
    or anything else.

    I noticed that people are used to somehow 'declaring' endpoints in
    SMX. In camel it is enough to simply start a flow from a jbi endpoint
    and camel will create it automatically.

    Roman
    --
    View this message in context:
    http://www.nabble.com/camel-context-node-as-a-targetservice-for-jms%3Aendpoint---tp17275939s22882p17315169.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    James
    -------
    http://macstrac.blogspot.com/

    Open Source Integration
    http://open.iona.com
    --
    View this message in context: http://www.nabble.com/camel-context-node-as-a-targetservice-for-jms%3Aendpoint---tp17275939s22882p17337794.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Roman Kalukiewicz at May 27, 2008 at 11:11 am
    2008/5/20 rmunjuluri <rmunjuluri@yahoo.com>:
    I worked thru the URI and the namespace issues and got it to work. Now the
    static recipient list pattern under servicemix-camel component works.
    basically I learnt is the "from uri" is mapped internally to a different
    Endpoint address (jconsole shows this) than the usual consumer/provider
    endpoints that are not camel endpoints. I am not sure if this is a typo on
    the webpage or my hack to make it work :-) or a bug in servicemix-camel but
    it worked.

    ========================= CAMEL STATIC RECIPIENT LIST ============
    <from
    uri="jbi:endpoint:http://consumers.pictor.com//CamelStaticRecipientListService/CamelStaticRecipientListEndpoint"/>
    <to
    uri="jbi:service:http://services.pictor.com//RequestProcessProvider"/>
    <to uri="jbi:service:http://services.pictor.com//TraceBeanService"/>
    ==============================================================
    the slashes at the end of pictor.com made the diffirence. <cut/>
    well, is this my hack or a bug in NMR or works as designed?
    It works as designed. If you look at Camel JBI component description
    on our wiki we have the [1] page referenced there. There is this issue
    described and explained.

    [1]: http://servicemix.apache.org/uris.html

    Roman (just in case someone is still interested in the answer)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedMay 16, '08 at 2:23p
activeMay 27, '08 at 11:11a
posts9
users4
websitecamel.apache.org

People

Translate

site design / logo © 2022 Grokbase