Websphere MQ Everyplace

examples.assured
Class SendTestMessagesAssured

java.lang.Object
  |
  +--examples.assured.SendTestMessagesAssured

public class SendTestMessagesAssured
extends java.lang.Object

To send a never-ending sequence of test messages from one queue manager to another, with a specified time period waiting between successive send operations.

If the application is stopped, by killing the task, pick-up where we left off in an assured manner, so if messages were half-put but not confirmed, then these get confirmed, and we move onto the next message.

Syntax

java examples.assured.SendTestMessagesAssured <queue_name> <hosting_queue_manager> <ini_file> <seconds> <maxMsgsToSend> <stateFile>

Parameters

queue_name
is the name of the remote queue we are creating
hosting_queue_manager
is the name of the queue manager on which the queue actually exists. This will normally be the same queue manager described in the specified ini_file.
ini_file
Name of the ini file used to open a client queue manager, to send the messages from.
milliseconds
The number of milliseconds between successive send message operations. ie: The delay between each message in time.
StateFile
Name of the file to be used in the current directory, to store persistent information.


Field Summary
static java.lang.String FIELD_NAME_MSG_INDEX
          The name of the field in the message in which the number of the message is put.
 long sleepMilliSeconds
          The number of seconds the program sleeps for after it's posted the message...
static short[] version
          The version of this program
 
Constructor Summary
SendTestMessagesAssured()
           
 
Method Summary
 void activate(java.lang.String[] args)
          Gets the command-line parameters, and loops sending messages.
static void main(java.lang.String[] args)
          Entry point from the command line.
protected  void sendTestMsg(java.lang.String targetQ, java.lang.String targetQMgr, MQeQueueManager myQMgr, java.lang.String stateFile)
          Sends a test message.
 
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
The version of this program


sleepMilliSeconds

public long sleepMilliSeconds
The number of seconds the program sleeps for after it's posted the message... To give any asynchronous threads some chance of sending the message on to a different queue manager.


FIELD_NAME_MSG_INDEX

public static final java.lang.String FIELD_NAME_MSG_INDEX
The name of the field in the message in which the number of the message is put.

See Also:
Constant Field Values
Constructor Detail

SendTestMessagesAssured

public SendTestMessagesAssured()
Method Detail

main

public static void main(java.lang.String[] args)
Entry point from the command line.


activate

public void activate(java.lang.String[] args)
              throws java.lang.Exception
Gets the command-line parameters, and loops sending messages.

Parameters:
args -
Returns:
void
Throws:
java.lang.Exception

sendTestMsg

protected void sendTestMsg(java.lang.String targetQ,
                           java.lang.String targetQMgr,
                           MQeQueueManager myQMgr,
                           java.lang.String stateFile)
                    throws java.lang.Exception
Sends a test message.

Parameters:
targetQ - A String containing the target Queue name
targetQMgr - A String containing the target Queue Manager name
myQMgr - MQeQueueManager Object
stateFile - A String containing the path of statefile
Returns:
void
Throws:
java.lang.Exception

Websphere MQ Everyplace