Darren,
From what I gather from our unit tests, this use case is definitely
supported. One possible guess is that something goes wrong inside Camel
when converting whatever Source type we get back into a JMS message.
Could you put a to("log:after-http?showAll=true") right after your HTTP
call so we can assess the body type?
Is there a difference in behavior when DEBUG logging is turned off in
ServiceMix? The Source type being used is different with DEBUG logging
on and off so it might make a difference here.
Regards,
Gert
Darren Davison wrote:
hi,
Using camel routing and an HTTP provider (servicemix-http) I seem to be
unable to capture the actual response message from the target (external)
service.
For testing, we have created an external web service that the http
provider talks to so that we control the complete exchange.
Here's the camel DSL:
from("activemq:queue.transactionhistory.in")
.to("jbi:service:urn:oms:transactionHistory.p1?mep=in-out")
.to("activemq:queue.transactionhistory.out");
Here's the http provider xbean.xml:
<http:endpoint
service="oms:transactionHistory.p1"
endpoint="transactionHistoryP1"
role="provider"
locationURI="http://localhost:8080/testP1">
</http:endpoint>
After I inject a message to the .in queue, it is correctly routed to the
provider, the target service is called OK and the XML respone is
returned on the same thread. The response XML is shown in the
servicemix console in DEBUG logging, so it receives it on the wire.
Finally, a message is created on the .out queue, but the message has no
content (the XML is lost). Here's some output from the smx console:
DEBUG - CamelJbiComponent - Created correlation id:
ID:127.0.1.1-11eda452114-5:5
DEBUG - DeliveryChannelImpl - Send
ID:127.0.1.1-11eda452114-5:5 in DeliveryChannel{servicemix-camel}
DEBUG - SecuredBroker - send exchange with secure
broker
DEBUG - SecuredBroker - service name
:{urn:oms}transactionHistory.p1
DEBUG - SecuredBroker - operation name :null
DEBUG - SedaFlow - Called Flow send
DEBUG - SedaQueue -
org.apache.servicemix.jbi.nmr.flow.seda.sedaqueu...@1e9c5f6 dequeued
exchange: InOut[
id: ID:127.0.1.1-11eda452114-5:5
status: Active
role: provider
service: {urn:oms}transactionHistory.p1
endpoint: transactionHistoryP1
in: <?xml version="1.0" encoding="UTF-8"?><in><msg>test</msg></in>
]
DEBUG - HttpComponent - Received exchange: status:
Active, role: provider
DEBUG - HttpComponent - Retrieved correlation id:
ID:127.0.1.1-11eda452114-5:5
DEBUG - DeliveryChannelImpl - Send
ID:127.0.1.1-11eda452114-5:5 in DeliveryChannel{servicemix-http}
DEBUG - SecuredBroker - send exchange with secure
broker
DEBUG - SedaFlow - Called Flow send
DEBUG - SedaQueue -
org.apache.servicemix.jbi.nmr.flow.seda.sedaqueu...@e8c6f dequeued
exchange: InOut[
id: ID:127.0.1.1-11eda452114-5:5
status: Active
role: consumer
service: {urn:oms}transactionHistory.p1
endpoint: transactionHistoryP1
in: <?xml version="1.0" encoding="UTF-8"?><in><msg>test</msg></in>
out: <?xml version="1.0" encoding="UTF-8"?><out><msg>test</msg></out>
]
DEBUG - CamelJbiComponent - Received exchange: status:
Active, role: consumer
DEBUG - CamelJbiComponent - Retrieved correlation id:
ID:127.0.1.1-11eda452114-5:5
DEBUG - DeliveryChannelImpl - Send
ID:127.0.1.1-11eda452114-5:5 in DeliveryChannel{servicemix-camel}
DEBUG - SecuredBroker - send exchange with secure
broker
DEBUG - SedaFlow - Called Flow send
DEBUG - SedaQueue -
org.apache.servicemix.jbi.nmr.flow.seda.sedaqueu...@ce3613 dequeued
exchange: InOut[
id: ID:127.0.1.1-11eda452114-5:5
status: Done
role: provider
service: {urn:oms}transactionHistory.p1
endpoint: transactionHistoryP1
in: <?xml version="1.0" encoding="UTF-8"?><in><msg>test</msg></in>
out: <?xml version="1.0" encoding="UTF-8"?><out><msg>test</msg></out>
]
DEBUG - HttpComponent - Received exchange: status:
Done, role: provider
DEBUG - HttpComponent - Retrieved correlation id:
ID:127.0.1.1-11eda452114-5:5
So it all seems OK other than an empty message ending up on the .out
queue. I also tried turning off DEBUG logging in case output to the log
was consuming the message, but no dice.. same result.
Can anyone help find my lost XML response? We've been looking at this
for a good while now and are quite lost with it :(
Many thanks.