ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » amqsput

Post new topic  Reply to topic Goto page 1, 2  Next
 amqsput « View previous topic :: View next topic » 
Author Message
zaklum
PostPosted: Tue Sep 06, 2005 10:52 am    Post subject: amqsput Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Sep 06, 2005 11:00 am    Post subject: Reply with quote

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
View user's profile Send private message
zaklum
PostPosted: Tue Sep 06, 2005 11:52 am    Post subject: Reply with quote

Voyager

Joined: 17 Mar 2005
Posts: 96
Location: Boca Raton

that didn't help!
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Sep 06, 2005 11:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Try this:

http://www.mqseries.net/phpBB2/viewtopic.php?t=12388
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Tue Sep 06, 2005 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
zaklum
PostPosted: Tue Sep 06, 2005 12:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Sep 06, 2005 1:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
zaklum
PostPosted: Tue Sep 06, 2005 1:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Sep 06, 2005 4:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Nigelg
PostPosted: Tue Sep 06, 2005 11:56 pm    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

Also, try the amqsblst utility.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
zaklum
PostPosted: Wed Sep 07, 2005 11:48 am    Post subject: Reply with quote

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
View user's profile Send private message
JohnRodey
PostPosted: Wed Sep 07, 2005 12:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Wed Sep 07, 2005 12:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
root
PostPosted: Wed Sep 07, 2005 12:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Nigelg
PostPosted: Wed Sep 07, 2005 11:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » amqsput
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.