The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

thompjs (10) [Avatar] Offline
#1
If there is an example in the book or on the web of sending the payload of a JMS message to a script on webserver, I'd love to see it.

Thanks
davsclaus (413) [Avatar] Offline
#2
Re: Example of from ( jms ) . to (http://....)
I don't recall such example in the book. My best guess would be in chapter 7 where we cover the JMS component.

In the Camel source code we have many unit tests that tests the components and EIPs together. I found an example with a JMS -> HTTP.

https://svn.apache.org/repos/asf/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsHttpPostIssueTest.java
thompjs (10) [Avatar] Offline
#3
Re: Example of from ( jms ) . to (http://....)
Thanks, there is a bit of discussion in Chapter 7, I'm trying to get something working from that, and I'll review the link you sent.
thompjs (10) [Avatar] Offline
#4
Re: Example of from ( jms ) . to (http://....)
The link helped a LOT! Thanks.

I had to add the inOnly() to remedy a CAST error.

from("jms:topic:LibraClient")
.setBody().simple("name=${body}")
.setHeader(CONTENT_TYPE).constant("text/plain")
.setHeader(HTTP_METHOD).constant("POST")
.to("http:localhost:5000/consumer/index")
.inOnly();
davsclaus (413) [Avatar] Offline
#5
Re: Example of from ( jms ) . to (http://....)
By CAST you mean a class cast exception?

Yeah we have recently spotted that and its fixed on the trunk. So Camel 2.8 has the fix.