Author |
Message
|
FrodGandalf |
Posted: Mon May 15, 2006 1:13 pm Post subject: onMessage()not recieving messages after Inactive period |
|
|
Newbie
Joined: 06 Apr 2006 Posts: 7
|
Hi,
I have a 24x7 application running on AIX box. It uses the MQ JMS API's to register a JMS listener to a queue. This listener gets the messages and processes them.
This works fine. But sometimes the 24x7 JMS listener does not get any messages even though there are messages on that queue.
I checked the queue using BrowserQueue and browsed the messages on it and there 4 messages. But at the same time the 24x7 JMS listener was not gettign the messages.
I then restarted my 24x7 application and then it was able to read those 4 messages immediately. The last message that the 24x7 application recieved was on May 12. It then did not recieve any messages on May 15 till i restarted it today.
What could be the problem here? Is the MQ Connection or session timing out after an Inactive period?
Any help will be appreciated
Rgds,
FG |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 15, 2006 5:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Are you sure that the connection did not go into a "stopped" state. Please make sure there is no confusion with a "closed" state.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
FrodGandalf |
Posted: Tue May 16, 2006 10:23 am Post subject: |
|
|
Newbie
Joined: 06 Apr 2006 Posts: 7
|
How can I check if the connection has gone to a stopped state?
The application does not stop the connection when it is running. But when the 24x7 application is shut down then at that time I stop the connection, close the consumer, close the session and close the connection.
Also, is there any maximum idle time after which the connection is lost? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 16, 2006 1:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
FrodGandalf wrote: |
How can I check if the connection has gone to a stopped state?
The application does not stop the connection when it is running. But when the 24x7 application is shut down then at that time I stop the connection, close the consumer, close the session and close the connection.
Also, is there any maximum idle time after which the connection is lost? |
Idle time and closed connection might strongly depend on your firewall.
I like to have web connections as server connections but this is not always possible.
If you get only sporadic messages it might be more advantageous to have a triggered program, then having an mdb.
Enjoy.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
FrodGandalf |
Posted: Sun May 21, 2006 7:44 pm Post subject: |
|
|
Newbie
Joined: 06 Apr 2006 Posts: 7
|
In my case the messages are frequent and need to be processed as soon as they are present in the queue.
I have found the problem -
The MessageListener was listening to messages in a Queue. Then the MQServer went gone down and came back. But the MessageListener continued to listen to a dead channel and so was not able to recieve the new messages in the queue.
I have now implemented the ExceptionListener so that the application will be notified when the MQ server goes down gracefully.
But if the MQ server crashes or if the TCP/IP connection is broken then would the ExceptionListener be notified?
How can I check if the MQConnection is still open and valid? Is there any way that I can at pre-defined intervals check if the connection is valid?
Thanks,
FG |
|
Back to top |
|
 |
8davitt |
Posted: Tue May 23, 2006 6:04 am Post subject: |
|
|
Apprentice
Joined: 06 Feb 2003 Posts: 37 Location: Seated in front of monitor
|
A quick test shows that if you use an ExceptionListener associated with the Connection then when the MQ Server goes down then the ExceptionListener will receive
javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
/s |
|
Back to top |
|
 |
anandmq |
Posted: Fri Jun 02, 2006 2:09 am Post subject: MQ/JMS communication |
|
|
Newbie
Joined: 02 Jun 2006 Posts: 2
|
All,
Nice to be part of this exclusive MQ group.
We have a Websphere based MQ application and our MDB listens to messages posted on the input Queue.
We are using IBM WebSphere Application Server Version 5.1.0 and MQ- 5.3 with update 12. As such our application works fine.
But at some strange times, we get this sort of errors and after that the MDB stops reading messages.
Once we restart the server/application things work fine again!
Has this to do with some fix in version used ? Any information on this would be great to have.
==============================
[5/31/06 2:33:47:880 PDT] 15b2e86 JMSExceptionL E WMSG0018E: Error on JMSConnection for MDB SiebelMDBBean , JMSDestination jms/SiebelInputQueue : javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
at com.ibm.mq.jms.MQSession.consume(MQSession.java:3234)
at com.ibm.mq.jms.MQSession.run(MQSession.java:1667)
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:923)
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:697)
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:482)
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:449)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:91)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
---- Begin backtrace for Nested Throwables
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
at com.ibm.mq.jms.MQSession.consume(MQSession.java:3206)
at com.ibm.mq.jms.MQSession.run(MQSession.java:1667)
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:923)
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:697)
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:482)
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:449)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:91)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
[5/31/06 2:33:47:919 PDT] 15b2e86 JMSExceptionL E WMSG0057E: Error on JMSConnection for MDB SiebelMDBBean , JMSDestination jms/SiebelInputQueue , JMS Linked Exception : com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
at com.ibm.mq.jms.MQSession.consume(MQSession.java:3206)
at com.ibm.mq.jms.MQSession.run(MQSession.java:1667)
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:923)
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:697)
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:482)
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:449)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:91)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
[5/31/06 2:33:59:653 PDT] 15b2e86 ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adaptor for resource jms/ACESiebelQueueConFactory. The exception which was received is javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
[5/31/06 2:34:00:411 PDT] 432685 ServerSession W WMSG0028E: Exception creating JMS ServerSession for MDB SiebelMDBBean, JMSDestination jms/SiebelInputQueue : Connection invalidated
[5/31/06 2:34:00:633 PDT] 432685 ServerSession W WMSG0028E: Exception creating JMS ServerSession for MDB SiebelMDBBean, JMSDestination jms/SiebelInputQueue : Connection invalidated
[5/31/06 2:34:02:011 PDT] 15b2e86 ServerSession W WMSG0028E: Exception creating JMS ServerSession for MDB SiebelMDBBean, JMSDestination jms/SiebelInputQueue : Connection invalidated
[5/31/06 2:34:02:042 PDT] 15b2e86 ServerSession W WMSG0028E: Exception creating JMS ServerSession for MDB SiebelMDBBean, JMSDestination jms/SiebelInputQueue : Connection invalidated
[5/31/06 2:34:02:083 PDT] 15b2e86 WASLogger E CLASSNAME METHODNAME an internal error has occurred. Please contact your system administrator. Detail: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
[5/31/06 2:34:02:115 PDT] 15b2e86 WASLogger E CLASSNAME METHODNAME an internal error has occurred. Please contact your system administrator. Detail: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
[5/31/06 2:34:02:536 PDT] 15b2e86 MCWrapper E J2CA0081E: Method destroy failed while trying to execute method destroy on ManagedConnection com.ibm.ejs.jms.JMSManagedQueueSession@44c742
physical session = com.ibm.mq.jms.MQQueueSession@3efcc7
session type = NON_TRANSACTED_SESSION
acknowledge mode = AUTO_ACKNOWLEDGE
enlisted = false
open session handles = []
managed session factory = com.ibm.ejs.jms.JMSManagedQueueSessionFactory@c3455c from resource No longer available. Caught exception: javax.resource.spi.ResourceAdapterInternalException: Failed to close session
at com.ibm.ejs.jms.JMSCMUtils.mapToResourceException(JMSCMUtils.java:125)
at com.ibm.ejs.jms.JMSManagedSession.destroy(JMSManagedSession.java:521)
at com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:1310)
at com.ibm.ejs.j2c.poolmanager.FreePool.removeParkedConnection(FreePool.java:523)
at com.ibm.ejs.j2c.poolmanager.PoolManager.quiesce(PoolManager.java:1052)
at com.ibm.ejs.j2c.ConnectionFactoryDetails.freeResources(ConnectionFactoryDetails.java:137)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.freeConnectionFactory(ConnectionFactoryBuilderImpl.java:782)
at com.ibm.ejs.jms.JMSManagedConnection.destroy(JMSManagedConnection.java:648)
at com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:1310)
at com.ibm.ejs.j2c.poolmanager.FreePool.cleanupAndDestroyMCWrapper(FreePool.java:468)
at com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:280)
at com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1219)
at com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1673)
at com.ibm.ejs.j2c.MCWrapper.connectionErrorOccurred(MCWrapper.java:1741)
at com.ibm.ejs.j2c.ConnectionEventListener.connectionErrorOccurred(ConnectionEventListener.java:291)
at com.ibm.ejs.jms.JMSManagedConnection.connectionErrorOccurred(JMSManagedConnection.java:830)
at com.ibm.ejs.jms.JMSManagedConnection.onException(JMSManagedConnection.java:800)
at com.ibm.mq.jms.MQConnection.deliverException(MQConnection.java:1605)
at com.ibm.mq.jms.MQSession$1.run(MQSession.java:3316)
---- Begin backtrace for Nested Throwables
javax.jms.JMSException: MQJMS2003: failed to disconnect queue manager
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
at com.ibm.mq.jms.MQSession.close(MQSession.java:1203)
at com.ibm.ejs.jms.JMSManagedSession.destroy(JMSManagedSession.java:516)
at com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:1310)
at com.ibm.ejs.j2c.poolmanager.FreePool.removeParkedConnection(FreePool.java:523)
at com.ibm.ejs.j2c.poolmanager.PoolManager.quiesce(PoolManager.java:1052)
at com.ibm.ejs.j2c.ConnectionFactoryDetails.freeResources(ConnectionFactoryDetails.java:137)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.freeConnectionFactory(ConnectionFactoryBuilderImpl.java:782)
at com.ibm.ejs.jms.JMSManagedConnection.destroy(JMSManagedConnection.java:648)
at com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:1310)
at com.ibm.ejs.j2c.poolmanager.FreePool.cleanupAndDestroyMCWrapper(FreePool.java:468)
at com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:280)
at com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1219)
at com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1673)
at com.ibm.ejs.j2c.MCWrapper.connectionErrorOccurred(MCWrapper.java:1741)
at com.ibm.ejs.j2c.ConnectionEventListener.connectionErrorOccurred(ConnectionEventListener.java:291)
at com.ibm.ejs.jms.JMSManagedConnection.connectionErrorOccurred(JMSManagedConnection.java:830)
at com.ibm.ejs.jms.JMSManagedConnection.onException(JMSManagedConnection.java:800)
at com.ibm.mq.jms.MQConnection.deliverException(MQConnection.java:1605)
at com.ibm.mq.jms.MQSession$1.run(MQSession.java:3316)
---- Begin backtrace for Nested Throwables
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
at com.ibm.mq.StoredManagedConnection.connectionClosed(StoredManagedConnection.java:258)
at com.ibm.mq.MQManagedConnectionJ11.fireConnectionClosedEvent(MQManagedConnectionJ11.java:713)
at com.ibm.mq.MQQueueManager.disconnect(MQQueueManager.java:1009)
at com.ibm.mq.jms.MQSession.close(MQSession.java:1198)
at com.ibm.ejs.jms.JMSManagedSession.destroy(JMSManagedSession.java:516)
at com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:1310)
at com.ibm.ejs.j2c.poolmanager.FreePool.removeParkedConnection(FreePool.java:523)
at com.ibm.ejs.j2c.poolmanager.PoolManager.quiesce(PoolManager.java:1052)
at com.ibm.ejs.j2c.ConnectionFactoryDetails.freeResources(ConnectionFactoryDetails.java:137)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.freeConnectionFactory(ConnectionFactoryBuilderImpl.java:782)
at com.ibm.ejs.jms.JMSManagedConnection.destroy(JMSManagedConnection.java:648)
at com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:1310)
at com.ibm.ejs.j2c.poolmanager.FreePool.cleanupAndDestroyMCWrapper(FreePool.java:468)
at com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:280)
at com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1219)
at com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1673)
at com.ibm.ejs.j2c.MCWrapper.connectionErrorOccurred(MCWrapper.java:1741)
at com.ibm.ejs.j2c.ConnectionEventListener.connectionErrorOccurred(ConnectionEventListener.java:291)
at com.ibm.ejs.jms.JMSManagedConnection.connectionErrorOccurred(JMSManagedConnection.java:830)
at com.ibm.ejs.jms.JMSManagedConnection.onException(JMSManagedConnection.java:800)
at com.ibm.mq.jms.MQConnection.deliverException(MQConnection.java:1605)
at com.ibm.mq.jms.MQSession$1.run(MQSession.java:3316)
==============================
Thanks a lot
Anand |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 02, 2006 2:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks to me like the qmgr was recycled before the MDB was stopped. Make sure you have FailIfQuiescing in your JNDI setup for the QCF and the MDB.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
anandmq |
Posted: Sun Jun 04, 2006 8:43 pm Post subject: MQ messages |
|
|
Newbie
Joined: 02 Jun 2006 Posts: 2
|
Thanks for the immediate reply.
I could not quite understand this FailIfQuiescing part. I did not find any such parameter in the JNDI set up in the WAS admin for either the MDB or the QueueConnectionFactory.
Could u reply in greater detail or even if u can send some reference links it would be fine.
Thanks a lot
Anand |
|
Back to top |
|
 |
|