Websphere MQ Everyplace

examples.mqbridge.application
Class PutFromMQ

java.lang.Object
  |
  +--examples.mqbridge.application.PutFromMQ

public class PutFromMQ
extends java.lang.Object

Tool to put a message to an MQSeries queue, such that the user can specify the target queue and the target queue manager.

Each message generated contains a message body which is a single unicode string, as specified by the user on the command-line, followed by a number of bytes needed to pad-out the message body to a specific size. All padding bytes have a value of zero.

Syntax :

java examples.mqbridge.application.PutFromMQ <mq_q_mgr> <target_q> <target_qmgr> <msgs> <size> <text>

Parameters :

mq_q_mgr :
The name of the MQSeries queue manager to connect to, from which messages are sent. As this programs uses java bindings classes to access the MQ qmgr, the MQ queue manager needs to be on the same machine as the test program.
target_q :
The name of the queue to which messages will sent.
target_qmgr :
The queue manager on which the target queue resides.
msgs :
The number of messages to send. An integer. If <=0 then a continual stream of messages will be generated as quickly as possible. (so you will need to Ctrl-C out of the program to stop it).
size :
The size of the message payload to be sent. This must be an integer. The text message (see below) specified by the user is written to the message body, followed by a number of bytes needed to pad-out the message body to this specific size. A value of <=0 means don't add any padding bytes to the message.
text :
A unicode string which will be put into the message body of the message. Note that with some shells, you may need to use quote characters if the text string contains spaces.

Output :

The program will output one line of text for each message sent. The line of text contains a millisecond-representation of the current system time followed by the number of messages sent so far.


Field Summary
static java.lang.String syntax
          The syntax string.
static short[] version
           
 
Constructor Summary
PutFromMQ()
           
 
Method Summary
 void activate(java.lang.String[] args)
          Called to do the work of the program, from the main.
static void main(java.lang.String[] args)
          The entry point to the program from the command-line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version

syntax

public static java.lang.String syntax
The syntax string. Displayed to the caller if incorrect number of parameters are given.

Constructor Detail

PutFromMQ

public PutFromMQ()
Method Detail

main

public static void main(java.lang.String[] args)
The entry point to the program from the command-line.

Parameters:
args - The command-line arguments. See the documentation for the class for descriptions of what parameters are expected.

activate

public void activate(java.lang.String[] args)
              throws java.lang.Exception
Called to do the work of the program, from the main.

Parameters:
args - The arguments passed from the command-line arguments. See the documentation for the class for details of what these arguments should contain.
Throws:
java.lang.Exception

Websphere MQ Everyplace