Configure a new MQ queue using wsadmin.sh
Using Jacl:
set JMSParent [$AdminConfig getid /Cell:cell/Node:node/JMSProvider:JMSProvider/] $AdminConfig required MQQueue set name [list name MQQ] set jndi [list jndiName jms/MQQ] set BaseQName [list baseQueueName "Base queue name "] set QueueAttributes [list $name $jndi $BaseQName] $AdminConfig create MQQueue $JMSParent $QueueAttributes $AdminConfig save
Using Jython
JMSParent = AdminConfig.getid('/Cell:cell/Node:node/JMSProvider:JMSProvider') print JMSParent print AdminConfig.required('MQQueue') name = ['name', 'MQQ'] jndi = ['jndiName', 'jms/MQQ'] BaseQName = ['baseQueueName', "Base queue name"] QueueAttributes = [name, jndi, BaseQName] print QueueAttributes print AdminConfig.create('MQQueue', JMSParent, QueueAttributes) AdminConfig.save()
Long Version Using JACL
### ### set_MQQueue.jacl ### ### ### ### ### proc set_MQQueue {cname nname sname} { ### ### set up globals ### global AdminConfig global AdminControl global AdminApp set JMSProviderIDs [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/JMSProvider:/] if {[llength $JMSProviderIDs] == 0} { puts "JMSProvider ID null - returning " continue } foreach JMSProviderID $JMSProviderIDs { # set JMSProviderName [ showAttribute $JMSProviderID name] $AdminConfig create MQQueue $JMSProviderID { \ {CCSID 0} \ {baseQueueManagerName QMGR.HOSTNAME.CLUSTERNAME} \ {baseQueueName TESTJOBEXECQUEUE} \ {category BUYER} \ {decimalEncoding Normal} \ {description TestJobExecQueue} \ {expiry APPLICATION_DEFINED} \ {floatingPointEncoding IEEENormal} \ {integerEncoding Normal} \ {jndiName company/buyer/jms/TestJobExecQueue} \ {name TestJobExecQueue} \ {password *****} \ {persistence NONPERSISTENT} \ {priority APPLICATION_DEFINED} \ {queueManagerHost HOSTNAME} \ {queueManagerPort 1414} \ {serverConnectionChannelName SYSTEM.DEF.SVRCONN} \ {specifiedExpiry 0} \ {specifiedPriority 0} \ {targetClient JMS} \ {useNativeEncoding false} \ {userName root} } $AdminConfig create MQQueue $JMSProviderID { \ {CCSID 0} \ {baseQueueManagerName QMGR.HOSTNAME.CLUSTERNAME} \ {baseQueueName ERRORQUEUE} \ {category BUYER} \ {decimalEncoding Normal} \ {description ErrorQueue} \ {expiry APPLICATION_DEFINED} \ {floatingPointEncoding IEEENormal} \ {integerEncoding Normal} \ {jndiName company/buyer/jms/ErrorQueue} \ {name ErrorQueue} \ {password *****} \ {persistence PERSISTENT} \ {priority APPLICATION_DEFINED} \ {queueManagerHost rigel} \ {queueManagerPort 1414} \ {serverConnectionChannelName SYSTEM.DEF.SVRCONN} \ {specifiedExpiry 0} \ {specifiedPriority 0} \ {targetClient JMS} \ {useNativeEncoding false} \ {userName root} } $AdminConfig create MQQueue $JMSProviderID { \ {CCSID 0} \ {baseQueueManagerName QMGR.HOSTNAME.CLUSTERNAME} \ {baseQueueName JOBEXECQUEUE} \ {category BUYER} \ {decimalEncoding Normal} \ {description JobExecQueue} \ {expiry APPLICATION_DEFINED} \ {floatingPointEncoding IEEENormal} \ {integerEncoding Normal} \ {jndiName company/buyer/jms/JobExecQueue} \ {name JobExecQueue} \ {password *****} \ {persistence NONPERSISTENT} \ {priority APPLICATION_DEFINED} \ {queueManagerHost rigel} \ {queueManagerPort 1414} \ {serverConnectionChannelName SYSTEM.DEF.SVRCONN} \ {specifiedExpiry 0} \ {specifiedPriority 0} \ {targetClient JMS} \ {useNativeEncoding false} \ {userName root} } $AdminConfig create MQQueue $JMSProviderID { \ {CCSID 0} \ {baseQueueManagerName QMGR.HOSTNAME.CLUSTERNAME} \ {baseQueueName PRODQUEUE} \ {category BUYER} \ {decimalEncoding Normal} \ {description ProdQueue} \ {expiry APPLICATION_DEFINED} \ {floatingPointEncoding IEEENormal} \ {integerEncoding Normal} \ {jndiName company/buyer/jms/ProdQueue} \ {name ProdQueue} \ {password *****} \ {persistence PERSISTENT} \ {priority APPLICATION_DEFINED} \ {queueManagerHost rigel} \ {queueManagerPort 1414} \ {serverConnectionChannelName SYSTEM.DEF.SVRCONN} \ {specifiedExpiry 0} \ {specifiedPriority 0} \ {targetClient JMS} \ {useNativeEncoding false} \ {userName root} } } $AdminConfig save } ### ### Main ### if { !($argc == 3) } { puts "" puts "Usage: " puts " " puts "wsadmin.sh -username system -password password -f set_MQQueue.jacl cellname nodename servername" puts "" puts "For example: " puts " " puts "wsadmin.sh -username was -password notiv@ -f set_MQQueue.jacl venusNetwork venus ops_1_1" } else { set xcell [lindex $argv 0] set xnode [lindex $argv 1] set xserver [lindex $argv 2] set_MQQueue $xcell $xnode $xserver }