<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shaaf's Blog &#187; MQQueue</title>
	<atom:link href="http://www.shaafshah.com/tag/mqqueue/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shaafshah.com</link>
	<description>Another bit in the wall</description>
	<lastBuildDate>Wed, 12 Aug 2009 14:28:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Creating the MQQueues with wsadmin scripting &#8211; JACL Part 2</title>
		<link>http://www.shaafshah.com/2008/06/25/creating-the-mqqueues-with-wsadmin-scripting-jacl-part-2/</link>
		<comments>http://www.shaafshah.com/2008/06/25/creating-the-mqqueues-with-wsadmin-scripting-jacl-part-2/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 12:40:47 +0000</pubDate>
		<dc:creator>Shaaf Shah</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[jacl]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MQ]]></category>
		<category><![CDATA[MQQueue]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[wsadmin]]></category>

		<guid isPermaLink="false">http://www.shaafshah.com/?p=9</guid>
		<description><![CDATA[Yesterday I wrote an article about creating and configuring the MQQueueConnectionFactory with the JACL on the wsadmin console. The other half of the article that was left out was to create the queues also. The world looks pretty much the same today and my /etc/profile doesnt seemed to have been sourced again. Good we dont [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I wrote an article about creating and configuring the MQQueueConnectionFactory with the JACL on the wsadmin console. The other half of the article that was left out was to create the queues also.</p>
<p>The world looks pretty much the same today and my /etc/profile doesnt seemed to have been sourced again. Good we dont need a restart.</p>
<p>You would find some of the steps to be similar and that is because we are running on the same configs.</p>
<p><strong>Step 1.</strong><br />
Identify the Provider for your Queue. By default this is the name for it. If you have created a new provider with a different name then specify it here.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> tmp1 <span style="color: #483d8b;">&quot;WebSphere MQ JMS Provider&quot;</span></pre></div></div>

<p><strong>Step 2.</strong><br />
Now you would need to find the CELL NAME and the NODE NAME of your server<br />
A typical location to my websphere profile’s Node configuration file is as follows<br />
C:\Programs\IBM\Rational\SDP\6.0\runtimes\base_v6\profiles\test_wsp\config\cells\BNode05Cell\nodes\BNode05<br />
The cell name in this location is after \cells\ i.e. BNode05Cell<br />
And the node name is at the end after \nodes\ i.e. BNode05</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> newjmsp <span style="color: black;">&#91;</span><span style="color: #ff3333;">$AdminConfig</span> getid /Cell:CELLNAMECell/Node:NODENAME/JMSProvider:<span style="color: #ff3333;">$tmp1</span>/<span style="color: black;">&#93;</span></pre></div></div>

<p><strong>Step 3.</strong><br />
You would now need to set the attributes that go into the queue.</p>
<p>To see all the attributes you can simply run the following command</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$AdminConfig</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>required<span style="color: #000000; font-weight: bold;">|</span>attributes<span style="color: #7a0874; font-weight: bold;">&#93;</span> MQQueue</pre></div></div>

<p>i.e. required or attributes</p>
<p>The attributes that I will be setting in the following commands are<br />
name, jndiName, baseQueueName, targetClient</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> name <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> name NAME<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> jndi <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> jndiName jms/jndiName<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> baseQN <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> baseQueueName BASEQUEUENAME<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> targetclient <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> targetClient MQ<span style="color: black;">&#93;</span></pre></div></div>

<p>You can see in the above example the target client is set to MQ it can be JMS based on your configuration.</p>
<p><strong>Step 4.</strong><br />
Now set all parameters in one string so that they can be passed to the command as one.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> mqqAttrs <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> <span style="color: #ff3333;">$name</span> <span style="color: #ff3333;">$jndi</span> <span style="color: #ff3333;">$baseQN</span> <span style="color: #ff3333;">$targetclient</span><span style="color: black;">&#93;</span></pre></div></div>

<p><strong>Step 5.</strong><br />
Now to create the MQQueue use the following command. This will add the Queue to the node and cell mentioned earlier in step 2.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff3333;">$AdminConfig</span> create MQQueue <span style="color: #ff3333;">$newjmsp</span> <span style="color: #ff3333;">$mqqAttrs</span></pre></div></div>

<p>Once it is created it is not saved and only stays in the current session. So to save it run the following command. And you should be all set.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff3333;">$AdminConfig</span> save</pre></div></div>

<p>You can alternatively also save this script in a file on your local system. And run it by passing it to the wasadmin. Follwing is a sample command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wsadmin <span style="color: #660033;">-profileName</span> test_wsp <span style="color: #660033;">-f</span> <span style="color: #007800;">$SCRIPT_FILENAME_LOCATION</span>$</pre></div></div>

<p>&#8216;Complete code listing is as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> tmp1 <span style="color: #483d8b;">&quot;WebSphere MQ JMS Provider&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> newjmsp <span style="color: black;">&#91;</span><span style="color: #ff3333;">$AdminConfig</span> getid /Cell:HOSTNAMENode04Cell/Node:HOSTNAMENode04/JMSProvider:<span style="color: #ff3333;">$tmp1</span>/<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> name <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> name Q.REPLY<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> jndi <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> jndiName jms/Q.REPLY<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> baseQN <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> baseQueueName Q.SYSTEM<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> targetclient <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> targetClient MQ<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> mqqAttrs <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> <span style="color: #ff3333;">$name</span> <span style="color: #ff3333;">$jndi</span> <span style="color: #ff3333;">$baseQN</span> <span style="color: #ff3333;">$targetclient</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff3333;">$AdminConfig</span> create MQQueue <span style="color: #ff3333;">$newjmsp</span> <span style="color: #ff3333;">$mqqAttrs</span>
&nbsp;
<span style="color: #ff3333;">$AdminConfig</span> save</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shaafshah.com/2008/06/25/creating-the-mqqueues-with-wsadmin-scripting-jacl-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
