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 » General IBM MQ Support » amqsput issue

Post new topic  Reply to topic
 amqsput issue « View previous topic :: View next topic » 
Author Message
foggyguy
PostPosted: Mon Apr 19, 2004 3:57 am    Post subject: amqsput issue Reply with quote

Novice

Joined: 26 Aug 2003
Posts: 18
Location: Ireland

I tried the following script on unix server . It is designed to put a number of messages to a queue. I want to assign the content of the SAMPLE variable to each message as it will have the message number attached. However when I run testdriver i get following error
" ./testdriver[7]: Message number 1: cannot open": Any ideas??
vi testdriver
"testdriver" 13 lines, 328 characters
VAL=1
SAMPLE=`echo Message number $VAL`
echo the date is
date
while [ $VAL -lt 6 ]
do
amqsput QName QMgrName < $SAMPLE
VAL=`expr $VAL + 1`
sleep 1
done
VAL=`expr $VAL - 1`
echo $VAL records were put to queue QName on QMgrName
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Mon Apr 19, 2004 7:00 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Maybe amqsput is not in the PATH
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mqonnet
PostPosted: Mon Apr 19, 2004 7:29 am    Post subject: Reply with quote

Grand Master

Joined: 18 Feb 2002
Posts: 1114
Location: Boston, Ma, Usa.

I believe this is what the problem is.

When you issue amqsput and supply $SAMPLE as input, amqsput assumes this $SAMPLE to be a file rather than stdin. As you cannot send in text the way you are trying to. And since amqsput is NOT coded to handle such stuff, there are 2 options for you that i can see easy enough to achieve.

-Instead of calling amqsput from this script that you posted here, add each line of message that you wish to put, Message number 1, etc, and output this to a file. Call Amqsput from command prompt and then supply this filename that consists of all those Message number 1, 2,....

-Modify the amqsput sample app to put messages with the text you want in a loop. Belive me, it would be much faster and easier to do this, than to try and fix your little script. :)

Good luck.

Cheers
Kumar
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jefflowrey
PostPosted: Mon Apr 19, 2004 9:00 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I'm a little confused.

It seems that AMQSPUT doesn't like having stdin redirected from <.

But it works just fine with |.

So,
Code:
$SAMPLE | amqsput QName QMgrName

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mqonnet
PostPosted: Mon Apr 19, 2004 10:08 am    Post subject: Reply with quote

Grand Master

Joined: 18 Feb 2002
Posts: 1114
Location: Boston, Ma, Usa.

Jeff, my take on that would be, since "|" sends output from something into something, the RHS expression to "|" takes input line by line as opposed to a complete file when you are using <.

For example:

Ps | grep hello

Every output of Ps is sent as input to grep command which then evaluates the condition that you put up, which is, search for string "hello". So, you can term this like an interpretor, if i can say so. :)

As opposed to stdin which takes the whole file into account as in example of amqsput.

I havent tried with | and hence am not sure if it works or not. But as you mentioned if it does work, then the above could be the theory behind it.

Just my 2 cents. :)

Cheers
Kumar
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » amqsput issue
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.