NAME

MQSeries::Message::IIH -- Class to send/receive IMS Bridge Header (IIH) messages

SYNOPSIS

use MQSeries::Message::IIH;

#
# Create a message to be put on a queue going to IMS
#
my $message = MQSeries::Message::IIH->
  new(Header => { Authenticator => 'foobar',
                  CommitMode    => MQSeries::MQICM_COMMIT_THEN_SEND,
                  TranState     => MQSeries::MQITS_IN_CONVERSATION,
                },
      Data   => { Transaction => 'ISIC7000',
                  Body        => '   Blah Blah Blah   ',
                },
      );

#
# Get a message from an IMS queue
#
my $queue = MQSeries::Queue->
  new(QueueManager => 'TEST.QM',
      Queue        => 'IMS.DATA.QUEUE',
      Mode         => 'input');
my $msg = MQSeries::Message::IIH->new();
$queue->Get(Message => $msg);
my $data = $msg->Data();
print "Have transaction '", $data->{Transaction}, 
  "' and body '", $data->{Body}, "'\n";

DESCRIPTION

This is a simple subclass of MQSeries::Message which supports sending and retrieving IMS Bridge Header (IIH) messages. This class is experimental, as it was based on the documentation and a few sample messages; feedback as to how well it works is welcome.

An IMS Bridge Header message contains an IIH header, followed by one more data chunks with IMS transaction data. Each chunk has a transaction name and a body.

METHODS

PutConvert, GetConvert

Neither of these methods are called by the users application, but are used internally by MQSeries::Queue::Put() and MQSeries::Queue::Get(), as well as MQSeries::QueueManager::Put1().

PutConvert() encodes the data supplied by the programmer into a series of chunks as required by IMS.

GetConvert() decodes IMS data into a series of chunks, each which a transaction name and body.

For both PutConvert() and GetConvert() (message creation or message data extraction), the data can come in two forms:

  • A hash-reference with a Transaction and Body, as shown in the example above. This is the common case.

  • A reference to an array with hash-references, each in the same format as before. I am not sure whether anyone would actually use this...

_setEndianess

An IMS message contains a number of numerical fields that are encoded based on the endian-ness of the queue manager. In most cases, that is the same endian-ness as the client (certainly if both run on the same machine), and this module uses that as the default.

If you need to override the guess made by this module, then you can invoke the _setEndianess method with 0 if server is little-endian (Linux/Intel, Windows NT) and 1 if server is big-endian (Solaris/SPARC).

For example, if you run on a Linux/Intel machine, but need to create a message for a queue manager running on Solaris:

MQSeries::Message::IIH->_setEndianess(1);
my $message = MQSeries::Message::IIH->
  new(Header => { Authenticator => 'foobar',
                  CommitMode    => MQSeries::MQICM_COMMIT_THEN_SEND,
                  TranState     => MQSeries::MQITS_IN_CONVERSATION,
                },
      Data   => { Transaction => 'ISIC7000',
                  Body        => '   Blah Blah Blah   ',
                },
      );

AUTHORS

Hildo Biersma, Jeff Dunn

SEE ALSO

MQSeries(3), MQSeries::QueueManager(3), MQSeries::Queue(3), MQSeries::Message(3)