MQ Engineering Group

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 $qmgr_obj = MQSeries::QueueManager->new(QueueManager => 'TEST.QM');
  my $queue = MQSeries::Queue->
    new(QueueManager => $qmgr_obj,
        Queue        => 'IMS.DATA.QUEUE',
        Mode         => 'input');
  my $msg = MQSeries::Message::IIH->new();
  $queue->Get(Message => $msg);
  my $data = $msg->Data(); # Array-reference

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. For requests, each chunk has a transaction name and a body; for replies, each chunk is free form.

METHODS

PutConvert

This method is not called by the user's application, but used internally by MQSeries::Queue::Put() and MQSeries::QueueManager::Put1().

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

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...

GetConvert

This method is not called by the user's application, but used internally by MQSeries::Queue::Get().

GetConvert() decodes IMS data into a series of chunks, returned as an array-reference containing strings.

_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, Javier Ripoll Villagómez

SEE ALSO

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

1 POD Error

The following errors were encountered while parsing the POD:

Around line 415:

Non-ASCII character seen before =encoding in 'Villagómez'. Assuming ISO8859-1