-
1. Re: Access JMS Headers
kcbabo Jan 12, 2012 9:54 AM (in response to cvasilak)This is a bug for sure. The headers which come in on the Camel gateway (JMS component in this case) are not being mapped back into the Camel exchange that's used in the route. It's likely that you can define a message composer to make this happen. Can you create a JIRA and attach a stripped down sample application which is just the JMS gateway binding and the Camel route which attempts to access a header?
~ keith
-
2. Re: Access JMS Headers
cvasilak Jan 13, 2012 3:50 AM (in response to kcbabo)Hi Keith,
I have opened a JIRA for this together with steps to reproduce it
https://issues.jboss.org/browse/SWITCHYARD-614
Let me know if you need more information
Regards,
Christos
-
3. Re: Access JMS Headers
dward Jan 16, 2012 10:52 AM (in response to cvasilak)Hi Christos,
I will be looking at this soon for you. I assigned the jira to me and will make sure things are working as expected for the 0.4 release. I do appreciate that you have provided a test case and steps to reproduce. That helps a lot, so thank you.
David
-
4. Re: Access JMS Headers
dward Jan 16, 2012 12:54 PM (in response to cvasilak)Christos,
Your test doesn't build because of a missing parent that can't be found. Please see: http://goo.gl/YKRpj
Thanks,
David
-
5. Re: Access JMS Headers
cvasilak Jan 17, 2012 8:47 AM (in response to dward)Oops I missed that, I have already replied on JIRA
Regards
-
6. Re: Access JMS Headers
dward Jan 23, 2012 1:21 PM (in response to cvasilak)Christos,
Finally getting back to this...
One thing I noticed right away is that you haven't specified a context mapper in your binding model. If you don't do that, no headers or properties will get propagated. You need to add the <contextMapper/> element, like so:
<switchyard ...>
<composite ...>
<service ...>
<binding.camel ...>
<contextMapper xmlns="urn:switchyard-config:switchyard:1.0" includes=".*" />
...
Can you try this while I get my environment set up?
You can read more about it message composers and context mappers here:
https://docs.jboss.org/author/display/SWITCHYARD/Message+Composition
Thanks,
David
-
7. Re: Access JMS Headers
dward Jan 23, 2012 3:03 PM (in response to dward)David Ward wrote:
Can you try this while I get my environment set up?
Hmmm... Having issues getting your test case to run properly. I'm pretty sure what I suggested above should fix your issue, so if you could just validate that before I spend unecessary time on getting the test environment correct, I'd appreciate it.
Thanks,
David
-
8. Re: Access JMS Headers
cvasilak Jan 23, 2012 3:27 PM (in response to dward)Hi David,
I am currently looking at your suggestion, will reply back soon
Regards
-
9. Re: Access JMS Headers
cvasilak Jan 23, 2012 4:34 PM (in response to cvasilak)Hi David,
unfortunately it didn't work .
My switchyard.xml:
<?xml version="1.0" encoding="UTF-8"?>
<switchyard xmlns="urn:switchyard-config:switchyard:1.0"
xmlns:trfm="urn:switchyard-config:transform:1.0"
xmlns:soap="urn:switchyard-component-soap:config:1.0"
xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
name="svcrrd">
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
name="svcrrd" targetNamespace="urn:svcrrd:transform-json:0.1.0">
<service name="RegistrationRouteBuilder" promote="RegistrationRouteBuilder">
<binding.camel xmlns="urn:switchyard-component-camel:config:1.0"
configURI="jms:topic:svc_rrd_ctrl_bus?connectionFactory=#ConnectionFactory">
<contextMapper xmlns="urn:switchyard-config:switchyard:1.0" includes=".*" />
</binding.camel>
</service>
</composite>
</switchyard>
In the console only one property is printed
23:28:07,041 INFO [stdout] (Camel (camel-10) thread #4 - JmsConsumer[svc_rrd_ctrl_bus) breadcrumbId: ID-casper-49846-1327353880613-7-4
What problem are you facing with my test-case?
Regards
-
10. Re: Access JMS Headers
dward Jan 30, 2012 7:13 PM (in response to cvasilak)Christos,
A fix is queued up for https://issues.jboss.org/browse/SWITCHYARD-614.
You will still need to add the <contextMapper/>, but I've run your tests with the fix and they now work as expected (the json one as well as the pure jms one).
Note: You were using SwitchYard 0.3.0.Final. I did the above fix with 0.4.0-SNAPSHOT. It was localized to one class (as you can see in the associated pull request), but I did not try to back-port it to 0.3.0 and test there.
David
-
11. Re: Access JMS Headers
cvasilak Jan 31, 2012 4:01 AM (in response to dward)That's fantastic! Thanks a lot David!
Regards
-
12. Re: Access JMS Headers
dward Jan 31, 2012 10:48 AM (in response to cvasilak)NP. Thanks for bringing it to our attention.