FAQ
Hello there,

I am new to Camel. I am consuming a service request from a JMS queue and
calling an external REST service using CXFRS and processing the response.
But however, the JMSHeaders/custom headers which was in the message when
consuming from request queue is getting removed after calling the rest
service.

Below is the code snippet:

from("jms:request")
.log("CorrelationID: ${header.JMSCorrelationID}")
.to(ISEATZ_SERVICE_URL+serviceMap.get(ISeatzConstant.HOTELRATERULES))
.log("CorrelationID: ${header.JMSCorrelationID}")

First log prints the correlation Id whereas the second log statement prints
empts correleationID. Am I missing something? Kindly help.


--
View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5568925.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Claus Ibsen at Mar 16, 2012 at 5:13 am

    On Thu, Mar 15, 2012 at 7:43 PM, cgsk wrote:
    Hello there,

    I am new to Camel. I am consuming a service request from a JMS queue and
    calling an external REST service using CXFRS and processing the response.
    But however, the JMSHeaders/custom headers which was in the message when
    consuming from request queue is getting removed after calling the rest
    service.

    Below is the code snippet:

    from("jms:request")
    .log("CorrelationID: ${header.JMSCorrelationID}")
    .to(ISEATZ_SERVICE_URL+serviceMap.get(ISeatzConstant.HOTELRATERULES))
    .log("CorrelationID: ${header.JMSCorrelationID}")

    First log prints the correlation Id whereas the second log statement prints
    empts correleationID. Am I missing something? Kindly help.
    The REST service most likely do not send back the correlationID in its response.

    If you want to preserve data during routing you can store data as
    properties on the Exchange which is kept during the lifecycle.
    Where as headers on a message is part of the message format, and its
    up to the various transports whats included or not.

    An alternative EIP is to use a content enricher
    http://camel.apache.org/content-enricher.html

    Then you can "merge" in the response from the REST service with the
    existing message.
    But for that you would need to code some java code in an AggregationStrategy.
    --
    View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5568925.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Cgsk at Mar 18, 2012 at 7:05 am
    Thanks for the response.

    But when I use spring-ws the header params are retained. why this behaviour
    is differing in cxfrs?

    --
    View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5574037.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Willem Jiang at Mar 19, 2012 at 2:22 pm
    It looks like a bug of cxfrs, I just fill a JIRA[1] for it.
    [1]https://issues.apache.org/jira/browse/CAMEL-5107
    On Sun Mar 18 02:18:09 2012, cgsk wrote:
    Thanks for the response.

    But when I use spring-ws the header params are retained. why this behaviour
    is differing in cxfrs?

    --
    View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5574037.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

    --
    Willem
    ----------------------------------
    FuseSource
    Web: http://www.fusesource.com
    Blog: http://willemjiang.blogspot.com (English)
    http://jnn.javaeye.com (Chinese)
    Twitter: willemjiang
    Weibo: willemjiang
  • Willem Jiang at Mar 21, 2012 at 4:18 am
    Just FYI, I committed a patch into the trunk, camel-2.9.x and
    camel-2.8.x branch.
    Please feel free to check out the latest snapshot for verification.
    On Mon Mar 19 22:21:36 2012, Willem Jiang wrote:
    It looks like a bug of cxfrs, I just fill a JIRA[1] for it.
    [1]https://issues.apache.org/jira/browse/CAMEL-5107
    On Sun Mar 18 02:18:09 2012, cgsk wrote:
    Thanks for the response.

    But when I use spring-ws the header params are retained. why this
    behaviour
    is differing in cxfrs?

    --
    View this message in context:
    http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5574037.html

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


    --
    Willem
    ----------------------------------
    FuseSource
    Web: http://www.fusesource.com
    Blog: http://willemjiang.blogspot.com (English)
    http://jnn.javaeye.com (Chinese)
    Twitter: willemjiang
    Weibo: willemjiang
  • Cgsk at Mar 23, 2012 at 5:13 pm
    Thanks for the patch.

    --
    View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5590157.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedMar 15, '12 at 6:56p
activeMar 23, '12 at 5:13p
posts6
users3
websitecamel.apache.org

3 users in discussion

Cgsk: 3 posts Willem Jiang: 2 posts Claus Ibsen: 1 post

People

Translate

site design / logo © 2022 Grokbase