Followers

Wednesday, August 7, 2013

Setting up the JMS resources through WLST script



The below WLST script help us to set up the JMS resources.
JMSConpiguration.py
connect('weblogic','weblogic', 't3://localhost:8000')

edit()
startEdit()

print 'Creating File Store'
cd('/')
cmo.createFileStore('BAMMonitoringJMSFileStore')
cd('/FileStores/BAMMonitoringJMSFileStore')
cmo.setDirectory('BAMMonitoringJMSFileStore')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))


print 'Creating JMS Server'
cd('/')
print 'Creating JMS Server.'
cmo.createJMSServer('BAMMonitoringServer')
cd('/JMSServers/BAMMonitoringServer')
cmo.setPersistentStore(getMBean('/FileStores/BAMMonitoringJMSFileStore'))
cmo.setTemporaryTemplateResource(None)
cmo.setTemporaryTemplateName(None)
cmo.addTarget(getMBean('/Servers/AdminServer'))

print 'Creating JMS Module'
cd('/')
cmo.createJMSSystemResource('BAMJMSSystemResource')
cd('/JMSSystemResources/BAMJMSSystemResource')
cmo.addTarget(getMBean('/Servers/AdminServer'))
cmo.createSubDeployment('BAMSubdeDloyment')

print 'Creating Connection Factory'
cd('/')
cd('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource')
cmo.createConnectionFactory('BAMMonitoringConnectionfactory')
cd('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource/ConnectionFactories/BAMMonitoringConnectionfactory')
cmo.setJNDIName('jms/BAMMonitoringConnectionfactory')
#set('SubDeploymentName','BAMSubdeDloyment')
cd('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource/ConnectionFactories/BAMMonitoringConnectionfactory/SecurityParams/BAMMonitoringConnectionfactory')
cmo.setAttachJMSXUserId(false)
cd('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource/ConnectionFactories/BAMMonitoringConnectionfactory/ClientParams/BAMMonitoringConnectionfactory')
cmo.setClientIdPolicy('Restricted')
cmo.setSubscriptionSharingPolicy('Exclusive')
cmo.setMessagesMaximum(10)
#cd('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource/ConnectionFactories/BAMMonitoringConnectionfactory/TransactionParams/BAMMonitoringConnectionfactory')
#cmo.setXAConnectionFactoryEnabled(true)
cd('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource/ConnectionFactories/BAMMonitoringConnectionfactory')
cmo.setDefaultTargetingEnabled(true)

print 'Creating Queue'
cd('/')
cd('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource')
cmo.createQueue('BAMMonitoringQueue')
cd('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource/Queues/BAMMonitoringQueue')
set('JNDIName','jms/BAMMonitoringQueue')
set('SubDeploymentName','BAMSubdeDloyment')
cd('/JMSSystemResources/BAMJMSSystemResource/SubDeployments/BAMSubdeDloyment')
cmo.addTarget(getMBean('/JMSServers/BAMMonitoringServer'))

print 'JMS Resources are Successfully Created'
activate()
Executing the script:
Set the environment by executing the below script
$WL_Home/wlserver_10.3/server/bin/setWLSEnv.sh
Execute JMSConpiguration.py
Wlst.sh JMSConpiguration.py

No comments:

Post a Comment