Net-AMQP-RabbitMQ-PP

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.09 2019-07-17
    - [add] pass through SSL connection options (GH #13, thanks to pm426)

0.08 2019-02-26
    - [fix] install dependency load order issues (GH #12)

0.07 2019-02-25
    - [add] Socket Timeout support (GH #10)

0.06 2018-08-02
    - [add] SSL support - requires optional IO::Socket::SSL (GH #9)
      thanks to Jonathan Briggs for the above patch

0.05 2017-05-12
    - [fix] install failures due to dependencies not listed

0.04 2017-04-28
    - [add] return delivery_tag with basic_get (GH #2, GH #3)
      thanks to Ben Kaufman for the patch

0.03 2016-08-16

README.md  view on Meta::CPAN

                timeout        => undef,
                username       => 'guest',
                password       => 'guest',
                virtual_host   => '/',
                heartbeat      => undef,
                socket_timeout => 5,
                frame_max      => 131072,
        );

connect can also take a secure flag for SSL connections, this will only work if
[IO::Socket::SSL](https://metacpan.org/pod/IO%3A%3ASocket%3A%3ASSL) is available. You can also pass SSL specific arguments through
in the connect method and these will be passed through

        $mq->connect(
                ...
                secure => 1,
                SSL_blah_blah => 1,
        );

## disconnect

lib/Net/AMQP/RabbitMQ/PP.pm  view on Meta::CPAN

use File::ShareDir;
use IO::Select;
use IO::Socket::INET;
use Socket qw( IPPROTO_TCP );
use List::MoreUtils;
use Net::AMQP;
use Sys::Hostname;
use Try::Tiny;
use Time::HiRes;

use constant HAS_TLS => eval { require IO::Socket::SSL; 1 };

sub new {
	my ( $class, %parameters ) = @_;

	if( ! %Net::AMQP::Protocol::spec ) {
		Net::AMQP::Protocol->load_xml_spec(
			File::ShareDir::dist_file(
				'Net-AMQP-RabbitMQ-PP',
				'amqp0-9-1.extended.xml'
			)

lib/Net/AMQP/RabbitMQ/PP.pm  view on Meta::CPAN

		};

		if( $args{timeout} ) {
			Time::HiRes::alarm( $args{timeout} );
		}

		my $connection_class = "IO::Socket::INET";
		my %connection_args;

		if ( $args{secure} ) {
			die "IO::Socket::SSL is required for secure connections"
				if ! HAS_TLS;
			$connection_class = "IO::Socket::SSL";
			my @ssl_args = grep { /^SSL_/ } sort keys %args;
			@connection_args{ @ssl_args } = @args{ @ssl_args };
		}

		$self->_set_handle(
			$connection_class->new(
				PeerAddr => $args{host} || 'localhost',
				PeerPort => $args{port} || ( $args{secure} ? 5671 : 5672 ),
				( ! $args{secure} ? ( Proto => 'tcp' ) : () ),
				( $args{socket_timeout} ? ( Timeout => $args{socket_timeout} ) : () ),

lib/Net/AMQP/RabbitMQ/PP.pm  view on Meta::CPAN

		timeout        => undef,
		username       => 'guest',
		password       => 'guest',
		virtual_host   => '/',
		heartbeat      => undef,
		socket_timeout => 5,
		frame_max      => 131072,
	);

connect can also take a secure flag for SSL connections, this will only work if
L<IO::Socket::SSL> is available. You can also pass SSL specific arguments through
in the connect method and these will be passed through

	$mq->connect(
		...
		secure => 1,
		SSL_blah_blah => 1,
	);

=head2 disconnect



( run in 0.292 second using v1.01-cache-2.11-cpan-05444aca049 )