Author |
Message
|
zaklum |
Posted: Tue Sep 06, 2005 10:52 am Post subject: amqsput |
|
|
Voyager
Joined: 17 Mar 2005 Posts: 96 Location: Boca Raton
|
is there any way to write a shell script that places unlimited messages
on a queue using the amqsput command?
regards,
zaklum |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 06, 2005 11:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
yes....
But if you're looking to push messages for testing/load purposes, you might look at CapitalWare's products. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
zaklum |
Posted: Tue Sep 06, 2005 11:52 am Post subject: |
|
|
Voyager
Joined: 17 Mar 2005 Posts: 96 Location: Boca Raton
|
that didn't help!  |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Sep 06, 2005 11:58 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 06, 2005 12:30 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well, you didn't say which shell you wanted a script for...
You just need a loop wrapped around an echo with output piped to amqsput. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
zaklum |
Posted: Tue Sep 06, 2005 12:55 pm Post subject: |
|
|
Voyager
Joined: 17 Mar 2005 Posts: 96 Location: Boca Raton
|
This didn't work either:
cd /usr/mqm/samp
for i in 1 2 3 4 5
do
#amqsput TEST EAI
echo "test1" amqsput TEST EAI
done
bower, i'm now looking at your reply...
Thank you all for the help your giving me |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 06, 2005 1:08 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
echo "test1"|amqsput TEST EAI
Code: |
for %i in (1 2 3 4 5) do echo "test%i"|amqsput SYSTEM.DEFAULT.LOCAL.QUEUE QM.DIABLO.PROD |
worked just fine for me on windows. _________________ I am *not* the model of the modern major general.
Last edited by jefflowrey on Wed Sep 07, 2005 3:07 am; edited 1 time in total |
|
Back to top |
|
 |
zaklum |
Posted: Tue Sep 06, 2005 1:18 pm Post subject: |
|
|
Voyager
Joined: 17 Mar 2005 Posts: 96 Location: Boca Raton
|
Thanks Jeff and bower5932 for all your help!
Jeff, you are THE MAN. I ran your script and I got the results I was expecting....I'm incorporating this for lots of iterations..
Thanks again guys..
zaklum |
|
Back to top |
|
 |
wschutz |
Posted: Tue Sep 06, 2005 4:30 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Also, you can use the mqput2 command, which is part of rfhutil (ih03) supportpac, to do extensive custmization of sending large numbers of messages onto a queue. _________________ -wayne |
|
Back to top |
|
 |
Nigelg |
Posted: Tue Sep 06, 2005 11:56 pm Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Also, try the amqsblst utility. _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
zaklum |
Posted: Wed Sep 07, 2005 11:48 am Post subject: |
|
|
Voyager
Joined: 17 Mar 2005 Posts: 96 Location: Boca Raton
|
Guys,
back to the subject here. I'm tring to put a 1 page xml message into the queue and it's taking it as multiple messages. I made this message a 1 liner and the queue manager still takes it as multiple messages.
Any suggestions on how to put the following message as a single one so the curdepth(1) instead of curdepth(many). Here is how the message looks like:
<WfMessage><WfMessageHeader><ResponseRequired>Yes</ResponseRequired><UserContext>This is my return data</UserContext><!--<Starter>ADMIN</Starter>--></WfMessageHeader><ProcessTemplateCreateAndStartInstance><ProcTemplName>SSOIWF_Residential</ProcTemplName><ProcInstName>20040101_020345_16_psmith</ProcInstName><KeepName>true</KeepName><ProcInstInputData><SSOIWF_Batch><BatchNumber>20040101_020345_16_psmith</BatchNumber><Business></Business><CustomerNumber>61254</CustomerNumber><DocIndexes>3</DocIndexes><FirstName>John</FirstName><GeneralFlag>Create</GeneralFlag><LastName>Doe</LastName><ReleaseDate>20040202</ReleaseDate><SalesRep>hpolly</SalesRep><ScanUser>psmith</ScanUser><SSOIWF_Document><ContentURL>http://www.abc.com</ContentURL><MimeType>image/tiff</MimeType><Document>Permit</Document><JobID>0</JobID><CMUID>1</CMUID><ScanDate>20050122</ScanDate></SSOIWF_Document><SSOIWF_Document><ContentURL>http://www.google.com</ContentURL><MimeType>image/tiff</MimeType><Document>Contract</Document><JobID>0</JobID><CMUID>3</CMUID><ScanDate>2</ScanDate></SSOIWF_Document><SSOIWF_Document><ContentURL>http://www.cnn.com</ContentURL><MimeType>image/tiff</MimeType><Document>Rider</Document><JobID>1</JobID><CMUID>1</CMUID><ScanDate>2</ScanDate></SSOIWF_Document><SystemNumber>2</SystemNumber><Town>315T</Town><ZipCode>60060</ZipCode></SSOIWF_Batch></ProcInstInputData></ProcessTemplateCreateAndStartInstance></WfMessage>
here is the script:
#!/usr/bin/perl
print "Enter the name of the queue manager:";
$QUEUEMANAGER = <STDIN>;
print "Enter the name of the queue:";
$QUEUE = <STDIN>;
print "Enter the number of messages:";
$NUM = <STDIN>;
chomp $QUEUEMANAGER;
chomp $QUEUE;
chomp $NUM;
$string = '<WfMessage><WfMessageHeader><ResponseRequired>Yes</ResponseRequired><UserContext>This is my return data</UserContext></WfMessageHeader><ProcessTemplateCreateAndStartInstance><ProcTemplName>SSOIWF_Residential</ProcTemplName><ProcInstName>20040101_020345_16_psmith</ProcInstName><KeepName>true</KeepName><ProcInstInputData><SSOIWF_Batch><BatchNumber>20040101_020345_16_psmith</BatchNumber><Business></Business><CustomerNumber>61254</CustomerNumber><DocIndexes>3</DocIndexes><FirstName>John</FirstName><GeneralFlag>Create</GeneralFlag><LastName>Doe</LastName><ReleaseDate>20040202</ReleaseDate><SalesRep>hpolly</SalesRep><ScanUser>psmith</ScanUser><SSOIWF_Document><ContentURL>http://www.abc.com</ContentURL><MimeType>image/tiff</MimeType><Document>Permit</Document><JobID>0</JobID><CMUID>1</CMUID><ScanDate>20050122</ScanDate></SSOIWF_Document><SSOIWF_Document><ContentURL>http://www.google.com</ContentURL><MimeType>image/tiff</MimeType><Document>Contract</Document><JobID>0</JobID><CMUID>3</CMUID><ScanDate>2</ScanDate></SSOIWF_Document><SSOIWF_Document><ContentURL>http://www.cnn.com</ContentURL><MimeType>image/tiff</MimeType><Document>Rider</Document><JobID>1</JobID><CMUID>1</CMUID><ScanDate>2</ScanDate></SSOIWF_Document><SystemNumber>2</SystemNumber><Town>315T</Town><ZipCode>60060</ZipCode></SSOIWF_Batch></ProcInstInputData></ProcessTemplateCreateAndStartInstance></WfMessage>';
my $i = "0";
`cd /usr/mqm/samp`;
for ($i = 0; $i <= "$NUM"; $i++)
{
print "$string\n";
`echo "$string%i"|amqsput $QUEUE $QUEUEMANAGER`;
} |
|
Back to top |
|
 |
JohnRodey |
Posted: Wed Sep 07, 2005 12:04 pm Post subject: |
|
|
 Centurion
Joined: 13 Apr 2005 Posts: 103
|
The amqsput program is setup to only take in 99 characters per message, You might be able to just edit the amqsput0.c to change the buffer[100] to buffer[1000]. You will have to then recompile.
Hope that helps |
|
Back to top |
|
 |
wschutz |
Posted: Wed Sep 07, 2005 12:10 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
I would strongly suggest ma01 supportpac, then you can:
q -oQUEUNAME -F<multi-line xml message>
if you like ... or just long xml lines ..... _________________ -wayne |
|
Back to top |
|
 |
root |
Posted: Wed Sep 07, 2005 12:21 pm Post subject: |
|
|
 Novice
Joined: 23 Sep 2004 Posts: 13
|
The sample program is to be used for very basic testing of MQ. The sample program works with command line input and is designed to create one msg per input line, which is ended by a carriage return line feed (CrLf). This is how the sample program works.
What i posted probably isn't helpful, but my point is.
If you are going to end up hitting enter or using a line feed then the sample program will take that action as the end of a message and will start a new one.
Maybe you shouldn't use the sample program. _________________ Who's the Master? |
|
Back to top |
|
 |
Nigelg |
Posted: Wed Sep 07, 2005 11:54 pm Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
I agree with JohnRodney above. amqsput reads up to 99 characters or up to a newline from stdin, then writes the msg out, then reads from stdin again. The solution is to increase the buffer size in amqsput0.c. _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
|