MQ Engineering Group > MQSeries-1.30 > MQSeries::Message::RFH2

Download:
MQSeries-1.30.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  8
Open  4
View/Report Bugs
Module Version: 1.30   Source   Latest Release: MQSeries-1.34

NAME ^

MQSeries::Message::RFH2 -- Class to send/receive RFH2 messages

SYNOPSIS ^

  use MQSeries::Message::RFH2;

  #
  # Create an RFH2 message with default settings
  #
  my $msg = MQSeries::Message::RFH2->new('Data' => '<foo>bar</foo>');

  #
  # Same while overriding the Flags and NameValue character set id
  #
  my $msg2 = MQSeries::Message::RFH2->
    new('Header' => { 'NameValueCCSID' => 1200, # UCS-2
                      'Flags'          => 1,
                    },
        'Data'   => $ucs2_data);

  #
  # Get RFH2 data
  #
  my $qmgr_obj = MQSeries::QueueManager->new(QueueManager => 'TEST.QM');
  my $queue = MQSeries::Queue->
    new(QueueManager => $qmgr_obj,
        Queue        => 'RFH2.DATA.QUEUE',
        Mode         => 'input');
  my $msg = MQSeries::Message::RFH2->new();
  $queue->Get(Message => $msg);
  my $data = $msg->Data();
  print "Have name-value data '$data'\n";

DESCRIPTION ^

This is a simple subclass of MQSeries::Message which supports sending and retrieving RFH2 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 RFH2 message contains an RFH2 header, followed by a data string with structured name-value data, in XML format.

NOTE: In MQ v7, you may receive what appear to be messages in RFH2 format, when you're really getting a message with message properties. If you're upgrading MQ v7, make sure you rebuild the module to get MQ v7 support; and make sure to set the queue PropertyControl attribute properly.

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

GetConvert() decodes the RFH2 header data and name-value pairs. transaction name and body.

_setEndianess ^

An RFH2 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::RFH2->_setEndianess(1);
  my $message = MQSeries::Message::RFH2->
    new('Data' => '<foo>bar</foo>');

AUTHORS ^

Hildo Biersma, Tim Kimber

SEE ALSO ^

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

syntax highlighting: