Welcome, guest | Sign In | My Account | Store | Cart

Install MQ Queues.

Tcl, 110 lines
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
###   
### set_MQ_Queues.jacl   
###   
###   
###   
###   
###   
   
proc set_MQQueue {MQJMSProviderID nname mqqmgr queueList} {   
   
   
###   
### set up globals   
###   
   
global AdminConfig   
global AdminControl   
global AdminApp   
   
foreach {qName bqName} $queueList {
    
    puts "Creating $qName $bqName ..."
    
    set CCSID			[ list CCSID 1208		]
    set baseQueueManagerName	[ list baseQueueManagerName $mqqmgr ]
    set baseQueueName		[ list baseQueueName $bqName	]
    set decimalEncoding		[ list decimalEncoding Normal	]
    set description		[ list description $qName	]
    set expiry			[ list expiry APPLICATION_DEFINED ]
    set floatingPointEncoding 	[ list floatingPointEncoding IEEENormal ]
    set integerEncoding		[ list integerEncoding Normal	]
    set jndiName	    	[ list jndiName mq/$qName	]
    set name			[ list name $qName		]
    set persistence		[ list persistence APPLICATION_DEFINED ]
    set priority		[ list priority APPLICATION_DEFINED ]
    set targetClient		[ list targetClient MQ		]
    set useNativeEncoding	[ list useNativeEncoding true	]
    	
    set attrs [ list $CCSID        	  \
                    $baseQueueManagerName \
                    $baseQueueName        \
                    $decimalEncoding      \
		    $description          \
                    $expiry               \
		    $floatingPointEncoding \
	       	    $integerEncoding	  \
    		    $jndiName		  \
    		    $name	          \
    		    $persistence	  \
    		    $priority		  \
    		    $targetClient	  \
		    $useNativeEncoding   			    
	     ]

   ##puts " ATTRS = $attrs"

   if { [ catch { $AdminConfig create MQQueue $MQJMSProviderID $attrs } r ] == 0 } {

       $AdminConfig save
       
       } else {

       puts "\nproblem creating MQQueue $qName. \n"
       puts $r 
       puts "************************************\n"
       return -code error $r
   }
    
}

### Synchronize nodes
puts "Synchronizing 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 == 15) } {   
   puts ""   
   puts "Insufficient arguments supplied on command line:  "   
   puts " "   
} else {    
   set MQJMSProviderID    [lindex $argv 0]
   set nname              [lindex $argv 1]	
   set mqqmgr             [lindex $argv 2]
   set qname1             [lindex $argv 3]
   set mqqueue1  	  [lindex $argv 4]
   set qname2             [lindex $argv 5]
   set mqqueue2  	  [lindex $argv 6]
   set qname3             [lindex $argv 7]
   set mqqueue3  	  [lindex $argv 8]
   set qname4             [lindex $argv 9]
   set mqqueue4  	  [lindex $argv 10]
   set qname5             [lindex $argv 11]
   set mqqueue5  	  [lindex $argv 12]
   set qname6             [lindex $argv 13]
   set mqqueue6  	  [lindex $argv 14]
   set queueList	  [list $qname1 $mqqueue1 $qname2 $mqqueue2 $qname3 $mqqueue3 $qname4 $mqqueue4 $qname5 $mqqueue5 $qname6 $mqqueue6 ]
   set_MQQueue $MQJMSProviderID $nname $mqqmgr $queueList
}
Created by Patrick Finnegan on Tue, 18 Oct 2005 (MIT)
Tcl recipes (162)
Patrick Finnegan's recipes (56)

Required Modules

  • (none specified)

Other Information and Tasks