Monday Nov 11, 2013

How to show pending messages using WLST?

Here are the steps:

1. . ./setDomainEnv.sh
2. java weblogic.WLST
3. connect('weblogic','welcome1','t3://localhost:7001')
4. domainRuntime()
5. cd('ServerRuntimes/MS1/JMSRuntime/MS1.jms/JMSServers/JMSServer1/Destinations/JMSModule1!Queue1')
6. cursor1=cmo.getMessages('true',9999999,10)
                                                 **String(selector),Integer(timeout),Integer(state)
7. msgs = cmo.getNext(cursor1, 10)
                  ** This step gets 10 messages, you can call again cmo.getNext(cursor1, 10) to get the next 10 msgs
8. print(msgs)


My assumption, is that you had created:
a. Managed Server MS1.
b. JMS Server JMSServer1.
c. Module called JMSModule1.
d. Inside of JMSModule1, a Queue called Queue1.



If you read my previous post:

How to get Messages Pending Count from a Queue using WLST?
https://blogs.oracle.com/LuzMestre/entry/how_to_get_messages_pending

You can see that both are very similar.  Sometimes it is difficult to get a WLST Script sample, but you can use ls() function to know about other functionalities you don't have a sample code.

***Until step 5, nothing new comparing to my previous post.
5. cd('ServerRuntimes/MS1/JMSRuntime/MS1.jms/JMSServers/JMSServer1/Destinations/JMSModule1!Queue1')
6. ls()


You will see, MessagesPendingCount, getMessages along a lot of other functionalities available in this Queue.

e.g, you can see:
-r-x   getMessages                                  String : String(selector),Integer(timeout),Integer(state)

Here you can check the complete MBean Reference:
http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13951/core/index.html
See JMSDestinationRuntimeMBean.

Enjoy!

About


My name is Luz Mestre. I work as Principal Technical Support Engineer at Oracle Support. I'll post here the most interesting challenges I have in my daily work. The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« April 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today