Net::AMQP::Protocol - Loading code of the AMQP spec


Net-AMQP documentation  | view source Contained in the Net-AMQP distribution.

Index


NAME

Top

Net::AMQP::Protocol - Loading code of the AMQP spec

DESCRIPTION

Top

This class serves as a loader for the auto-generated classes of the protocol.

CLASS METHODS

Top

Returns a binary string representing the header of any AMQP communications

load_xml_spec ($xml_fn)

Reads in the AMQP XML specifications file, XML document node <amqp>, and generates subclasses of Net::AMQP::Protocol::Base for each frame type.

Names are normalized, as demonstrated by this example:

  <class name='basic'>
    <method name='consume-ok'>
      <field name='consumer tag'>
    </method>
  </class>

creates the class Net::AMQP::Protocol::Basic::ConsumeOk with the field accessor consumer_tag(), allowing you to create a new object as such:

  my $method = Net::AMQP::Protocol::Basic::ConsumeOk->new(
      consumer_tag => 'blah'
  );

  print $method->consumer_tag() . "\n";
  if ($method->class_id == 60 && $method->method_name == 21) {
    # do something
  }

SEE ALSO

Top

Net::AMQP

COPYRIGHT

Top

AUTHOR

Top

Eric Waters <ewaters@gmail.com>


Net-AMQP documentation  | view source Contained in the Net-AMQP distribution.