Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XA making multiple connections with MQ manager #95

Closed
ramit21 opened this issue May 18, 2018 · 3 comments
Closed

XA making multiple connections with MQ manager #95

ramit21 opened this issue May 18, 2018 · 3 comments

Comments

@ramit21
Copy link

ramit21 commented May 18, 2018

We are using XA as a transaction manager in our spring boot application for all our IBM Websphere MQ based flows including DB operations. But our application is making multiple connections (1000+ each day) with the queue manager. This is despite the fact that we are using poolsize of 25 in PoolingConnectionFActory settings. Can someone please advise on the possible reasons?
Is it that connections are not getting closed properly, or is it the 2 phase commit protocol of XA creating multiple pings to connection?

@ramit21
Copy link
Author

ramit21 commented May 21, 2018

Can anyone please help above.

@fall14123
Copy link

fall14123 commented Oct 4, 2018

@ramit21 which WMQ (or rebranded as IBM MQ...) version are you using on client and server side? We tried using [v9 client + v6 server] and saw multiple connection attempts within a single XAQueueConnectionFactory#createXAConnection().

IBM KC suggests using "migration mode" (ref. link), but doesn't seem help us out yet....

Also asked in https://stackoverflow.com/questions/52655619/wmq-connection-socket-constantly-closed-between-v9-client-and-v6-server?noredirect=1#comment92601694_52655619, in case it's helpful to someone.

@ramit21
Copy link
Author

ramit21 commented Nov 16, 2018

Hi @fall14123 , we are using version 8 of MQ. Tried playing around with providerVersion as suggested by you, but no luck. In fact giving provierVersion as 6 only made things worse and more connections leaked. One difference between your code (as on stackoverflow link) and ours is that we are using Bitronix PoolingConnectionFactory for JMS and PoolingDataSource for DB connections. Another observation is that connections leak when we either produce or consume messages concurrently (a burst of messages). For some reason, PoolingConnectionFactory is not honouring the poolsize that we have given as 20.

PoolingConnectionFactory connectionFactory = new PoolingConnectionFactory();
connectionFactory.setClassName("com.ibm.mq.jms.MQXAQueueConnectionFactory");
connectionFactory.setUniqueName(XA_FACTORY_NAME);
connectionFactory.setAllowLocalTransactions(false);
connectionFactory.setTestConnections(true);
connectionFactory.setUser(user);
connectionFactory.setPassword(password);
connectionFactory.setMaxPoolSize(20);
Properties driverProperties = connectionFactory.getDriverProperties();
driverProperties.setProperty("port", ...);
driverProperties.setProperty("transportType", ...);
driverProperties.setProperty("channel", ...);
driverProperties.setProperty("hostName", ...);
driverProperties.setProperty("queueManager", ...);

All at sea with this connection leak issue. Rasied it with more details on StackOverflow as well - https://stackoverflow.com/questions/53334069/bitronix-poolingconnectionfactory-making-multiple-connections-that-wont-close

@lorban lorban closed this as completed Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants