cancel
Showing results for 
Search instead for 
Did you mean: 

JMS Queue monitoring

Former Member
0 Kudos

Hi everyone,

is there any way to monitor a jms queue with its contained messages ? i'm talking about a tool like the jmx console in jboss - the JMS Adapter and JMS Notification in the Visual Admin only provide some properties.

Any suggestions ?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Use HermesJMS, it is a perfect open source JMS queue management tool...

Former Member
0 Kudos

Thanks for your helpful answers - the points should be assigned by now.

When trying to find out my queue-ID i found that my queue is created twice with different IDs and names. Lets guess i create a queue called "MyQueue", then i would find in Configuration Adapter -> jms_provider -> DEFAULT -> default -> queues :

MyQueue

jms queue MyQueue

but in the queue-table i can only find entries for the latter.

Message was edited by: Frederic Bitsch

Message was edited by: Frederic Bitsch

Former Member
0 Kudos

Hello Frederic,

It's not normal to have two queues. Here is one scenario that could produce exactly the same results: you have deployed an EJB application with one queue name specified in the descriptor, then you have updated the descriptor and redeployed the application. Unfortunately the server will not delete the old resources and you will end up with two queues. If that is the case you can safely remove manually the obsolete one.

Here is another way if you want to check what are the used jms queues and their IDs. Please login in the telnet administration console

(here is a link how to do it : http://help.sap.com/saphelp_webas630/helpdata/en/a2/6052bb98033c4dbef5df04f68b0c7e/frameset.htm)

and then execute the following commands there :

jump 0

add jms

jms list destinations

You will see a list of the JMS queues and their IDs that are being used currently by the running applications.

Best Regards

Peter Peshev

Former Member
0 Kudos

Hi Peter,

this thread has very good information about the JMS queues. I have an interface where I am sending the JMS messages to the JMS queues on the XI J2EE engine, from where they will be picked up by external server. We are looking for an option where I can get a notification if the message is not picked up by the external server in a given time. Is there any way to sey it up? Any information regarding this is appreciated.

thanks

Kalyan

Former Member
0 Kudos

Hi,

In short what you want (sending email in case message has stayed too long time in the queue), is NOT possible directly. That's not a standard feature by the JMS spec.

What is possible is the is so-called dead messages, once the acknowledgment fails the predefined number of times then the messages will be redirected to a special queue. From there the messages can be exported by telnet.

Check SAP note 777930 for more info. Btw, it might be a good idea to get familiar with that note, otherwise if the external server let's say always throws an exception while processing the message, it will be moved to this special queue and unless someone issues the appropriate telnet commands, nobody will understand about this.

However if you disable this feature, that will mean that the message will be delivered endlessly, causing CPU load. Not nice if you have doubts in your external listeners.

Now about the queue monitoring :

You could create manually a periodic task (EJB timers in J2EE 1.4 which is covered in the prerelease of the next server version, or if you are using Netweaver 04s or 04s than perhaps java.util.Timer) that will periodically open a JMS browser, check the messages in the queue, if they have stayed too long time (>100 seconds for example ?) or if the queue is too big (>100 messages) you can send manually the email alert that something has went wrong. By usage of the JAVA API that should be simple

Another thing you can do is that inside your external listeners and the onMessage method, you could check manually the number of times the message is redelivered, if it is above some threshold (i.e . if it is 3, that means the SAP server has delivered the message 3 times , since the listener have rejected it 2 times already),then you can send the email via the standard java API. The delivery count can be retrieved by using the standard optional property JMSXDeliveryCount from the message.

HTH

Peter

Former Member
0 Kudos

Peter,

Great reply. It helped me.

Thanks

Kalyan

Former Member
0 Kudos

Peter,

Please help me with this one too. In your message you said

"Now about the queue monitoring :

You could create manually a periodic task (EJB timers in J2EE 1.4 which is covered in the prerelease of the next server version, or if you are using Netweaver 04s or 04s than perhaps java.util.Timer) that will periodically open a JMS browser, check the messages in the queue, if they have stayed too long time (>100 seconds for example ?) or if the queue is too big (>100 messages) you can send manually the email alert that something has went wrong. By usage of the JAVA API that should be simple

Another thing you can do is that inside your external listeners and the onMessage method, you could check manually the number of times the message is redelivered, if it is above some threshold (i.e . if it is 3, that means the SAP server has delivered the message 3 times , since the listener have rejected it 2 times already),then you can send the email via the standard java API. The delivery count can be retrieved by using the standard optional property JMSXDeliveryCount from the message. "

If I have to follow these options, how could develop a custom application and deploy it on XI J2EE Engine? I think I need to have NWDI is installed and have the NWDS to develop the code. Is there any other way that I can do this custom development? I mean can I do the custom development on the other machine and then deploy that on to the XI J2EE Engine? Please suggest.

Thanks

Kalyan

Former Member
0 Kudos

Hi Kalyan,

Please note that XI J2EE engine is J2EE engine with XI application running on top of it. However the java engine that has your JMS destinations is capable of running any J2EE application.

If you want to have a pure J2EE application (that uses a simple browser) you may develop and test it on another machine, another SAP Web Application Server, or even on your weblogic or whatever J2EE server you have. You may develop the application by NWDS, or whatever tools you prefer or feel familiar with. You could even create your code by notepad, compile manually and package the classes by zip utility.

However if your goal is to check the JMS messages, you do NOT have to run the code into the XI J2EE server, (you may, but it's not obligatory) you can launch it as a standalone java application for example. A simple java program with main method is enough.

HTH

Peter

Former Member
0 Kudos

Hi Kalyan,

You said .."have an interface where I am sending the JMS messages to the JMS queues on the XI J2EE engine, from where they will be picked up by external server."

My question is: How the external server will pickup file from XI JMS queue? using JMS adpter?

Is there any possibility to make interact both XI queue and external system queue without JMS adapter?

We re going to install WAS with JMS on diff machine and need to make interact this with XI JMS queue. Is it possible without adapter?

thanks in advance.

Regards,

Srinivas

Former Member
0 Kudos

Hello Frederic,

Unfortunately there is no such tool. However please take a look at the interface jaxax.jms.QueueBrowser. This interface is part of the standard JMS specification and thus it is fully implemented and supported from the server. It should be pretty easy to create a very small program that displays existing messages for a queue. Something like :

QueueSession session = myConnection.createQueueSession();

QueueBrowser browser = session.createBrowser(myQueue);

Enumeration enum = browser.getEnumeration();

while (enum.hasMoreElements()) {

Message mess = (Message) enum.nextElement();

//print whatever info from the message I need

}

Hope that helps

Peter Peshev

Former Member
0 Kudos

Ok - thanks anyway for your helpful answer !

riconeubauer
Discoverer
0 Kudos

Hello,

related topic: anyone knowing about a way to empty a queue (delete messages from a queue) without programmatic access?

Former Member
0 Kudos

Hello Rico,

Unfortunately there is no easy way to do this. The simplest way would be to remove the queue and recreate it again. If that is not an option, here is a rather technical workaround that you can perform if you want to delete all messages..

1. Stop the service jms_provider from the Visual Administrator

2. Delete everything from the table BC_JMSQUEUE from the server database

3. Start the service jms_provider

It is essential to stop/start the service, since there are caches that must be reinitialized. Otherwise they will become invalid whenever you operate with the database directly.

In case you want to delete messages only for some queue but not for the whole server, than you can check the id for the queue. Open Visual admin, find the service configuration adapter, then open in the right pane - jms_provider, DEFAULT ... find your queue.

After you have found out your id you should execute the following SQL statement :

DELETE FROM BC_JMSQUEUE WHERE DSTID=XXXX

I hope that helps. By the way, in my opinion it's better to post new problems in new threads, since in that way other users will not be able to find easily that information.

Furthermore by posting your questions in your thread you could easily indicate whether something is really working or answers your problem by assigning points.

Best Regards

Peter Peshev

Message was edited by: Peter Peshev