有效负载不会路由到全局出站队列jms:// orders-queue。它在流程中被注释掉了。但是,当我使用flow-ref = process-orders时,消息将被分派到process-orders流。为什么通过vm调度不起作用?
<vm:endpoint name="orders-queue" path="email.orders.in" exchange- pattern="one-way" doc:name="VM"/>
<vm:endpoint name="events-queue" path="email.orders.in" exchange-pattern="one-way" doc:name="VM"/>
<flow name="order-flow" processingStrategy="synchronous">
<vm:inbound-endpoint exchange-pattern="one-way" path="order-process.queue1" doc:name="VM" />
<!--<vm:outbound-endpoint exchange-pattern="one-way" ref="email.orders.in" doc:name="VM"/>-->
<flow-ref name="process-orders" />
<catch-exception-strategy doc:name="Processing Exception">
<logger
message="Error during flow - #[message] :: ExceptionSummary::= #[exception.summaryMessage]"
level="ERROR" doc:name="Logger" />
</catch-exception-strategy>
</flow>
<flow name="process-orders" processingStrategy="synchronous">
<vm:inbound-endpoint exchange-pattern="one-way" ref="email.orders.in" doc:name="VM"/>
<custom-transformer class="com.sw.CustomTransformer" doc:name="Java"/>
<logger message="Received Order : #[payload]" level="DEBUG" doc:name="Logger"/>
<foreach collection="#[message.payload]" doc:name="For Each"
rootMessageVariableName="Original">
<flow-ref name="process.order" doc:name="Flow Reference"/>
</foreach>
</flow>
<sub-flow name="process.order">
<processor-chain doc:name="Processor Chain" name="Event_Process_Queueing">
<jms:outbound-endpoint queue="per.order.queue"
connector-ref="jmsConnector" doc:name="JMS - Send to Processing Queue"/>
<test:component/>
</processor-chain>
</sub-flow>
答案 0 :(得分:0)
您的配置中几乎没有错误: -
第一个 process.order 是不是流,而是子流,您无法在子流中保留入站VM端点来调用它。
因此,为了将有效负载路由到您配置 email.orders.in 的全局VM队列,您可以按照以下配置示例进行操作: -
<vm:endpoint name="orders-queue" path="email.orders.in" exchange-pattern="one-way" doc:name="VM"/>
<http:listener-config name="HTTP_Listener_Configuration2" host="localhost" port="8081" doc:name="HTTP Listener Configuration" />
<flow name="Flow">
<http:listener config-ref="HTTP_Listener_Configuration2" path="/test" doc:name="HTTP"/>
<set-payload value="Test payload" doc:name="Set Payload"/>
<vm:outbound-endpoint exchange-pattern="one-way" ref="orders-queue" doc:name="VM"/>
</flow>
<flow name="Flow2">
<vm:inbound-endpoint exchange-pattern="one-way" ref="orders-queue" doc:name="VM"/>
<logger message="Received Message in Processing Queue : #[payload]" level="INFO" doc:name="Logger" />
</flow>
<强>更新: - 强>
根据您在下面的评论,您在使用Global VM连接器引用VM入站和出站端点时遇到了重大错误。
它应该如下: -
<vm:outbound-endpoint exchange-pattern="one-way" ref="events-queue" doc:name="VM"/>
和
<vm:inbound-endpoint exchange-pattern="one-way" ref="events-queue" doc:name="VM"/>
您指的是ref="email.orders.in"
哪个错误,应该是ref="events-queue"
,如上所述,名称为Global VM connector