1Net::AMQP(3) User Contributed Perl Documentation Net::AMQP(3)
2
3
4
6 Net::AMQP - Advanced Message Queue Protocol (de)serialization and
7 representation
8
10 use Net::AMQP;
11
12 Net::AMQP::Protocol->load_xml_spec('amqp0-8.xml');
13
14 ...
15
16 my @frames = Net::AMQP->parse_raw_frames(\$input);
17
18 ...
19
20 foreach my $frame (@frames) {
21 if ($frame->can('method_frame') && $frame->method_frame->isa('Net::AMQP::Protocol::Connection::Start')) {
22 my $output = Net::AMQP::Frame::Method->new(
23 channel => 0,
24 method_frame => Net::AMQP::Protocol::Connection::StartOk->new(
25 client_properties => { ... },
26 mechanism => 'AMQPLAIN',
27 locale => 'en_US',
28 response => {
29 LOGIN => 'guest',
30 PASSWORD => 'guest',
31 },
32 ),
33 );
34 print OUT $output->to_raw_frame();
35 }
36 }
37
39 This module implements the frame (de)serialization and representation
40 of the Advanced Message Queue Protocol (http://www.amqp.org/). It is
41 to be used in conjunction with client or server software that does the
42 actual TCP/IP communication.
43
45 parse_raw_frames
46 Net::AMQP->parse_raw_frames(\$binary_payload)
47
48 Given a scalar reference to a binary string, return a list of
49 Net::AMQP::Frame objects, consuming the data in the string. Croaks on
50 invalid input.
51
53 Net::AMQP::Value, Net::RabbitMQ, AnyEvent::RabbitMQ, Net::RabbitFoot,
54 POE::Component::Client::AMQP
55
57 AMQP 0-8 is fully supported.
58
59 AMQP 0-9, 0-9-1, and 0-10 are usably supported. There are
60 interoperability issues with table encodings because the standard
61 disagrees with the dialects of major implementations (RabbitMQ and
62 Qpid). For now, Net::AMQP limits itself to universally agreed table
63 elements. See <http://www.rabbitmq.com/amqp-0-9-1-errata.html> for
64 details.
65
66 AMQP 1.0 has not been tested.
67
69 Address the dialect problem, either via modified spec files that
70 completely control the wire protocol, or by programmatic request. The
71 former has precedent (viz "qpid.amqp0-8.xml" in spec), but could cause
72 a combinatorial explosion as more brokers and versions are added. The
73 latter adds interface complexity.
74
76 "All problems in computer science can be solved by another level of
77 indirection." -- David Wheeler's observation
78
79 "...except for the problem of too many layers of indirection." --
80 Kevlin Henney's corollary
81
83 Copyright (c) 2009 Eric Waters and XMission LLC
84 (http://www.xmission.com/). Copyright (c) 2012, 2013 Chip Salzenberg
85 and Topsy Labs (http://labs.topsy.com/). All rights reserved.
86
87 This program is free software; you can redistribute it and/or modify it
88 under the same terms as Perl itself. The full text of the license can
89 be found in the LICENSE file included with this module.
90
92 Eric Waters <ewaters@gmail.com>
93
94
95
96perl v5.32.0 2020-07-28 Net::AMQP(3)