|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
|
|
How many channel instance consume sendAndReceive jmsTemplate |
« View previous topic :: View next topic » |
Author |
Message
|
metalpalo |
Posted: Mon Oct 30, 2023 12:12 am Post subject: How many channel instance consume sendAndReceive jmsTemplate |
|
|
Newbie
Joined: 03 May 2023 Posts: 7
|
Hi,
Our springboot application connects to IBM server based on configured MQConnectionFactory like this(it seems that sharing conversation is enabled by default):
Code: |
Bean
public ConnectionFactory ibmConnectionFactory(IbmConnectorProperties connectorProperties)
throws JMSException {
//IbmConnectorProperties is my class with properties neccesary for connection
MQConnectionFactory factory = new MQConnectionFactory();
factory.setHostName(connectorProperties.getHostname());
factory.setPort(connectorProperties.getPort());
factory.setQueueManager(connectorProperties.getQueueManager());
factory.setChannel(connectorProperties.getChannel());
factory.setTransportType(WMQConstants.WMQ_CM_CLIENT);
factory.setMQConnectionOptions(MQConstants.MQPMO_NONE);
return factory;
}
|
Then via jmsTemplate send message and wait for response based on correlationID(request response pattern)
When I tried it and we waiting for response for longer time e.g. 100s I see in Ibm Explorer two application connection for given channel. After delivery the response message, both rows from application connection view are dispapeared.
When I call two sendAndReceive I saw 4 application connections and so on...
My question is: What does meant these two rows?
Two used channel instances? Or only one when both connections are shared - that meand only one instance is used?
What in the case the application send 200 identical request-response calls to Ibm Server?
We have problem that server is set to max 10 channel instances(share conversation is 10) and we got error that max channel instance exceeded.
thanks
brpalo
Last edited by metalpalo on Mon Oct 30, 2023 3:56 am; edited 1 time in total |
|
Back to top |
|
|
hughson |
Posted: Mon Oct 30, 2023 2:14 am Post subject: |
|
|
Padawan
Joined: 09 May 2013 Posts: 1949 Location: Bay of Plenty, New Zealand
|
Can you be clear whether you are looking at channel status or application connection displays in MQ Explorer?
If you see two rows in application connection displays, then your application has made two MQCONN(X) calls (at the lowest level). Both these connections may be using the same running channel instance (and so you would see one row in a channel status display).
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
|
metalpalo |
Posted: Mon Oct 30, 2023 3:14 am Post subject: |
|
|
Newbie
Joined: 03 May 2023 Posts: 7
|
Hi,
I meant application connections, there are displayed two rows(only one has objectName matching queue name for receive message based correlationId)
Q1:What is purpose of these two connections? Is this correct behaviour right?
Let say 10 sendAndReceive means 20 application connections.
Thanks for channelStatus hint, you are right there is only one row with 2 current conversations.
Q2: Does "Channel Status" panel show list of currently used channels instances?
But I tried to call 10 sendAndReceive and expected 2 channel instances both with full conversations 10. But result is 4 channel instances with current conversations 4,7,7,2
Q3: Why channel instances are not better reused?
thanks
brpalo |
|
Back to top |
|
|
hughson |
Posted: Mon Oct 30, 2023 8:08 pm Post subject: |
|
|
Padawan
Joined: 09 May 2013 Posts: 1949 Location: Bay of Plenty, New Zealand
|
metalpalo wrote: |
I meant application connections, there are displayed two rows(only one has objectName matching queue name for receive message based correlationId) |
Thanks for the clarification
metalpalo wrote: |
Q1:What is purpose of these two connections? Is this correct behaviour right?
Let say 10 sendAndReceive means 20 application connections. |
This behaviour is correct. A JMSConnection makes a connections to MQ, and also a JMSSession makes a connection to MQ. So with one JMSConnection and one JMSSession you would expect two connection to MQ - one which has opened the queue (that would be the JMSSession) and one that has not opened a queue - that would be the JMSConnection.
metalpalo wrote: |
Thanks for channelStatus hint, you are right there is only one row with 2 current conversations.
Q2: Does "Channel Status" panel show list of currently used channels instances? |
Yes - when MQ uses the word "Status" it generally means the running or "in-use" version of an object. The other view of things is the "definition'. So you have a channel definition and then you have the running instances of it (the status). There are many situations when one definition can result in multiple running instances - a SVRCONN channel is a common one.
metalpalo wrote: |
But I tried to call 10 sendAndReceive and expected 2 channel instances both with full conversations 10. But result is 4 channel instances with current conversations 4,7,7,2
Q3: Why channel instances are not better reused? |
You'll have to tell us a little bit more about how you ran the 10 calls to sendAndReceive, since I don't understand your environment. Bear in mind that channels can only be shared when the client side process is the same (and perhaps it goes without saying, the targeted queue manager is the same). It would seem that you might be running in some kind of hosting environment that means that client side process is the same for multiple runs of the sendAndReceive application, since you are getting more than 2 connections per channel instance in some cases but without understanding that I can't explain it.
Hope some of the above explanation helps and please come back with more questions or extra details that might help us to explain some of the remaining questions.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
|
metalpalo |
Posted: Mon Oct 30, 2023 9:48 pm Post subject: |
|
|
Newbie
Joined: 03 May 2023 Posts: 7
|
Thank for explanation
My note for your question on Q3:
I started my springboot application on my local machine and fire 10 sendAndReceive operations so everything should be run inside one process right? I connect to identical queueManager and channel
Q4: I have another one question regarding second springboot application that listening on messages from another queue.
It is configured that 5 consumers are attached to listener class with identical setting of MQConnectionFactory(identical queue manager and channel). Spring DefaultMessageListenerContainer is used for this purpose.
When I run it I see 6 application connections and 5 used channel instance with current sharing 1,1,1,1,2
Why only one channel instance with 6 conversation is not used instead? |
|
Back to top |
|
|
hughson |
Posted: Tue Oct 31, 2023 1:56 am Post subject: |
|
|
Padawan
Joined: 09 May 2013 Posts: 1949 Location: Bay of Plenty, New Zealand
|
Could there be the possibility of more connections than you have mentioned. We have not seen your code so we don't know. Perhaps there is another JMSSession that is closed off again soon after? Thus "filling up" the slots in the count up to 10 before a new channel instance is used? But then by the time you look at the counts, it has been closed?
Also remember that it is possible to cause sharing not to happen at the client side too. The client can disable it deliberately, or it can be turned off because some necessary features are not available.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
|
fjb_saper |
Posted: Tue Oct 31, 2023 5:31 pm Post subject: |
|
|
Grand High Poobah
Joined: 18 Nov 2003 Posts: 20736 Location: LI,NY
|
You specify Springboot, but you are not using the right patterns. You should be using a cached or pooled ConnectionFactory to get to the result you are looking for. Just using the ConnectionFactory will have you churn the connections for nothing... _________________ MQ & Broker admin |
|
Back to top |
|
|
metalpalo |
Posted: Wed Aug 28, 2024 6:39 am Post subject: |
|
|
Newbie
Joined: 03 May 2023 Posts: 7
|
yep you are right, single connection or cashing(session or produces) give us better results regarding. I've tested it and it works fine, but generally we cannot switch it accross all components.
But what I found that when upgrading to newest driver 9.3.5.1 instead of original one I got better population of channel instance conversations.
My original question(partly) was why Spring application with DefaultMessageListenerContainer with 5 consumers uses 5 channel instance with current sharing 1,1,1,1,2. After upgrade, it use only one channel instance with 6 conversations. Also parallel sendAndReceive gives use better results, that means, less used channel instances with better conversation population.
Could you confirm that something changes in newest driver? |
|
Back to top |
|
|
|
|
|
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|