ibm-messaging / mq-jms-spring

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

IBM-MQ (ibm.mq.allclient:jar:9.2.2.0) Spring Boot dynamic listener fails with too many MQ connections with compcode '2' ('MQCC_FAILED') reason 2537 #76

Open mohamed-rafii opened 3 years ago

mohamed-rafii commented 3 years ago

Please include the following information in your ticket.

Problem Statement: We manually create the listeners for multiple queues when the system starts. What we face problem was the channel has got 10 conversations by default. Each connection takes 2 conversations and after 5 messages that channel connection is not processing any messages. We configured the 100 channels and it gets exhausted. Not sure how we can release the conversation.

for reference - https://stackoverflow.com/questions/69982367/ibm-mq-ibm-mq-allclientjar9-2-2-0-spring-boot-dynamic-listener-fails-with-to

chughts commented 3 years ago

Are you saying that each invocation of your OnMessage method eats up a connection? If so then this is odd, as Spring should be managing these for you. If each invocation is consuming a connection then this indicates something wrong in your OnMessage.

Spring handles Open / Close, and if you have factory.setSessionTransacted(true) it will handle commit and rollback also. Commit if the method ends normally, Rollback if it throws an exception.

So the logic that you have added eg.

TransactionStatus status = jmsTransactionManager.getTransaction(null);

seems redundant. Have you tried without these lines? You will need to rethrow the exception you catch to allow Spring to detect it.

mohamed-rafii commented 3 years ago

Hi

Removed the transaction, still the same

Thanks Rafi

Sent from my iPhone

On 19 Nov 2021, at 11:02, Soheel Chughtai @.***> wrote:

 Are you saying that each invocation of your OnMessage method eats up a connection? If so then this is odd, as Spring should be managing these for you. If each invocation is consuming a connection then this indicates something wrong in your OnMessage.

Spring handles Open / Close, and if you have factory.setSessionTransacted(true) it will handle commit and rollback also. Commit if the method ends normally, Rollback if it throws an exception.

So the logic that you have added eg.

TransactionStatus status = jmsTransactionManager.getTransaction(null); seems redundant. Have you tried without these lines? You will need to rethrow the exception you catch to allow Spring to detect it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.