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 » putting a file to a Remote queue

Post new topic  Reply to topic Goto page 1, 2  Next
 putting a file to a Remote queue « View previous topic :: View next topic » 
Author Message
raj
PostPosted: Thu Mar 24, 2005 11:32 am    Post subject: putting a file to a Remote queue Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 24, 2005 11:41 am    Post subject: Reply with quote

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
View user's profile Send private message
raj
PostPosted: Thu Mar 24, 2005 11:47 am    Post subject: Hi Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 24, 2005 11:52 am    Post subject: Reply with quote

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
View user's profile Send private message
kman
PostPosted: Thu Mar 24, 2005 7:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
EddieA
PostPosted: Thu Mar 24, 2005 11:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
kman
PostPosted: Thu Mar 24, 2005 11:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
jefflowrey
PostPosted: Fri Mar 25, 2005 5:38 am    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Fri Mar 25, 2005 6:25 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Fri Mar 25, 2005 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Fri Mar 25, 2005 2:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Mar 25, 2005 2:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Fri Mar 25, 2005 2:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Mar 25, 2005 5:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Michael Dag
PostPosted: Sat Mar 26, 2005 3:17 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General IBM MQ Support » putting a file to a Remote queue
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.