Сбой пакетной обработки Apache Camel sjms - PullRequest
0 голосов
/ 01 июня 2018

Я пытаюсь использовать компонент sjms Camel для интеграции с IBM MQ.Настройка компонента jms с transacted = false работает просто отлично.Пока я пытаюсь использовать пакетные функции, он начинает отказывать.

Заранее спасибо ...

Конечная точка DSL:

sjmsComponent://queue:XXX?acknowledgementMode=AUTO_ACKNOWLEDGE&consumerCount=10&transacted=true&transactionBatchCount=10&transactionBatchTimeout=10000

Конфигурация:

@Scope(scopeName = "prototype")
@Bean
public JmsConnectionFactory connectionFactory() throws JMSException
{
    MQQueueConnectionFactory mqQueueConnectionFactory = new MQQueueConnectionFactory();
    mqQueueConnectionFactory.setTransportType(this.mqTransportType);
    mqQueueConnectionFactory.setHostName(this.mqHostName);
    mqQueueConnectionFactory.setPort(this.mqPort);
    mqQueueConnectionFactory.setQueueManager(this.mqQueueManager);
    mqQueueConnectionFactory.setChannel(this.mqChannel);
    return mqQueueConnectionFactory;
}
    @Scope(scopeName = "prototype")
    @Bean
    public SjmsComponent sjmsComponent(ConnectionFactory connectionFactory) throws JMSException
    {
        SjmsComponent sjmsComponent = new SjmsComponent();
        sjmsComponent.setConnectionFactory(connectionFactory);
        return sjmsComponent;
    }

Из-за предупреждений в журналах ниже сообщения не передаются и в конечном итоге остаются в MQ.

Warning in logs : 

Failed to commit the session during timeout: JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously: 'commit'.. This exception will be ignored.
com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously: 'commit'.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)
    at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:226)
    at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:126)
    at com.ibm.msg.client.jms.internal.JmsSessionImpl.checkSynchronousUsage(JmsSessionImpl.java:2959)
    at com.ibm.msg.client.jms.internal.JmsSessionImpl.commit(JmsSessionImpl.java:753)
    at com.ibm.mq.jms.MQSession.commit(MQSession.java:294)
    at org.apache.camel.component.sjms.tx.SessionBatchTransactionSynchronization$TimeoutTask.run(SessionBatchTransactionSynchronization.java:135)
    at java.util.TimerThread.mainLoop(Timer.java:555)
...