[mule-dev] Error when using an http endpoint with synchronous JMS messaging

2 views
Skip to first unread message

Mark Bonano

unread,
Oct 3, 2011, 2:49:53 PM10/3/11
to d...@mule.codehaus.org
Hello All,

I have set up two very simple flows which are configured to do the following:

web-server-flow:
- Transform the body of an HTTP post (which contains JSON) to a string
- Pass the string to a designated JMS queue (in.queue)
- Listen for the response on the appropriate JMS queue (out.queue)

application-server-flow:
- Transform the JSON string to the appropriate domain object
- Supply the transformed object to the appropriate component
- JSON serialize the response and pass the string to the appropriate JMS queue (out.queue)

About half of all HTTP posts to the web-server-flow are processed correctly and I can see the JSON response as expected. The other half of the HTTP posts, however, are sent successfully to the application-server-flow, but are never read out of the response queue (out.queue). When the web server tries to read the response posted to the JMS response queue (out.queue) it throws the following error:

ERROR 2011-10-03 12:54:53,445 [ActiveMQ Session Task-2] org.mule.exception.DefaultSystemExceptionStrategy:
********************************************************************************
Message : null
Code : MULE_ERROR--1
--------------------------------------------------------------------------------
Exception stack is:
1. null (org.mule.api.store.ObjectAlreadyExistsException)
org.mule.util.store.PartitionedObjectStoreWrapper:52 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/store/ObjectAlreadyExistsException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.store.ObjectAlreadyExistsException
at org.mule.util.store.PartitionedObjectStoreWrapper.store(PartitionedObjectStoreWrapper.java:52)
at org.mule.util.store.MonitoredObjectStoreWrapper.store(MonitoredObjectStoreWrapper.java:101)
at org.mule.routing.requestreply.AbstractAsyncRequestReplyRequester$InternalAsyncReplyMessageProcessor.process(AbstractAsyncRequestReplyRequester.java:302)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

Once this error occurs, all subsequent HTTP posts fail to be transformed, throwing the following error:

********************************************************************************
Message : Could not find a transformer to transform "SimpleDataType{type=org.apache.activemq.command.ActiveMQTextMessage, mimeType='*/*'}" to "SimpleDataType{type=org.mule.api.transport.OutputHandler, mimeType='*/*'}".
Code : MULE_ERROR-65237
--------------------------------------------------------------------------------
Exception stack is:
1. Could not find a transformer to transform "SimpleDataType{type=org.apache.activemq.command.ActiveMQTextMessage, mimeType='*/*'}" to "SimpleDataType{type=org.mule.api.transport.OutputHandler, mimeType='*/*'}". (org.mule.api.transformer.TransformerException)
org.mule.registry.MuleRegistryHelper:252 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=org.apache.activemq.command.ActiveMQTextMessage, mimeType='*/*'}" to "SimpleDataType{type=org.mule.api.transport.OutputHandler, mimeType='*/*'}".
at org.mule.registry.MuleRegistryHelper.lookupTransformer(MuleRegistryHelper.java:252)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:354)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:312)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

Below are my two flows. Any insight anyone can provide would be GREATLY appreciated.

WEB-SERVER-FLOW:

<custom-transformer name="test" class="org.mydomain.transformers.Test" />
<flow name="web-services-test">
<http:inbound-endpoint host="localhost" port="8888" path="v1"
transformer-refs="test" exchange-pattern="request-response" />

<request-reply timeout="7000">
<jms:outbound-endpoint queue="in.queue" exchange-pattern="one-way">
</jms:outbound-endpoint>

<jms:inbound-endpoint queue="out.queue">
</jms:inbound-endpoint>
</request-reply>
</flow>

APPLICATION-SERVER-FLOW:

<flow name="domain-services-test">
<jms:inbound-endpoint queue="in.queue" exchange-pattern="one-way" />
<message-properties-transformer scope="outbound">
<add-message-property key="MULE_REPLYTO" value="jms://out.queue"/>
<add-message-property key="MULE_CORRELATION_ID" value="#[header:INBOUND:MULE_CORRELATION_ID]"/>
</message-properties-transformer>
<custom-transformer class="org.mydomain.transformers.JsonRequestToObject" />
<component>
<method-entry-point-resolver
acceptVoidMethods="true">
<include-entry-point method="add" />
</method-entry-point-resolver>
<spring-object bean="domainService" />
</component>
<logger message="Message processed and ready for response transformer: #[payload:]" level="INFO" />
<custom-transformer class="org.deets.domainServices.transformers.ObjectToJsonResponse" />
<logger message="Message transformed: #[payload:]" level="INFO" />
<jms:outbound-endpoint queue="out.queue" exchange-pattern="one-way">

</jms:outbound-endpoint>
<default-exception-strategy>
<jms:outbound-endpoint queue="domainServices.error.queue" />
</default-exception-strategy>
</flow>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Reply all
Reply to author
Forward
0 new messages