1

我有一个要求,我想每 5 分钟轮询一次 JMS 队列并使用 jms 队列中的所有消息。我正在尝试在 mule 中执行以下操作:

        <jms:inbound-endpoint queue="jmsqueue" exchange-pattern="one-way" >
             <properties>
                  <spring:entry key="pollingFrequency" value="100000" />
             </properties>
        </jms:inbound-endpoint>

上面的代码正在工作,但它忽略了 pollingFrequency 属性。

有人可以帮我如何在 Mule 中设置 JMS 队列的轮询频率吗?

上述问题已解决。但是通过我的修复,我遇到了以下异常:

WARN  2013-05-01 15:04:05,268 [jmsConnector.receiver.14] com.mulesoft.mule.transport.jms.TransactedPollingJmsMessageReceiver: Error in TX notification handler.
javax.jms.IllegalStateException: The session is closed.
    at progress.message.jimpl.Session.getJMSObjectClosedException(Session.java:3341)
    at progress.message.jimpl.Session.commit(Session.java:1022)
    at progress.message.jimpl.Session.commit(Session.java:1008)
    at progress.message.jimpl.Session.commit(Session.java:969)
    at com.mulesoft.mule.transport.jms.TransactedPollingJmsMessageReceiver$2.onNotification(TransactedPollingJmsMessageReceiver.java:314)
    at com.mulesoft.mule.transport.jms.TransactedPollingJmsMessageReceiver$2.onNotification(TransactedPollingJmsMessageReceiver.java:298)
    at org.mule.context.notification.Sender.dispatch(Sender.java:40)
    at org.mule.context.notification.Policy.dispatch(Policy.java:122)
    at org.mule.context.notification.ServerNotificationManager.notifyListeners(ServerNotificationManager.java:249)
    at org.mule.context.notification.ServerNotificationManager.fireNotification(ServerNotificationManager.java:200)
    at org.mule.DefaultMuleContext.fireNotification(DefaultMuleContext.java:435)
    at org.mule.transaction.AbstractTransaction.fireNotification(AbstractTransaction.java:144)
    at org.mule.transaction.AbstractTransaction.commit(AbstractTransaction.java:83)
    at org.mule.transaction.AbstractSingleResourceTransaction.commit(AbstractSingleResourceTransaction.java:79)
    at org.mule.transaction.TransactionCoordination.resolveTransaction(TransactionCoordination.java:222)
    at org.mule.execution.BeginAndResolveTransactionInterceptor.resolveTransactionIfRequired(BeginAndResolveTransactionInterceptor.java:77)
    at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:59)
    at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:48)
    at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:54)
    at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:44)
    at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:44)
    at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:52)
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:32)
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:17)
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:113)
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:34)
    at com.mulesoft.mule.transport.jms.TransactedPollingJmsMessageReceiver.poll(TransactedPollingJmsMessageReceiver.java:110)
    at org.mule.transport.AbstractPollingMessageReceiver.performPoll(AbstractPollingMessageReceiver.java:219)
    at org.mule.transport.PollingReceiverWorker.poll(PollingReceiverWorker.java:84)
    at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:53)
    at org.mule.work.WorkerContext.run(WorkerContext.java:311)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

请帮我解决这个问题。

谢谢,vkumar

4

1 回答 1

0

have you tried by increasing the response timeout enter image description here

You can also configure the Reconnection Strategy if your connection is lost

于 2015-10-26T12:33:50.230 回答