我有一个要求,我想每5分钟轮询一次JMS队列,并使用jms队列中的所有消息。我试图在骡子中这样做:
<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