-1

I am trying to listen to a Solace End Point using Sping Boot and when ran my app i am getting the Error:

2018-09-28 03:16:57.446  WARN 27305 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'TEST1.OUT' - trying to recover. Cause: Error creating session - operation not supported on router (Capability Mismatch: Router does not support transacted sessions.)

Is there a config argument that i can set to not to use transaction sessions.

Thanks

Sateesh K
  • 1,071
  • 3
  • 19
  • 45

2 Answers2

2

You will need to create a JmsListenerContainerFactory that does not make use of transactions. For example:

@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(
        ConnectionFactory connectionFactory,
        DefaultJmsListenerContainerFactoryConfigurer configurer) {
    DefaultJmsListenerContainerFactory listenerFactory =
            new DefaultJmsListenerContainerFactory();
    configurer.configure(listenerFactory, connectionFactory);
    listenerFactory.setTransactionManager(null);
    listenerFactory.setSessionTransacted(false);
    return listenerFactory;
}

Full details can be found in the spring boot docs.


Do note that the Solace message broker supports transactions(local and XA).

To enable local transactions:

  1. Enable allow‑transacted‑sessions in the client-profile used by your username.
  2. Disable direct transport in your JMS connection factory.

Full details can be found in the Solace documentation.

Russell Sim
  • 1,693
  • 2
  • 14
  • 22
0

Excellent answer.

To complement Russell answer, in the method which will handle the consume, in the annotation, we must specify the container factory bean created in the last step.

@JmsListener(destination = "TOPIC.TRX_PAYMENT", containerFactory = "jmsListenerContainerFactory")
Abimael
  • 1
  • 1