NAME

WWW::RabbitMQ::Broker::Shovel

SYNOPSIS

# You need to have a broker object first
my $broker = WWW::RabbitMQ::Broker->new(
	username => 'guest',
	password => 'guest,
	host     => 'localhost',
);

# Pass the broker object to the shovel with your shovel's config
my $shovel = WWW::RabbitMQ::Broker::Shovel->new(
	$broker,
	config => {
		component => 'shovel',
		name      => 'example_shovel',
		vhost     => 'example_vhost',
		value     => {
		        'ack-mode'          => 'on-confirm',
		        'delete-after'      => 'never',
		        'src-uri'           => 'amqp://',
		        'src-exchange'      => 'amq.direct',
		        'src-exchange-key'  => 'example_queue',
		        'dest-uri'          => 'amqp://guest:guest@remotehost.com/example_vhost',
		        'dest-exchange'     => 'amq.direct',
		        'dest-exchange-key' => 'example_queue',
		},
	},
);

# Get or Create the shovel. This is probably the best method to use in general for setting shovels
# up, unless you are specifically looking for failures.
$shovel->getOrPut;

# Get all the configuration details for the shovel
my $shovel_details = $shovel->getConfig;

DESCRIPTION

A simple wrapper around the RabbitMQ Shovel plugin

METHODS

new

Create a new WWW::RabbitMQ::Broker Object

Takes a $broker as its first argument, needs to be a valid WWW::RabbitMQ::Broker object.

Additional arguments will be used as part of the shovel configuration.

delete

Removes the shovel from the given broker.

get

Retrieves the shovel based on the configuration given

getConfig

Retrieves the current configuration for the shovel object, which can be updated with ->get or getOrPut

getOrPut

Safely lets you create or retrieve a shovel to minimize failing

put

Creates the shovel based on given configuration