【问题标题】:Mule: Processing messages in intervals. Delayed message processingMule:间隔处理消息。延迟消息处理
【发布时间】:2013-08-22 20:10:50
【问题描述】:

如何在 Mule 3.3.1 中创建延迟的 JMS 消息处理器?我的目标是在一定的时间间隔内处理来自队列的消息...一些每分钟醒来处理消息的侦听器。

我有以下配置,但延迟不兑现。当消息回滚时,它会立即被挑选出来进行处理。

    <spring:bean id="MQConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
        <spring:property name="transportType" value="1"/>
        <spring:property name="hostName" value="myHost"/>
        <spring:property name="port" value="1414"/>
        <spring:property name="queueManager" value="myQmgr"/>
    </spring:bean>

<jms:connector name="queueConnector" connectionFactory-ref="MQConnectionFactory" 
            specification="1.1" username="xxx" password="yyy" 
            disableTemporaryReplyToDestinations="true"
            numberOfConcurrentTransactedReceivers="3" maxRedelivery="5">
            <service-overrides transactedMessageReceiver="com.mulesoft.mule.transport.jms.TransactedPollingJmsMessageReceiver"/>
</jms:connector>

<jms:endpoint name="someQueue" queue="osmQueue" connector-ref="queueConnector">
  <jms:transaction action="ALWAYS_BEGIN"/>          
  <property key="pollingFrequency" value="60000"/> 
</jms:endpoint>

我进行了大量搜索,但无法确定合适的解决方案。如果有更好的选择,我愿意。感谢任何帮助。 2天没反应?我问错问题了吗?

【问题讨论】:

  • 您能分享您的 MQConnectionFactory 配置吗?另外我可以看到您正在配置 transactedMessageReceiver 虽然没有使用任何事务,所以它可能无论如何都不会使用
  • @genjosanzo。更新了 MQConnectionFactory。谢谢。您提到“没有使用交易”....但我确实使用 jms:transaction,您能确认一下吗?

标签: mule delayed-execution


【解决方案1】:

您是否尝试过使用 Quartz? 此配置每分钟都会启动您的 JMS 入站

<flow name="ftpFlow2" doc:name="ftpFlow2">
        <quartz:inbound-endpoint jobName="job1" repeatInterval="60000" responseTimeout="10000"     doc:name="Quartz">
        <quartz:endpoint-polling-job>
            <quartz:job-endpoint ref="someQueue"/>
        </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>
    </flow>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-06
    • 2018-06-25
    • 2020-03-28
    • 2015-01-12
    • 2017-02-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多