++ed by:

2 PAUSE users
1 non-PAUSE user.

Tomas Doran




    # Terminal 1:

    # Terminal 2:
    $ message-passing --output STDOUT --input ZeroMQ --input_options '{"socket_bind":"tcp://*:5552"}'


A ZeroMQ transport for Message::Passing.






In your application emitting messages, you can either use Message::Passing::Output::ZeroMQ directly, or you can use it via Log::Dispatch::Message::Passing.

    use Log::Dispatch;
    use Log::Dispatch::Message::Passing;
    use Message::Passing::Output::ZeroMQ;
    use Message::Passing::Filter::Encode::JSON;

    my $log = Log::Dispatch->new;

        name      => 'myapp_aggregate_log',
        min_level => 'debug',
        output    => Message::Passing::Filter::Encode::JSON->new(
            connect => 'tcp://',








All consumers will get a copy of every message.








Both Message::Passing::Input::ZeroMQ and Message::Passing::Output::ZeroMQ support either binding a server or connecting to a remote host, due to the fact that ZeroMQ connections can be in any direction, as noted above.

Therefore, each input or output should have one (but not both!) of the following attributes:


Connects to a remote server, e.g. tcp://


Binds a server and waits for connections from clients, e.g. tcp://*:5222


This defaults to SUB for Message::Passing::Input::ZeroMQ and PUB for Message::Passing::Output::ZeroMQ, however you can override it to PUSH/PULL as appropriate for your use case if desired.



    # The message distributor:

    # Workers
        package MyApp::MessageWorker;
        use Moo;


        sub filter {
            my ($self, $message) = @_;
            return undef; # Do not output the message..

        --filter '+MyApp::MessageWorker'
        --output STDOUT







Tomas (t0m) Doran <bobtfish@bobtfish.net>


This module exists due to the wonderful people at Suretec Systems Ltd. <http://www.suretecsystems.com/> who sponsored its development for its VoIP division called SureVoIP <http://www.surevoip.co.uk/> for use with the SureVoIP API - <http://www.surevoip.co.uk/support/wiki/api_documentation>


Copyright Suretec Systems 2012.


GNU Affero General Public License, Version 3
