Author |
Message
|
ram2s2001 |
Posted: Sun Dec 11, 2005 11:27 pm Post subject: URGENT- HELP Shellscript for MQSeries |
|
|
Newbie
Joined: 11 Dec 2005 Posts: 6
|
I have an Queue Manager "QM" and LocalQueueries "LQ1" and "LQ2" . I have an sample XML message file.
Already created QM and LQ1 and LQ2.
HOW to write shellscript for starting QM1 ,sending and receiving xml file in LINUX.Not using any java AND C only shellscripts on both sides.
My Client does't allow third party tools.
THANKS LOT.
Last edited by ram2s2001 on Mon Dec 12, 2005 9:52 pm; edited 1 time in total |
|
Back to top |
|
 |
ram2s2001 |
Posted: Mon Dec 12, 2005 3:49 am Post subject: URGENT- HELP Shellscript for MQSeries |
|
|
Newbie
Joined: 11 Dec 2005 Posts: 6
|
i know how to write general shellscript ,iam new to MQSeries,Plz if any body know plz give you sugg . |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 12, 2005 4:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There is no way to execute the MQ APIs to connect to a queue manager, open a queue, and put or get messages from just shell script. You will need a program to do this for you, that is not written in a shell script.
So you will not be able to send or receive an xml file from pure shell script, without invoking some other program.
And most of the presupplied sample programs are not robust enough for general purpose use like this. You can look at support packs, some of them are better at this than the amqsput/get. You can look at CapitalWare's MQBatchEdit, which is specifically designed to be used in this way. _________________ I am *not* the model of the modern major general.
Last edited by jefflowrey on Tue Dec 13, 2005 4:23 am; edited 1 time in total |
|
Back to top |
|
 |
vennela |
Posted: Mon Dec 12, 2005 8:37 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Q support pac might be helpful |
|
Back to top |
|
 |
ram2s2001 |
Posted: Tue Dec 13, 2005 12:51 am Post subject: |
|
|
Newbie
Joined: 11 Dec 2005 Posts: 6
|
#!/usr/bin/sh
infile="test.xml"
if [ "$1" == "MQ" ]; then
echo "Start MQSeries"
strmqm
echo
cat $infile
fi
Plz give some sugg on this approach. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Tue Dec 13, 2005 1:26 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
you should read what has been answered so far to your question.
you should read the manuals
you will need a program to put messages to a queue
you will need queue and channel definitions (if you want do send the messages to other systems)
why do you want to start mq every time? do you want to end it after the program has done? if so, you must make sure your messages are delivered. or decide to keep mq up and running and so on.
you must do some design work. and for that you must know at least some basics about mq, so go and read some manuals. _________________ Regards, Butcher |
|
Back to top |
|
 |
fschofer |
Posted: Tue Dec 13, 2005 1:35 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
|
Back to top |
|
 |
ram2s2001 |
Posted: Wed Dec 14, 2005 2:11 am Post subject: |
|
|
Newbie
Joined: 11 Dec 2005 Posts: 6
|
Hi,
What is difference between in /opt/mqm/bin commmands
and /opt/mqm/samp/bin commands ..? |
|
Back to top |
|
 |
Mr Butcher |
Posted: Wed Dec 14, 2005 2:26 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
the difference iss............ /samp
you should have a look into the directories. because you asked for the difference, i assume that 1. you did not look at the directories content or 2. you looked at the directory content but never looked into the documentation like the first steps or the system administration guide.
you really should start with the documentation first. _________________ Regards, Butcher |
|
Back to top |
|
 |
fschofer |
Posted: Wed Dec 14, 2005 2:32 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
/opt/mqm/bin
=>
commmands to administer Websphere MQ
- start / stop components
- configure / show parameters
...
/opt/mqm/samp/bin commands
=>
sample programs with source code (C, CPP, Java, Cobol, ...)
- read / write q
- display queue content
...
Greetings
Frank |
|
Back to top |
|
 |
ram2s2001 |
Posted: Wed Dec 14, 2005 3:28 am Post subject: |
|
|
Newbie
Joined: 11 Dec 2005 Posts: 6
|
!/usr/bin/sh
infile="test.xml"
if [ "$1" == "MQ" ]; then
echo "Start QueryManager"
strmqm <querymanagername>
echo
echo "Put file in Queue"
cat $infile | while read line
do
amqsput <localqueryname> <QueManagerName> $line
done
echo
echo "End QueryManager"
#endmqm <<querymanagername>>
echo
fi
1)Is it correct way to send file in shellscript without using C and JAVA.?
2)AMQSPUT command available in /opt/mqm/samp/bin can i use this command..?
3)same way i will write one more shellscript for reciving file at other end..?
Thanks lot. |
|
Back to top |
|
 |
wschutz |
Posted: Wed Dec 14, 2005 3:41 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Listen, download the 'q' program, supportpac MA01 from here:
http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg24000647&loc=en_US&cs=utf-8&lang=en
Untar it and install it someplace nice ...
then, you can write this shell script to put messages to a queue:
<path to q>/q -m<qmgrname> -o<quue name> -f $1
and the shell script to read the messages:
<path to q>/q -m<qmgrname> -I<quue name> -f $1
and the shell script to browse the messages:
<path to q>/q -m<qmgrname> -i<quue name> -f $1 _________________ -wayne |
|
Back to top |
|
 |
ram2s2001 |
Posted: Wed Dec 14, 2005 4:14 am Post subject: |
|
|
Newbie
Joined: 11 Dec 2005 Posts: 6
|
iam sending encrypted file through MQSeries is it WebSphere MQ - Q program support..? is it third part support ..? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Dec 14, 2005 4:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Look.
Read what has been said.
Using the sample programs is not going to do what you need.
Download the Q program from the link that Wayne gave you. Read the documentation. Decide if it is good for what you need or not.
Also, think a little bit.
Why should MQ be written in a way that it cares if a file is encrypted or not, or XML or not, or anything particular instead of something else?
How big is the file? Is it possible to send a message of an arbitrary size using MQ? Is it possible to send a file of arbitrary size in a single message?
Does someone need to know if a file is sent, or not sent? Do they need to know when a particular file was sent? Do they need to be able to resend a file, if it was not sent?
You are trying to do something that ends up being fairly complicated, using simple methods. Sending files using MQ only seems to be easy at first.
Also, if you are using v6, then there is a presupplied - but very poor (but better than what you'll get from your shell script) - set of file transfer tools. So maybe you should upgrade to v6 instead of trying to reinvent this particular wheel. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Toronto_MQ |
Posted: Thu Dec 15, 2005 7:55 am Post subject: |
|
|
 Master
Joined: 10 Jul 2002 Posts: 263 Location: read my name
|
I've got to say, you guys are patient. I would have given up on this one a long time ago. |
|
Back to top |
|
 |
|