Author |
Message
|
newtomq22 |
Posted: Fri Aug 12, 2005 12:33 pm Post subject: Msgs not getting picked up after a while... |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
Hi,
I am new in terms of mq design and performance issues and i am having this problem where the msgs stop being processed after a while..( they just stay there is the inbound q).. This is someone else's code and i cannot figure out what the problem is. When the server starts the msgs get processed fine but after a few days/weeks the application totally stops processing the msgs and the msgs just keep piling on the q. I don't see any error msgs or anything which could help. The way it's been implemented is that on the server start up a servlet starts a scheduled job.
=======================================
timerReceiver = new Timer();
timerReceiver.schedule(new XMLMsgReceiver(), secXmlMsgsReceiveInitialDelay * 1000, secXmlMsgsReceiveInterval * 1000);
=========================================
and the run() method of this class "XMLMsgReceiver" basically has this
=========================================
if(!XMLMsgReceiver.isRunning) {
debug("starting the MQ listener ");
this.startListener();
}
else
debug("MQ listener is already UP");
=========================================
calls startListener() method which has the following code
==========================================
XMLMsgReceiver.isRunning = true;
QueueConnection connection = null;
QueueSession session = null;
try {
Context context = new InitialContext();
QueueConnectionFactory factory =
(QueueConnectionFactory) context.lookup(
MsgConstants.QUEUE_CONNECTION_FACTORY_NAME);
Queue queue = (Queue) context.lookup(MsgConstants.INBOUND_QUEUE_NAME);
connection = factory.createQueueConnection();
session = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
QueueReceiver receiver = session.createReceiver(queue);
connection.start();
Message m = null;
int counter = 0;
while (true) {
counter++;
try{
m = receiver.receive(1);
if (m == null)
break;
isMsgReceived = true;
if (m instanceof TextMessage) {
processMessage(m);
}
else
SchLogger.MQ.debug("Strange...not a text message " + m);
}catch(Exception e){
SchLogger.MQ.info("Exception thrown in startListener() method " + e);
}
if(counter == 500) {
SchLogger.MQ.debug("committing after 500");
try {
session.commit();
} catch (Exception e1) {
e1.printStackTrace();
}
counter = 0;
}
}
} catch (Throwable je) {
je.printStackTrace();
} finally {
if(session != null){
try {
session.commit();
session.close();
} catch (JMSException ignored) {
}
session = null;
}
if (connection != null) {
try {
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
XMLMsgReceiver.isRunning = false;
}
Please advice!! If you can direct me to some docs which could help me resolving this issue that would also be great!!!
TIA, |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Aug 12, 2005 1:18 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
What version of WMQ are you using and what operating system? There are some known JMS problems about messages not getting picked up that have been fixed. |
|
Back to top |
|
 |
newtomq22 |
Posted: Fri Aug 12, 2005 1:22 pm Post subject: |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
I am using WMQ 5.3 and the OS is AIX... |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 12, 2005 2:14 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What fixpack level of MQ 5.3? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
newtomq22 |
Posted: Mon Aug 15, 2005 6:58 am Post subject: |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
i don't have the access to run the command off production so i ran it off our staging env ( hopefully it shud be identical...) i can get it off production but it wud take me some time...
i ran the dspmqver command ( plz let me know if there is a better way of getting the version...) and i got this
Name: WebSphere MQ
Version: 530.7 CSD07
CMVC level: p530-07-L040527
BuildType: IKAP - (Production)
Thanks a lot for your prompt responses... |
|
Back to top |
|
 |
vennela |
Posted: Mon Aug 15, 2005 9:58 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
plz let me know if there is a better way of getting the version |
Maybe not a better way but an alternative on AIX
Code: |
lslpp -L | grep mqm |
|
|
Back to top |
|
 |
newtomq22 |
Posted: Mon Aug 15, 2005 10:06 am Post subject: |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
i m sorry guys..i gave u the OS of our websphere server...for mq we have sun solaris as the OS...
Sorry  |
|
Back to top |
|
 |
newtomq22 |
Posted: Mon Aug 15, 2005 12:50 pm Post subject: |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
Like i said, on production we have the same version
Name: WebSphere MQ
Version: 530.7 CSD07
CMVC level: p530-07-L040527
BuildType: IKAP - (Production) |
|
Back to top |
|
 |
newtomq22 |
Posted: Tue Aug 16, 2005 7:14 am Post subject: |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
Can someone please tell me what type of bugs existed which have been fixed and if i have to apply the patch or not or where i could get the information about the bugs/patch?
TIA, |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Aug 16, 2005 7:22 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
newtomq22 |
Posted: Tue Aug 16, 2005 7:31 am Post subject: |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
but these seem to be associated with MDBs and i don't use MDBs and moreever i don't see any error msgs in the logs too...
did u find any issue with the code? am i committing the session unnecessarily or doing something else which i shud be doing which could be causing this issue? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 16, 2005 11:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well there are many parts to this question:
The program as described is engineered to do:
in the run method (i imagine the class implements Runnable)
The thread opens the connection to MQ.
Sets the loop for receiving messages
Processes text messages
commits every 500 msgs and on exit
exits loop if queue empty
closes the connection // resource cleanup
end of run method-- thread dies
So from a programming point of view everything seems fine.
However you will have to schedule this program often....
You could have had it triggered.
If it runs inside WAS you should be using MDB...
Of course it is dependant on network problems if it runs as a client and on maxconnection/max channels factor depending on general load of the qmgr....
 |
|
Back to top |
|
 |
newtomq22 |
Posted: Mon Aug 29, 2005 1:46 pm Post subject: |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
It runs inside WAS but i can't use MDB because i need to maintain the sequence of messages.
you say
=======================================
Of course it is dependant on network problems if it runs as a client and on maxconnection/max channels factor depending on general load of the qmgr....
=========================================
How can i know what the thresholds are for it to stop picking the messages?Could you please explain more on that or give me links to some docs where this topic is covered?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Aug 29, 2005 6:24 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
newtomq22 wrote: |
It runs inside WAS but i can't use MDB because i need to maintain the sequence of messages.
you say
=======================================
Of course it is dependant on network problems if it runs as a client and on maxconnection/max channels factor depending on general load of the qmgr....
=========================================
How can i know what the thresholds are for it to stop picking the messages?Could you please explain more on that or give me links to some docs where this topic is covered?
Thanks |
Here is what you need to do.
a) setup your MDB and set it to run with only 1 instance on only on 1 WAS instance and your messages will be processed serially.
b) you need to think about what a poison message would do to you and how you need to handle such a one. Read up with backout thresholds and such.
Enjoy  |
|
Back to top |
|
 |
newtomq22 |
Posted: Fri Sep 09, 2005 7:31 am Post subject: |
|
|
Novice
Joined: 08 Apr 2005 Posts: 24
|
Thanks for the reply...
what do u mean when you say
=================================
run with only 1 instance on only on 1 WAS instance
=================================
we have two servers currently and we run our current msg app on only one of them. On one also, if there is cloning involved would it affect anything?
Thanks a lot for the responses.
Tarun |
|
Back to top |
|
 |
|