Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

WLST script for listing all proxy services using a specified URI

sameer hJun 2 2014 — edited Jun 9 2014


Hi

I have created a WLST script to display all JMS topic/queues that has got message pending greater than zero. Now next step I want to display the proxy service name(s) that listens to those topics/queues.

Can anybody provide pointers on the same. It seems there are methods in Java JMX but not much material available on WLST.

Here is my existing script for getting all JMS resources for message pending count >0

import re

print "Starting the script ..."
username = 'weblogic'
password = 'welcome1'
url='t3://localhost:XXXX'
connect(username,password,url)
domainRuntime()
cd('ServerRuntimes')

servers = domainRuntimeService.getServerRuntimes(); 

for server in servers: 
serverName=server.getName();
print '**************************************************'
print '##################### serverName: ', serverName, '########################'
print '**************************************************'
print '##### Server State #####', server.getState()
print '##### Server ListenAddress #####', server.getListenAddress()
print '##### Server ListenPort #####', server.getListenPort()
jmsRuntime = server.getJMSRuntime(); 
jmsServers = jmsRuntime.getJMSServers();
cServer = 'AdminServer$' 
result = re.search(cServer,serverName);
if result == None:
  for jmsServer in jmsServers: 
   jmsServerName=jmsServer.getName();
   print '********************************************'
   print '############## JMSserverName: ', jmsServerName, '################'
   destinations = jmsServer.getDestinations(); 
   for destination in destinations: 
    if destination.getMessagesPendingCount() > 0:
     count=destination.getMessagesPendingCount() 
     dest = destination.getName() 
     print '.....For Queue', dest ,' the Message Pending Count : ' , count 
     print '' 
else:
     print 'Skipping search for Admin server'

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 7 2014
Added on Jun 2 2014
3 comments
5,091 views