Author |
Message
|
jeevan |
Posted: Tue Jan 22, 2008 8:37 am Post subject: Automating amqsput for putting message in many qs |
|
|
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 |
|
 |
Vitor |
Posted: Tue Jan 22, 2008 8:39 am Post subject: |
|
|
 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 |
|
 |
jeevan |
Posted: Tue Jan 22, 2008 8:45 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Jan 22, 2008 8:49 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Tue Jan 22, 2008 8:52 am Post subject: |
|
|
 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 |
|
 |
jeevan |
Posted: Tue Jan 22, 2008 12:45 pm Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Jan 22, 2008 12:47 pm Post subject: |
|
|
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 |
|
 |
jeevan |
Posted: Fri Jan 25, 2008 2:52 pm Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Fri Jan 25, 2008 3:13 pm Post subject: |
|
|
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 |
|
 |
|