ibm-messaging / mq-jms-spring

Components to assist MQ JMS integration with Spring frameworks
Apache License 2.0
189 stars 102 forks source link

How to use auto-reconnect #75

Closed talljhawkins closed 2 years ago

talljhawkins commented 3 years ago

Hi, we currently use vanilla spring JMS to do asynch message receive and it fails to reconnect properly to a multi-instance windows configuration . After much investigation I think bad connections are being re-used - e.g. a connection will be made to a QM and the asynchronous attribute will be inactive. Therefore, although connected, no messages are being received. What would be the best way to do asynch recieve with auto-reconnect with this library please?

thanks, John.

Viserius commented 2 years ago

Hi @talljhawkins Can you share how you configured your connection factory? I suspect you might be using a CachingConnectionFactory with the property cacheConsumers set to true, which is the default. According to https://stackoverflow.com/posts/21989895/revisions and https://docs.spring.io/spring-framework/docs/5.3.x/javadoc-api/, you should set this property explicitly to false.

talljhawkins commented 2 years ago

HI, gosh - this was a long-time ago. We got over it in the end and I agree. I think it was all to do with caching consumers - but I can't remember exactly. I remember that I stripped it right back and it appears to work OK now. Thanks for getting back though !