Wednesday, January 11, 2012

How to setup JMS resources in weblogic : console and WLST Phython script



Manually via console
1. create a persistent store (for transaction-enable jms server)
console: service>persistent store
2. create a jms server
console: service > messaging > jms server
3. create a jms module
console: service > messaging > jms module
4. create a subdeployment
click jms module > subdeployment tab
5. create a connection factory and jms queue/topic
click jms module > configuration tab

Automation using WLST python scripts
1. create a persistent store (for transaction-enable jms server)
myfileStore = create('myFileStore','FileStore')
2. create a jms server
myjmsserver = create(' ...name...','JMSServer')
myjmsserver.addTarget(myserver)
myjmsserver.setPersistentStore(myfileStore)
3. create a jms module
jmsMySystemResource = create(" ...modulename...","JMSSystemResource")
jmsMySystemResource.addTarget(myserver)
4. create a subdeployment
subdeploy = jmsMySystemResource.createSubDeployment('...Subdeploy name....')
subdeploy.addTarget(myjmsserver)
5. create a connection factory and jms queue/topic
theJMSResource = jmsMySystemResource.getJMSResource()
connf = theJMSResource.createConnectionFactory('...name...')
connf.setJNDIName('...jndi...')
connf.setLocalJNDIName('...jndi....')
connf.setSubDeploymentName('...subdeploy name....')

myqueue = theJMSResource.createQueue('...name...')
myqueue.setJNDIName('...jndi....')
myqueue.setSubDeploymentName('...subdeploy name...')

mytopic = theJMSResource.createTopic('...name...')
mytopic .setJNDIName('...jndi....')
mytopic .setSubDeploymentName('...subdeploy name...')



Run this script using weblogic.WLST java class:
command line: java weblogic.WLST myscript.py
or using Ant:

<java classname="weblogic.WLST" fork="yes" classpathref="wlst.class.path">
<arg line="myscript.py" />
</java>


Please download an example of the python code here.



See also blogs compilation about messaging for integration: http://soa-java.blogspot.nl/2012/01/asynchronous-messaging-for-integration.html

Please share comment.

Source: Steve's blog http://soa-java.blogspot.com

References:
Professional Oracle WebLogic Server


The Definitive Guide to SOA: Oracle Service Bus

No comments: