set_MQ_Queues.jacl

 


###   
### set_MQ_Queues.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 {   
 

$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEA} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueA} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueA} \
{name QueueA} \
{password password} \
{persistence NONPERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEB} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueB} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueB} \
{name QueueB} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEC} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueC} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueC} \
{name QueueC} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUED} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueD} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueD} \
{name QueueD} \
{password password} \
{persistence NONPERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEE} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueE} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueE} \
{name QueueE} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEN} \
{category MYAPPSIDE} \
{decimalEncoding Normal} \
{description QueueN} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueN} \
{name QueueN} \
{password password} \
{persistence NONPERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEF} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueF} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueF} \
{name QueueF} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEG} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueG} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueG} \
{name QueueG} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEH} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueH} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueH} \
{name QueueH} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEM} \
{category MYAPPSIDE} \
{decimalEncoding Normal} \
{description QueueM} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueM} \
{name QueueM} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEJ} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueJ} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueJ} \
{name QueueJ} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEI} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueI} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueI} \
{name QueueI} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEK} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueK} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueK} \
{name QueueK} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
$AdminConfig create MQQueue $JMSProviderID { {CCSID 0} \
{baseQueueManagerName QMGR.HOSTA.APPSERVERA} \
{baseQueueName QUEUEL} \
{category MYAPP} \
{decimalEncoding Normal} \
{description QueueL} \
{expiry APPLICATION_DEFINED} \
{floatingPointEncoding IEEENormal} \
{integerEncoding Normal} \
{jndiName jndi/path/jms/QueueL} \
{name QueueL} \
{password password} \
{persistence PERSISTENT} \
{priority APPLICATION_DEFINED} \
{queueManagerHost hosta} \
{queueManagerPort 1414} \
{serverConnectionChannelName SYSTEM.DEF.SVRCONN} \
{specifiedExpiry 0} \
{specifiedPriority 0} \
{targetClient JMS} \
{useNativeEncoding false} \
{userName root} } 
 
 
 
   
}   
   
$AdminConfig save   


### Synchronize nodes

set Sync1 [$AdminControl completeObjectName type=NodeSync,node=$nname,*]

set xstatus [$AdminControl invoke $Sync1 sync]
puts $xstatus

if {$xstatus == "false"} {
    puts "Unable to synchronize..."
}

   
}   
   
   
   
###   
### 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 hostaNetwork hosta ops_1_1" 
} else {    
   set xcell        [lindex $argv 0]     
   set xnode        [lindex $argv 1]     
   set xserver      [lindex $argv 2]     
   set_MQQueue $xcell $xnode $xserver    
}