【发布时间】:2015-08-19 03:52:51
【问题描述】:
设置:
我正在使用 Spring Integration 从消息队列中获取消息。消息采用 XML 格式,我的服务激活器调用名为 parseCustPaymentXML 的方法,处理 XML 消息,并将其存储在 Java 对象中。之后,从 parseCustPaymentXML 调用另一个名为 processCustPayment 的方法,该方法获取 Java 对象并将它们插入数据库。下面是我如何设置入站 JMS 和服务激活器...
<int:channel id="jmsInChannel" />
<int-jms:message-driven-channel-adapter
destination="custPaymentRequestDestination"
connection-factory="jmsConnectionFactory"
channel="jmsInChannel"
concurrent-consumers="1" />
<int:service-activator id="parseCustPaymentServiceActivator"
ref="custPaymentService"
input-channel="jmsInChannel"
method="parseCustPaymentXML"
requires-reply="true" />
问题:
该流程运行不会花费很长时间,但是如果在 parseCustPaymentXML 或 processCustPayment 仍在运行时收到消息,则会拉出该消息,并与第一个消息流程同时启动 parseCustPaymentXML。这不是我喜欢的行为。我希望第一条消息在下一条消息开始之前完全完成(非并发)。
如果需要更多信息以获取帮助,请告诉我。
【问题讨论】:
标签: java spring jms spring-integration spring-jms