Author |
Message
|
deb |
Posted: Wed Jul 18, 2007 12:55 am Post subject: Connection stop problem |
|
|
 Novice
Joined: 18 Jul 2007 Posts: 18 Location: Germany
|
Hello,
I am using MQSeris 5.3 (AIX) with Weblogic 8.1 (Windows XP)
My problem is whenever i start a connection as below:
##############################################
Context context = new InitialContext();
QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup("MyConnectionFactory");
QueueConnection queueConnection = queueFactory.createQueueConnection();
QueueSession queueSession = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
Queue queue = (Queue) context.lookup("MyQueue");
QueueReceiver queueReceiver = queueSession.createReceiver(queue);
queueReceiver.setMessageListener(this);
queueConnection.start();
##############################################
A new connection is created and i can see a new process in created
in the AIX machine where my MQSeries is installed as below:
mqm 2457784 393348 0 15:41:04 - 0:00 amqcrsta -m MyQmanager
But when i try to stop the connection as below:
##############################################
try {
queueSession.commit();
queueConnection.stop();
} finally {
queueConnection = null;
}
##############################################
The connection seem to stop on the client side as messages are not
received from the queue after that. But the below process continues
to live on the MQSeries installed server:
mqm 2457784 393348 0 15:41:04 - 0:00 amqcrsta -m MyQmanager
As a result of which whenever i do a start and stop a new process is
created and continues to live. This is creating problem for me as because
of this it exceeds the maximum connection allowed from the MQSeries which i have configured to be 1000 in the qm.ini file.
Any help or suggestion would be greatly appreciated.
Many thanks in advance.
Deb |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 18, 2007 1:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Which version of v5.3 are you using? Are you using connection pooling in Weblogic, and if so how is it configured? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
deb |
Posted: Wed Jul 18, 2007 1:17 am Post subject: |
|
|
 Novice
Joined: 18 Jul 2007 Posts: 18 Location: Germany
|
Hello,
I am using IBM WebSphere MQ for AIX, Version 5.3
No i am not using connection pooling in weblogic.
Regards
Deb |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 18, 2007 1:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
deb wrote: |
I am using IBM WebSphere MQ for AIX, Version 5.3 |
Apologies for being inexplicit. What CSD is it patched to? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
deb |
Posted: Wed Jul 18, 2007 1:30 am Post subject: |
|
|
 Novice
Joined: 18 Jul 2007 Posts: 18 Location: Germany
|
It is Fix Pack 10 (CSD10)
Regards
Deb |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 18, 2007 2:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Right - before we start, understand Java is not my thing. Advice should be viewed with that clearly understood. Especially if you think I'm talking rubbish, because I may well be.
From that, why are you using the stop method of the queueConnection rather than the close method? Doesn't stop just stop the data while some kind of Java recovery cleanup thing happens, so you can use start to resume the flow? Don't you need to use close to terminate the link and release the resources, stopping the process? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
deb |
Posted: Wed Jul 18, 2007 2:46 am Post subject: |
|
|
 Novice
Joined: 18 Jul 2007 Posts: 18 Location: Germany
|
I don't disagree with you, yes there is a stop and a close method and i have used both, but i still have the same problem even when i use the
close method.
Regards
Deb |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 18, 2007 3:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Then you've either found a bug, which may require a more recent CSD (always a good idea when you're using Java) or you need someone who knows more about the queueConnection object than I do.
Such a person will not be hard to find in here.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
deb |
Posted: Wed Jul 18, 2007 4:21 am Post subject: |
|
|
 Novice
Joined: 18 Jul 2007 Posts: 18 Location: Germany
|
Ok let say this is a Java issue as JMS is not able to terminate the below
process:
mqm 2457784 393348 0 15:41:04 - 0:00 amqcrsta -m MyQmanager
But is there a way to find any unused connection and eliminate these
amqcrsta -m MyQmanager processes started by inetd.
Regards
Deb |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 18, 2007 4:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jul 18, 2007 4:33 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I would look for bugs in the version of WebLogic you're using.
It should be creating and storing only a few (equal to the connection pool size) channels, and passing those to your JMS code.
I seem to remember some old posts in the Java/JMS forum here about some weblogic bugs. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 18, 2007 4:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Vitor wrote: |
Are you using connection pooling in Weblogic, and if so how is it configured?
|
deb wrote: |
No i am not using connection pooling in weblogic.
|
jefflowrey wrote: |
It should be creating and storing only a few (equal to the connection pool size) channels, and passing those to your JMS code.
|
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
deb |
Posted: Wed Jul 18, 2007 4:46 am Post subject: |
|
|
 Novice
Joined: 18 Jul 2007 Posts: 18 Location: Germany
|
Thanks Victor,
the links u provided does answer one of my question regarding the
unused process. Also i will use runmqlsr instead of inetd. Some of my
analysis regarding this issue now cleared that the problem is not on
MQSeries side but on the JMS client.
@jefflowrey,
Somewhere i read that if we call the connection close() method
inside the onMessage method of the listener class it hangs, After
analysys i found that this is happening in my case, the close method
hangs and the connection is never closed. Is there a fix to this so that
the close() method is successfully executed. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 18, 2007 4:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
deb wrote: |
Somewhere i read that if we call the connection close() method inside the onMessage method of the listener class it hangs, After
analysys i found that this is happening in my case, the close method
hangs and the connection is never closed. Is there a fix to this so that
the close() method is successfully executed. |
I said you should be using the close method! Yay me!
You should try moving to the latest CSD. It's always a valid strategy, especially with MQ/Java problems. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
deb |
Posted: Wed Jul 18, 2007 5:02 am Post subject: |
|
|
 Novice
Joined: 18 Jul 2007 Posts: 18 Location: Germany
|
Vitor,
As i said the problem is not on the MQSeries side, its on the JMS side.
However when u are using a local JMS connection factory in weblogic
you have a checkbox in the console "Allow Close In On Message" and this
makes the close() method not to hang when called inside onMessage
method of the listener, but the same is not available in case of a weblogic
Foreign JMS server configuration for MQSeries and right now this is the
problem!!!
Where do i configure "Allow Close In On Message" for MQSeries in the JMS
client. |
|
Back to top |
|
 |
|