Websphere MQ Everyplace

examples.mqbridge.application
Class GetFromMQ

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

public class GetFromMQ
extends java.lang.Object

Tool to destructively read any message appearing on a specified WebSphere MQ queue.

Syntax :

java examples.mqbridge.application.GetFromMQ <mq_q_mgr> <mq_q> <display_flag>

Parameters :

mq_q_mgr :
The name of the MQSeries queue manager to get the messages from. 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.
mq_q :
The name of the MQSeries queue from which messages will be taken and consumed.
display_flag :
One of the following strings...
-contents
Displays the content of the message.
-nocontents
Does not display the content of the message.

How to stop :

Hit Ctrl-C to stop this program.


Field Summary
static java.lang.String BLANK_AS_HEX
           
static int BYTES_PER_LINE
           
static int CHARS_PER_HEX_BYTE
           
static char[] hex
           
static java.lang.String syntax
          How should a user invoke this tool ?
static short[] version
           
static int WAIT_INTERVAL_MILLISECONDS
          How long we wait for a message to arrive.
 
Constructor Summary
GetFromMQ()
           
 
Method Summary
 void activate(java.lang.String[] args)
          The work of the tool is done here.
static java.lang.String byteToAscii(byte data)
          Converts a byte array to Ascii string.
static java.lang.String byteToHex(byte data)
          Given a byte value, converts it into it's hex equivalent.
static void main(java.lang.String[] args)
          The entry point 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

WAIT_INTERVAL_MILLISECONDS

public static final int WAIT_INTERVAL_MILLISECONDS
How long we wait for a message to arrive.

See Also:
Constant Field Values

syntax

public static java.lang.String syntax
How should a user invoke this tool ?


BYTES_PER_LINE

public static final int BYTES_PER_LINE
See Also:
Constant Field Values

CHARS_PER_HEX_BYTE

public static final int CHARS_PER_HEX_BYTE
See Also:
Constant Field Values

BLANK_AS_HEX

public static final java.lang.String BLANK_AS_HEX
See Also:
Constant Field Values

hex

public static final char[] hex
Constructor Detail

GetFromMQ

public GetFromMQ()
Method Detail

main

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


activate

public void activate(java.lang.String[] args)
              throws java.lang.Exception
The work of the tool is done here.

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

byteToAscii

public static java.lang.String byteToAscii(byte data)
Converts a byte array to Ascii string. If the byte is a non-printable character, return the '.'character instead.

Parameters:
data - Byte to be converted to Ascii
Returns:
Ascii String

byteToHex

public static java.lang.String byteToHex(byte data)
Given a byte value, converts it into it's hex equivalent.

Parameters:
data - Byte to be converted to Hex
Returns:
Hex String.

Websphere MQ Everyplace