ServiceMix is not sending a response back to the calling Service in an In-Out
Message Exchange
----------------------------------------------------------------------------------------------
Key: SM-1110
URL: https://issues.apache.org/activemq/browse/SM-1110
Project: ServiceMix
Issue Type: Bug
Components: servicemix-bean, servicemix-core
Affects Versions: 3.1.2
Environment: MacBook Pro
Mac OS X 10.4
Java JDK 1.5.0.7
Maven 2.0.7
Reporter: Andreas Schaefer
Attachments: smx.send.problem.test.zip
When sending an In-Out message from a Bean SU to another component (here a
Script SU) asynchronously then the response is not routed back to the calling
SU even though it returns back to the correct BC. What is happening is that the
Consumer Endpoint of the called SU is used. In the attached test the called SU
is based on a Script BC and so it cannot even find a service.
Note: the problem is not somewhat shortcut by the issues SM-994
(https://issues.apache.org/activemq/browse/SM-944). I hacked the issue and I
see that the called SU is called.
The attached file is a ZIP file of a complete project. To run the test build
the project with "mvn install".
The important lines are:
2007-10-18 10:32:07,851 [ed-0:1-thread-1] INFO InOutReceiver
- process(), send back response, ME: InOut[
id: ID:10.250.1.197-115b42ceaed-2:0
status: Active
role: provider
service: {urn:xTest}script-receiver-service
endpoint: in-out-receiver
operation: IdontCare: 0
in: <?xml version="1.0"
encoding="UTF-8"?><receiver><title>DontCareEvenMore</title><index>0</index></receiver>
out: <?xml version="1.0" encoding="UTF-8"?><world>hello</world>
]
2007-10-18 10:32:07,857 [ed-0:1-thread-1] DEBUG DeliveryChannelImpl
- Send ID:10.250.1.197-115b42ceaed-2:0 in
DeliveryChannel{ID:10.250.1.197-115b42ceaed-0:1}
2007-10-18 10:32:07,858 [ed-0:1-thread-1] DEBUG SedaFlow
- Called Flow send
2007-10-18 10:32:07,859 [ed-0:1-thread-2] DEBUG SedaQueue
- [EMAIL PROTECTED] dequeued exchange: InOut[
id: ID:10.250.1.197-115b42ceaed-2:0
status: Active
role: consumer
service: {urn:xTest}script-receiver-service
endpoint: in-out-receiver
operation: IdontCare: 0
in: <?xml version="1.0"
encoding="UTF-8"?><receiver><title>DontCareEvenMore</title><index>0</index></receiver>
out: <?xml version="1.0" encoding="UTF-8"?><world>hello</world>
]
2007-10-18 10:32:07,859 [ed-0:1-thread-2] DEBUG BeanComponent
- Received exchange: status: Active, role: consumer
2007-10-18 10:32:07,859 [ed-0:1-thread-2] DEBUG BeanComponent
- Retrieved correlation id: ID:10.250.1.197-115b42ceaed-2:0
2007-10-18 10:32:07,862 [ed-0:1-thread-2] ERROR BeanComponent
- Error processing exchange InOut[
id: ID:10.250.1.197-115b42ceaed-2:0
status: Active
role: consumer
service: {urn:xTest}script-receiver-service
endpoint: in-out-receiver
operation: IdontCare: 0
in: <?xml version="1.0"
encoding="UTF-8"?><receiver><title>DontCareEvenMore</title><index>0</index></receiver>
out: <?xml version="1.0" encoding="UTF-8"?><world>hello</world>
]
java.lang.IllegalStateException: Receiving unknown consumer exchange: InOut[
id: ID:10.250.1.197-115b42ceaed-2:0
status: Active
role: consumer
service: {urn:xTest}script-receiver-service
endpoint: in-out-receiver
operation: IdontCare: 0
in: <?xml version="1.0"
encoding="UTF-8"?><receiver><title>DontCareEvenMore</title><index>0</index></receiver>
out: <?xml version="1.0" encoding="UTF-8"?><world>hello</world>
]
at
org.apache.servicemix.bean.BeanEndpoint.onConsumerExchange(BeanEndpoint.java:266)
at
org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:196)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:463)
at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:595)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:613)
The InOutReceiver Script component is setting a response (Out Message) and
sending the message back through the delivery channel. The message is then
picked up correctly by a BeanEndpoint but because of the wrong address
(service) it ends up in the Consumer Endpoint of the wrong Bean. The exception
(Unkown consumer exchange) is another problem that comes from the fact that the
list of requests are a private member of an Endpoint and the Consumer and the
Provider are two different Endpoint instances. I fixed that issue but it does
not make any difference.
-Andy
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.