Author |
Message
|
raj |
Posted: Thu Mar 24, 2005 11:32 am Post subject: putting a file to a Remote queue |
|
|
Centurion
Joined: 31 Mar 2002 Posts: 104
|
Hi,
We need to put a file on to a remote queue.The file is generated by a application and put in a folder say /abc/cde/file
There is a script which has the parameters like this
amqsput.sh RQ QM <TRIG.TXT
Now what does the TRIG.TXT contain? Is it the path to the file to be transfered?? i.e /abc/cde/file
Thanks
Raj |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 24, 2005 11:41 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You shouldn't use amqsput to copy files into queues.
It's not designed for it, and will break far more often than it succeeds - since files will have line endings in them far more often than "never". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
raj |
Posted: Thu Mar 24, 2005 11:47 am Post subject: Hi |
|
|
Centurion
Joined: 31 Mar 2002 Posts: 104
|
My actual script looks like this
$MQDIR/amqsput.sh $1_$2_RAM_OUTBOUND_QUEUE $1.QUEUE.MANAGER < $MQDIR/$1/out/trig.txt
My file is on one server, MQ is on a solaris box, and the destination QM is on a wINDOWS BOX.one job runs and puts the trig.txt in
MQDIR/$1/out/trig.txt folder on the MQ box. I am not sure what is there in the trig.txt |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 24, 2005 11:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
amqsput.sh is apparently a custom script that someone at your organization wrote.
Maybe you should ask them. Or open it up with something like vi and read it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kman |
Posted: Thu Mar 24, 2005 7:44 pm Post subject: |
|
|
Partisan
Joined: 21 Jan 2003 Posts: 309 Location: Kuala Lumpur, Malaysia
|
definitely it's a text file that contains the messages.
And definitely it will break after the first line, since the original sample amqsput terminates sending a message once a next line is found in the file. Unless the text file contains one long message without any line termination. Which amqsput also will break once hitting the buffer size limit.
And as jeff put it,
Quote: |
Do not ask the same question twice |
 |
|
Back to top |
|
 |
EddieA |
Posted: Thu Mar 24, 2005 11:38 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
And definitely it will break after the first line, since the original sample amqsput terminates sending a message once a next line is found in the file |
No. It will write one message for each "string" terminated by a line feed. It will terminate when it gets to the end of the file, or a line feed with no data.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
kman |
Posted: Thu Mar 24, 2005 11:49 pm Post subject: |
|
|
Partisan
Joined: 21 Jan 2003 Posts: 309 Location: Kuala Lumpur, Malaysia
|
my mistake. It breaks after an empty line, not necessarily eof. Unless there's no empty line until eof. because the amqsput ending is to supply enter (interactively). |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 25, 2005 5:38 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm fairly certain that amqsput will ALSO break when it reaches it's buffer length (5000 characters?).
That means that if your records are long than that, it will either truncate them or send more than one message for each record.
In other words: Don't use AMQSPUT for sending files! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Mar 25, 2005 6:25 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
The buffer size is only 100 bytes:
Code: |
char buffer[100]; /* message buffer */ |
|
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 25, 2005 6:29 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
bower5932 wrote: |
The buffer size is only 100 bytes:
[code] char buffer[100]; |
Oh, that's right. It's the Q program that has a default buffer length of 5k... or maybe 1k?
Small, when talking about files, anyway. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Mar 25, 2005 2:17 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
amqsputc seems to work OK for putting files. I wrote a script that connects to every one of my QMs and puts 100 messages down every channel. I call it the channel checker, and we use it anytime we do maintenance in the middle of the night. It proves all MQ Intercommunications are working after the reboot.
Code: |
SET MQSERVER=CHANNEL.CHECKER/TCP/MQHAC002R
AMQSPUTC HIGHUBPA.LOCAL.QUEUE<in.txt
REM
REM
SET MQSERVER=CHANNEL.CHECKER/TCP/BRS03(1414)
AMQSPUTC HIGHUBPA.LOCAL.QUEUE<in.txt
REM
REM
SET MQSERVER=CHANNEL.CHECKER/TCP/BRS04(1414)
AMQSPUTC HIGHUBPA.LOCAL.QUEUE<in.txt
REM
REM
.
.
.
|
IN.TXT looks like this:
Code: |
1
2
3
.
.
.
.
99
100
|
Then I do the same thing with amqsgetc to clean up all the collection queues. If any XMITQs back up, we get paged right away. This way I go to sleep knowing all the channels are OK and the application messages will flow succesfuly 1st thing in the morning. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 25, 2005 2:30 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Which is fine for one particular file. But not as a general solution for "how do I put a file onto a queue".
And I thought you had fancy monitoring tools that would assure you that your channels were running, and you wouldn't need this kind of "pig in the pipe" hackery...  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Mar 25, 2005 2:36 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
your killing me!!!!
Any monitoring tool will keep quiet if the channels correctly come up as Inactive after the reboot. But if the 1st message down the channel is going to cause a problem to surface, and send the channel into retrying, I would rather that be my channel checker message at 2 AM, then a customer message at 5 AM.
Your point is valid about the files. Just because my simple little file works does not mean all (most) will work. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 25, 2005 5:09 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
PeterPotkay wrote: |
if the 1st message down the channel is going to cause a problem to surface, and send the channel into retrying, I would rather that be my channel checker message at 2 AM, |
Still... I have to think that echo "start channel abc"|runmqsc would be simpler...
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Michael Dag |
Posted: Sat Mar 26, 2005 3:17 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
hmm have to agree with Peter, I don't recall exactly what happened when and how, but have been in situations where starting channels was fine and everything looked ok, until the first real traffic occured. _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
|