实际上,我们已经生成了JAX- web服务,并且运行良好。但是现在我们想要使用Mule ESB的JMS。但我无法配置它。
我已经尝试了Mule的for服务代理,它工作得很好。但我们正在尝试将JMS放在HTTP端点之间。但是soap的主体不能传输到另一端(即传输到我们的服务) JMS Server是ActiveMQ。
提前谢谢你,
从评论中复制了流--
<flow name="finalFlow1" doc:name="finalFlow1">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" port="8888" contentType="text/xml" doc:name="HTTP" />
<jms:outbound-endpoint exchange-pattern="request-response"
queue="servicesQueue" doc:name="JMS" connector-ref="Active_MQ" />
<http:outbound-endpoint exchange-pattern="request-response"
method="POST" address="localhost:5050/MyServices" ; mimeType="text/xml"
contentType="text/xml" doc:name="HTTP" />
</flow>发布于 2014-01-31 00:36:18
在您发布的流中,您正在通过基于HTTP的入站端点使用消息。如果您只想从JMS使用此消息并将其发送到另一个HTTP端点,则需要使用JMS inbound
<flow name="finalFlow1" doc:name="finalFlow1">
<jms:inbound-endpoint exchange-pattern="request-response"
queue="servicesQueue" doc:name="JMS" />
<logger level="INFO" doc:name="Logger" />
<http:outbound-endpoint exchange-pattern="request-response"
host="localhost" port="5050" method="POST" doc:name="HTTP" path="MyServices"
mimeType="text/xml" />
</flow>但是,这只会按原样发送有效负载,而不会将其转换为SOAP有效负载。如果您希望将JMS使用的消息转换为SOAP有效负载,则需要使用CXF
<flow name="finalFlow1" doc:name="finalFlow1">
<jms:inbound-endpoint exchange-pattern="request-response"
queue="servicesQueue" doc:name="JMS" />
<logger level="INFO" doc:name="Logger" message="#[payload]" />
<logger message="SOAP call started" level="INFO" doc:name="Logger"/>
<http:outbound-endpoint
mimeType="text/xml" doc:name="HTTP" exchange-pattern="request-response" method="POST" path="MyServices" host="localhost" port="5050">
<cxf:proxy-client payload="body"
enableMuleSoapHeaders="false">
<cxf:inInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
</cxf:inInterceptors>
<cxf:outInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
</cxf:outInterceptors>
</cxf:proxy-client>
</http:outbound-endpoint>
<logger message="SOAP call completed" level="INFO" doc:name="Logger"/>
</flow>如果你只是想通过超文本传输协议开始使用JMS,你可以按照Seba的建议使用MuleRequester - https://github.com/mulesoft/mule-module-requester/blob/master/mulerequesterdemo/src/main/app/MuleRequesterDemo.xml
发布于 2014-01-31 02:40:27
如果您需要在流中间使用队列中的消息,则应该查看以下内容:http://blogs.mulesoft.org/introducing-the-mule-requester-module
https://stackoverflow.com/questions/21450755
复制相似问题