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 » Automating amqsput for putting message in many qs

Post new topic  Reply to topic
 Automating amqsput for putting message in many qs « View previous topic :: View next topic » 
Author Message
jeevan
PostPosted: Tue Jan 22, 2008 8:37 am    Post subject: Automating amqsput for putting message in many qs Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

can I add a message in

amqsput QUEUE QMGR
command line? I have to put a unsuscribing message to about 100 queue. I am looking ways to automate this.

I can use file as said there are many queues. any suggestion

thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 22, 2008 8:39 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Most OS allow you to redirect stdin from keyboard to a file. Even Windoze.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jeevan
PostPosted: Tue Jan 22, 2008 8:45 am    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

Vitor wrote:
Most OS allow you to redirect stdin from keyboard to a file. Even Windoze.


I am not sure whether you understand my req. I have to put lets say " <<this is queue xa>> in each of 100 queues. I am using psexec in batch file so I can do


psexec hostname amqsput QUEUE QMGR <MESSAGE TO PUT>

Where and how I can put this message in each queue? the message is different so I can not get from a single file and I do not like to create 100 file for input.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 22, 2008 8:49 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

We are not sure that you understand basic shell programming.

|

>

<

These are all basic tools.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 22, 2008 8:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

It obviously depends on how you derive the message but presumably you have some means of determining which message needs to go in which queue (or ideally determining the message from hostname/queue manager name/queue name/etc) so you can use this information to generate the message within the script and then pipe that into amqsput.

Alternatively (as amqsput is only a sample) produce a smarter version that reads the message to be put from a different source, or generates it internally. Depends how complex the message generation is.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jeevan
PostPosted: Tue Jan 22, 2008 12:45 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

jefflowrey wrote:
We are not sure that you understand basic shell programming.

|

>

<

These are all basic tools.


Sorry Jeff. It was my mistake. The psexec command does not like

psexec \\hostname echo message|amqsput queue qmgr


However, it works sigle command like this:

psexec \\hostname amqsput QUEUE QMGR

But I can use the way you said logging into the server and running as DOS batch file. That is better then doing one by one.

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 22, 2008 12:47 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are you sure that psexec doesn't like it?

Or do you need to quote things correctly, to allow psexec to know where the command starts and ends, and to protect the | from the shell running psexec... ?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jeevan
PostPosted: Fri Jan 25, 2008 2:52 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

jefflowrey wrote:
Are you sure that psexec doesn't like it?

Or do you need to quote things correctly, to allow psexec to know where the command starts and ends, and to protect the | from the shell running psexec... ?


What I discovered is that it works if I give local queue manager. I mean

psexec \\localhost | echo dis ql(*) | runmqsc QMGR works fine. But when I changed the host and qmgr to remote, it does not work.

eg psexec \\rhost | echo dis ql(*) | runmqsc RQMGR


Seems very strange.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 25, 2008 3:13 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I don't think | does what you think it does, in those code examples.

Nothing I've seen says this is anything other than a shell scripting problem.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Automating amqsput for putting message in many qs
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.