Saturday, August 28, 2010

WLST and JMS

I found this wonderful script (thank you to my Indian friends for sharing)

http://wlstbyexamples.blogspot.com/2009/11/jms-monitoring-using-wlst.html

This post
http://unni-at-work.blogspot.com/2010/02/use-userconfigfile-for-connecting-to.html

again maintained by an Indian, explains how to create a userconfig file

East or West, India is the best :o)


To make a long story short:

wlst.sh
connect('${wlusername}', '${wlpw}', 't3://${wlhostname}:${port}')
storeUserConfig('PVWebLogicConfig.properties',  'PVWebLogicKey.properties')
exit()


you get a lovely warning:

Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or n


and a lovely confirmation:

The username and password that were used for this WebLogic Server connection are stored in PVWebLogicConfig.properties and PVWebLogicKey.properties.


Lovely!


After that, you can connect by doing this:



connect(userConfigFile='PVWebLogicConfig.properties',userKeyFile='PVWebLogicKey.properties',url='t3://${wlhostname}:${port}')



Remember that to explore the JMSDestinationRuntime you must connect to the MS, not to the Admin:

connect('bla', 'bla', 't3://hostname:port_of_ms')

jmsdestlist = home.getMBeansByType('JMSDestinationRuntime')


if you want to navigate to them, you should do:
serverRuntime()
cd('JMSRuntime/dev3OsbLABMs1.jms/JMSServers/myJmsServer_1/Destinations/MQGEOSystemModule!myJmsServer_1@MQGEOQueue')

print cmo.getMessagesCurrentCount()

1 comment:

Pavan Devarakonda [PD] said...

Thankyou very much for your refernce comment on my blog.