SlideShare a Scribd company logo
1 of 72
Download to read offline
Motivation
Our Solution
     Issues
  Summary




 Going Postal

    Chisel Wright

     NET-A-PORTER


  YAPC::EU 2010




Chisel Wright   Going Postal
Motivation
               Our Solution
                               Talking To Strangers
                    Issues
                 Summary


Motivation




             Why Bother?



               Chisel Wright   Going Postal
Motivation
                             Our Solution
                                             Talking To Strangers
                                  Issues
                               Summary


A Long Time Ago
When There Weren’t Any Better Solutions




        Direct, far away database writes
        Need to know their dialect
        They can’t easily change their schema
        Tightly coupled




                             Chisel Wright   Going Postal
Motivation
                             Our Solution
                                             Talking To Strangers
                                  Issues
                               Summary


A Long Time Ago
When There Weren’t Any Better Solutions




        Direct, far away database writes
        Need to know their dialect
        They can’t easily change their schema
        Tightly coupled




                             Chisel Wright   Going Postal
Motivation
                             Our Solution
                                             Talking To Strangers
                                  Issues
                               Summary


A Long Time Ago
When There Weren’t Any Better Solutions




        Direct, far away database writes
        Need to know their dialect
        They can’t easily change their schema
        Tightly coupled




                             Chisel Wright   Going Postal
Motivation
                             Our Solution
                                             Talking To Strangers
                                  Issues
                               Summary


A Long Time Ago
When There Weren’t Any Better Solutions




        Direct, far away database writes
        Need to know their dialect
        They can’t easily change their schema
        Tightly coupled




                             Chisel Wright   Going Postal
Motivation
                            Our Solution
                                           Talking To Strangers
                                 Issues
                              Summary


Not quite so long ago
When There Were Options




        TheSchwartz
            resolved a slightly different issue
            first step in the right direction
            didn’t help with far away issue
            perl only




                           Chisel Wright   Going Postal
Motivation
                            Our Solution
                                           Talking To Strangers
                                 Issues
                              Summary


Not quite so long ago
When There Were Options




        TheSchwartz
            resolved a slightly different issue
            first step in the right direction
            didn’t help with far away issue
            perl only




                           Chisel Wright   Going Postal
Motivation
                            Our Solution
                                           Talking To Strangers
                                 Issues
                              Summary


Not quite so long ago
When There Were Options




        TheSchwartz
            resolved a slightly different issue
            first step in the right direction
            didn’t help with far away issue
            perl only




                           Chisel Wright   Going Postal
Motivation
                            Our Solution
                                           Talking To Strangers
                                 Issues
                              Summary


Not quite so long ago
When There Were Options




        TheSchwartz
            resolved a slightly different issue
            first step in the right direction
            didn’t help with far away issue
            perl only




                           Chisel Wright   Going Postal
Motivation
                            Our Solution
                                           Talking To Strangers
                                 Issues
                              Summary


Not quite so long ago
When There Were Options




        TheSchwartz
            resolved a slightly different issue
            first step in the right direction
            didn’t help with far away issue
            perl only




                           Chisel Wright   Going Postal
Motivation
                  ActiveMQ
  Our Solution
                  Net::Stomp
       Issues
                  Net::ActiveMQ
    Summary




Our Solution



  Chisel Wright   Going Postal
Motivation
                ActiveMQ
Our Solution
                Net::Stomp
     Issues
                Net::ActiveMQ
  Summary




ActiveMQ



Chisel Wright   Going Postal
Motivation
                                        ActiveMQ
                        Our Solution
                                        Net::Stomp
                             Issues
                                        Net::ActiveMQ
                          Summary


ActiveMQ




    Java guys like it
    Perl guys can interact with it
    Reliable, well-used solution




                        Chisel Wright   Going Postal
Motivation
                                        ActiveMQ
                        Our Solution
                                        Net::Stomp
                             Issues
                                        Net::ActiveMQ
                          Summary


ActiveMQ




    Java guys like it
    Perl guys can interact with it
    Reliable, well-used solution




                        Chisel Wright   Going Postal
Motivation
                                        ActiveMQ
                        Our Solution
                                        Net::Stomp
                             Issues
                                        Net::ActiveMQ
                          Summary


ActiveMQ




    Java guys like it
    Perl guys can interact with it
    Reliable, well-used solution




                        Chisel Wright   Going Postal
Motivation
                                       ActiveMQ
                       Our Solution
                                       Net::Stomp
                            Issues
                                       Net::ActiveMQ
                         Summary


Net::Stomp




     STOMP is great for talking to ActiveMQ
     Net::Stomp excellent for quickly interacting with ActiveMQ




                       Chisel Wright   Going Postal
Motivation
                                       ActiveMQ
                       Our Solution
                                       Net::Stomp
                            Issues
                                       Net::ActiveMQ
                         Summary


Net::Stomp




     STOMP is great for talking to ActiveMQ
     Net::Stomp excellent for quickly interacting with ActiveMQ




                       Chisel Wright   Going Postal
Motivation
                                         ActiveMQ
                          Our Solution
                                         Net::Stomp
                               Issues
                                         Net::ActiveMQ
                            Summary


Sending with Net::Stomp
Talking to a Queue



   # send a message to the queue ’foo’
   use Net::Stomp;
   my $stomp = Net::Stomp->new({
       hostname    => ’localhost’,
       port        => ’61613’,
   });
   $stomp->connect({
       login       => ’hello’,
       passcode    => ’there’,
   });
   $stomp->send({
       destination => ’/queue/foo’,
       body        => ’test message’,
   });
   $stomp->disconnect;




                         Chisel Wright   Going Postal
Motivation
                                         ActiveMQ
                          Our Solution
                                         Net::Stomp
                               Issues
                                         Net::ActiveMQ
                            Summary


Receiving with Net::Stomp
Subscribing to a Queue



   # subscribe to messages from the queue ’foo’
   use Net::Stomp;
   my $stomp = Net::Stomp->new({
       hostname    => ’localhost’,
       port        => ’61613’,
   });
   $stomp->connect({
       login       => ’hello’,
       passcode    => ’there’,
   });
   $stomp->subscribe({
       destination             => ’/queue/foo’,
       ’ack’                   => ’client’,
       ’activemq.prefetchSize’ => 1,
   });




                         Chisel Wright   Going Postal
Motivation
                                          ActiveMQ
                          Our Solution
                                          Net::Stomp
                               Issues
                                          Net::ActiveMQ
                            Summary


Receiving with Net::Stomp
Plucking from the Queue




   while (1) {
     my $frame = $stomp->receive_frame;
     warn $frame->body; # do something here
     $stomp->ack( { frame => $frame } );
   }
   $stomp->disconnect;




                          Chisel Wright   Going Postal
Motivation
                                                  ActiveMQ
                                   Our Solution
                                                  Net::Stomp
                                        Issues
                                                  Net::ActiveMQ
                                     Summary


Net::Stomp
Thoughts




           Quickly and easily talk to ActiveMQ
           Does what it promises


           Low-level
           Copy-and-paste coding
           Error-handling, . . .




                               Chisel Wright      Going Postal
Motivation
                                                  ActiveMQ
                                   Our Solution
                                                  Net::Stomp
                                        Issues
                                                  Net::ActiveMQ
                                     Summary


Net::Stomp
Thoughts




           Quickly and easily talk to ActiveMQ
           Does what it promises


           Low-level
           Copy-and-paste coding
           Error-handling, . . .




                               Chisel Wright      Going Postal
Motivation
                                                  ActiveMQ
                                   Our Solution
                                                  Net::Stomp
                                        Issues
                                                  Net::ActiveMQ
                                     Summary


Net::Stomp
Thoughts




           Quickly and easily talk to ActiveMQ
           Does what it promises


           Low-level
           Copy-and-paste coding
           Error-handling, . . .




                               Chisel Wright      Going Postal
Motivation
                                                  ActiveMQ
                                   Our Solution
                                                  Net::Stomp
                                        Issues
                                                  Net::ActiveMQ
                                     Summary


Net::Stomp
Thoughts




           Quickly and easily talk to ActiveMQ
           Does what it promises


           Low-level
           Copy-and-paste coding
           Error-handling, . . .




                               Chisel Wright      Going Postal
Motivation
                                                  ActiveMQ
                                   Our Solution
                                                  Net::Stomp
                                        Issues
                                                  Net::ActiveMQ
                                     Summary


Net::Stomp
Thoughts




           Quickly and easily talk to ActiveMQ
           Does what it promises


           Low-level
           Copy-and-paste coding
           Error-handling, . . .




                               Chisel Wright      Going Postal
Motivation
                  ActiveMQ
   Our Solution
                  Net::Stomp
        Issues
                  Net::ActiveMQ
     Summary




Net::ActiveMQ



  Chisel Wright   Going Postal
Motivation
                                       ActiveMQ
                       Our Solution
                                       Net::Stomp
                            Issues
                                       Net::ActiveMQ
                         Summary


Net::ActiveMQ




     Standardise our AMQ solution across apps
     Lower barrier to entry




                       Chisel Wright   Going Postal
Motivation
                                       ActiveMQ
                       Our Solution
                                       Net::Stomp
                            Issues
                                       Net::ActiveMQ
                         Summary


Net::ActiveMQ




     Standardise our AMQ solution across apps
     Lower barrier to entry




                       Chisel Wright   Going Postal
Motivation
                                        ActiveMQ
                         Our Solution
                                        Net::Stomp
                              Issues
                                        Net::ActiveMQ
                           Summary


What Is It?


  Essentially:
      Net::Stomp
      Catalyst::Engine::Stomp
  with a lovely ribbon and bow around it.

      Message producers
      Message consumers
  all in one place.



                        Chisel Wright   Going Postal
Motivation
                                         ActiveMQ
                          Our Solution
                                         Net::Stomp
                               Issues
                                         Net::ActiveMQ
                            Summary


Sending with Net::ActiveMQ
Talking to a Queue


   use Net::ActiveMQ::Producer;

   my $producer = Net::ActiveMQ::Producer->new({
       hostname => ’localhost’,
       port      => 61613
   });

   $producer->send(
       ’Some::Message’,
       { message => ’data’, goes => ’here’ }
   );


   Net::ActiveMQ::Producer - message type does not exist -
     Some::Message
     at /path/to/.../Class/MOP/Method/Wrapped.pm line 159



                         Chisel Wright   Going Postal
Motivation
                                          ActiveMQ
                           Our Solution
                                          Net::Stomp
                                Issues
                                          Net::ActiveMQ
                             Summary


Sending with Net::ActiveMQ
A Producer

   package Net::ActiveMQ::Producer::Some::Message;
   use Moose;
       with ’Net::ActiveMQ::Role::Producer’;

   sub transform {
       my ($self, $header, $data) = @_;
       # make sure it goes somewhere
       $header->{destination} ||= ’/queue/some-message’;

        # the desired action from the consumer
        $data->{’@type’}   ||= ’action_method’;

        # "transform" the data
        $data->{process_time} = scalar localtime;

        return ($header, $data);
   }

   1;

                          Chisel Wright   Going Postal
Motivation
                                            ActiveMQ
                             Our Solution
                                            Net::Stomp
                                  Issues
                                            Net::ActiveMQ
                               Summary


Sending with Net::ActiveMQ
Validate What You Send


   # This is completely optional!
   sub message_spec {
     # Data::Rx format
     return {
       type => ’//rec’,

        required => {
          message         => ’//str’,
        },

         optional => {
           ’@type’        => ’//str’,
           goes           => ’//str’,
           process_time   => ’//str’,
         },
       };
   }


                            Chisel Wright   Going Postal
Motivation
                                         ActiveMQ
                          Our Solution
                                         Net::Stomp
                               Issues
                                         Net::ActiveMQ
                            Summary


Sending with Net::ActiveMQ
Catalyst Model



   # create your model class
   ./script/myapp_create.pl model 
       MyMQ 
       Net::ActiveMQ 
       localhost 
       61613 
       YES


   # in your controller
   $c->model(’MyMQ’)->send(
       ’Some::Message’,
       { message => { a => ’shiny’, hash => ’reference’ } }
   );




                         Chisel Wright   Going Postal
Motivation
                                            ActiveMQ
                             Our Solution
                                            Net::Stomp
                                  Issues
                                            Net::ActiveMQ
                               Summary


Sending with Net::ActiveMQ
Why did you do that?




        sub message_spec
              Used by proof-of-concept
              Can catch your own mistakes
              No compelling reason to remove it
        Data::Rx
              Nicer error messages
              Slightly more agnostic




                            Chisel Wright   Going Postal
Motivation
                                            ActiveMQ
                             Our Solution
                                            Net::Stomp
                                  Issues
                                            Net::ActiveMQ
                               Summary


Sending with Net::ActiveMQ
Why did you do that?




        sub message_spec
              Used by proof-of-concept
              Can catch your own mistakes
              No compelling reason to remove it
        Data::Rx
              Nicer error messages
              Slightly more agnostic




                            Chisel Wright   Going Postal
Motivation
                                            ActiveMQ
                             Our Solution
                                            Net::Stomp
                                  Issues
                                            Net::ActiveMQ
                               Summary


Sending with Net::ActiveMQ
Why did you do that?




        sub message_spec
              Used by proof-of-concept
              Can catch your own mistakes
              No compelling reason to remove it
        Data::Rx
              Nicer error messages
              Slightly more agnostic




                            Chisel Wright   Going Postal
Motivation
                                            ActiveMQ
                             Our Solution
                                            Net::Stomp
                                  Issues
                                            Net::ActiveMQ
                               Summary


Sending with Net::ActiveMQ
Why did you do that?




        sub message_spec
              Used by proof-of-concept
              Can catch your own mistakes
              No compelling reason to remove it
        Data::Rx
              Nicer error messages
              Slightly more agnostic




                            Chisel Wright   Going Postal
Motivation
                                            ActiveMQ
                             Our Solution
                                            Net::Stomp
                                  Issues
                                            Net::ActiveMQ
                               Summary


Sending with Net::ActiveMQ
Why did you do that?




        sub message_spec
              Used by proof-of-concept
              Can catch your own mistakes
              No compelling reason to remove it
        Data::Rx
              Nicer error messages
              Slightly more agnostic




                            Chisel Wright   Going Postal
Motivation
                                            ActiveMQ
                             Our Solution
                                            Net::Stomp
                                  Issues
                                            Net::ActiveMQ
                               Summary


Sending with Net::ActiveMQ
Why did you do that?




        sub message_spec
              Used by proof-of-concept
              Can catch your own mistakes
              No compelling reason to remove it
        Data::Rx
              Nicer error messages
              Slightly more agnostic




                            Chisel Wright   Going Postal
Motivation
                                            ActiveMQ
                             Our Solution
                                            Net::Stomp
                                  Issues
                                            Net::ActiveMQ
                               Summary


Sending with Net::ActiveMQ
Why did you do that?




        sub message_spec
              Used by proof-of-concept
              Can catch your own mistakes
              No compelling reason to remove it
        Data::Rx
              Nicer error messages
              Slightly more agnostic




                            Chisel Wright   Going Postal
Motivation
                                           ActiveMQ
                           Our Solution
                                           Net::Stomp
                                Issues
                                           Net::ActiveMQ
                             Summary


Receiving with Net::ActiveMQ
Quick But Boring

   $ CATALYST_DEBUG=1 
   > net_activemq_consumer_server.pl


   [debug] Loaded engine "Catalyst::Engine::Stomp"
   ...
   [debug] Loaded components:
   .--------------------------------+----------.
   | Class                          | Type     |
   +--------------------------------+----------+
   | ...::Controller::Root          | instance |
   ’--------------------------------+----------’
   ...
   [info] Application powered by Catalyst 5.80016


        Not very useful in this state
        Fairly easy to add something useful
                           Chisel Wright   Going Postal
Motivation
                                           ActiveMQ
                           Our Solution
                                           Net::Stomp
                                Issues
                                           Net::ActiveMQ
                             Summary


Receiving with Net::ActiveMQ
Quick But Boring

   $ CATALYST_DEBUG=1 
   > net_activemq_consumer_server.pl


   [debug] Loaded engine "Catalyst::Engine::Stomp"
   ...
   [debug] Loaded components:
   .--------------------------------+----------.
   | Class                          | Type     |
   +--------------------------------+----------+
   | ...::Controller::Root          | instance |
   ’--------------------------------+----------’
   ...
   [info] Application powered by Catalyst 5.80016


        Not very useful in this state
        Fairly easy to add something useful
                           Chisel Wright   Going Postal
Motivation
                                          ActiveMQ
                          Our Solution
                                          Net::Stomp
                               Issues
                                          Net::ActiveMQ
                            Summary


Receiving with Net::ActiveMQ
Consuming Some::Message




   $ net_activemq_consumer_create.pl controller Some::Message
       ActiveMQ
   created "lib/Net/ActiveMQ/Consumer/Controller/Some"
   created "t"
   created "lib/Net/ActiveMQ/Consumer/Controller/Some/Message.pm"
   created "t/controller_Some-Message.t"


       Catalyst::Helper to do the hard work




                          Chisel Wright   Going Postal
Motivation
                                          ActiveMQ
                          Our Solution
                                          Net::Stomp
                               Issues
                                          Net::ActiveMQ
                            Summary


Receiving with Net::ActiveMQ
Consuming Some::Message


   $ CATALYST_DEBUG=1 
   > PERL5LIB=$PWD/lib 
   > net_activemq_consumer_server.pl


   [debug] Loaded engine "Catalyst::Engine::Stomp"
   ...
   [debug] Loaded components:
   .--------------------------------+----------.
   | Class                          | Type     |
   +--------------------------------+----------+
   | ...::Controller::Root          | instance |
   | ...::Controller::Some::Message | instance |
   ’--------------------------------+----------’
   ...
   [info] Application powered by Catalyst 5.80016



                          Chisel Wright   Going Postal
Motivation
                                           ActiveMQ
                           Our Solution
                                           Net::Stomp
                                Issues
                                           Net::ActiveMQ
                             Summary


Receiving with Net::ActiveMQ
Controller Actions


    package Net::ActiveMQ::Consumer::Controller::Some::Message;
    use Moose;
    BEGIN {
       extends
         ’Net::ActiveMQ::Consumer::ControllerBase::MessageDriven’
    }
    __PACKAGE__->config(
         action_namespace => ’some-message’
    );
    # this will handle ’@type’ of ’action_method’ in
    # the ’some-message’ queue
    sub action_method :Local {
       my ($self, $c, $message) = @_;
       $c->log->warn(’Some::Message / some-message / action_method’);
    }
    __PACKAGE__->meta->make_immutable;
    1;


                           Chisel Wright   Going Postal
Motivation
                                         ActiveMQ
                          Our Solution
                                         Net::Stomp
                               Issues
                                         Net::ActiveMQ
                            Summary


Receiving with Net::ActiveMQ
Queue::Spec




   package Net::ActiveMQ::Consumer::Queue::Spec::Some::Message;
   use Moose;

   sub action_method {
       return { type => ’//any’ };
   }

   1;




                         Chisel Wright   Going Postal
Motivation
Our Solution    Peer Review
     Issues     Implementation
  Summary




   Issues



Chisel Wright   Going Postal
Motivation
                         Our Solution   Peer Review
                              Issues    Implementation
                           Summary


Peer Review



     Only recently been used by the rest of the team
         Bugs
         Handling errors
     Lack of clear documentation
         POD
         How-To / “How do I. . . ?”




                        Chisel Wright   Going Postal
Motivation
                         Our Solution   Peer Review
                              Issues    Implementation
                           Summary


Peer Review



     Only recently been used by the rest of the team
         Bugs
         Handling errors
     Lack of clear documentation
         POD
         How-To / “How do I. . . ?”




                        Chisel Wright   Going Postal
Motivation
                         Our Solution   Peer Review
                              Issues    Implementation
                           Summary


Peer Review



     Only recently been used by the rest of the team
         Bugs
         Handling errors
     Lack of clear documentation
         POD
         How-To / “How do I. . . ?”




                        Chisel Wright   Going Postal
Motivation
                         Our Solution   Peer Review
                              Issues    Implementation
                           Summary


Peer Review



     Only recently been used by the rest of the team
         Bugs
         Handling errors
     Lack of clear documentation
         POD
         How-To / “How do I. . . ?”




                        Chisel Wright   Going Postal
Motivation
                         Our Solution   Peer Review
                              Issues    Implementation
                           Summary


Peer Review



     Only recently been used by the rest of the team
         Bugs
         Handling errors
     Lack of clear documentation
         POD
         How-To / “How do I. . . ?”




                        Chisel Wright   Going Postal
Motivation
                         Our Solution   Peer Review
                              Issues    Implementation
                           Summary


Peer Review



     Only recently been used by the rest of the team
         Bugs
         Handling errors
     Lack of clear documentation
         POD
         How-To / “How do I. . . ?”




                        Chisel Wright   Going Postal
Motivation
                            Our Solution   Peer Review
                                 Issues    Implementation
                              Summary


Implementation
General




          Some early features not fully phased out
              @type => ’...’
              JMSType




                           Chisel Wright   Going Postal
Motivation
                            Our Solution   Peer Review
                                 Issues    Implementation
                              Summary


Implementation
General




          Some early features not fully phased out
              @type => ’...’
              JMSType




                           Chisel Wright   Going Postal
Motivation
                            Our Solution   Peer Review
                                 Issues    Implementation
                              Summary


Implementation
General




          Some early features not fully phased out
              @type => ’...’
              JMSType




                           Chisel Wright   Going Postal
Motivation
                          Our Solution   Peer Review
                               Issues    Implementation
                            Summary


Implementation
Producers




        Shared spec files implementation not complete
            Still living in the ::Consumer:: namespace
            Not easily used by ::Producer:: classes
            message_spec vs build_message_spec




                         Chisel Wright   Going Postal
Motivation
                          Our Solution   Peer Review
                               Issues    Implementation
                            Summary


Implementation
Producers




        Shared spec files implementation not complete
            Still living in the ::Consumer:: namespace
            Not easily used by ::Producer:: classes
            message_spec vs build_message_spec




                         Chisel Wright   Going Postal
Motivation
                          Our Solution   Peer Review
                               Issues    Implementation
                            Summary


Implementation
Producers




        Shared spec files implementation not complete
            Still living in the ::Consumer:: namespace
            Not easily used by ::Producer:: classes
            message_spec vs build_message_spec




                         Chisel Wright   Going Postal
Motivation
                          Our Solution   Peer Review
                               Issues    Implementation
                            Summary


Implementation
Producers




        Shared spec files implementation not complete
            Still living in the ::Consumer:: namespace
            Not easily used by ::Producer:: classes
            message_spec vs build_message_spec




                         Chisel Wright   Going Postal
Motivation
                          Our Solution    Peer Review
                               Issues     Implementation
                            Summary


Implementation
Consumers




       Consumers limited to Net::ActiveMQ namespace
       Error-Handling still evolving




                          Chisel Wright   Going Postal
Motivation
                          Our Solution    Peer Review
                               Issues     Implementation
                            Summary


Implementation
Consumers




       Consumers limited to Net::ActiveMQ namespace
       Error-Handling still evolving




                          Chisel Wright   Going Postal
Motivation
                       Our Solution
                            Issues
                         Summary


Summary


    Avoid direct database interaction
    Use message queues
    DRY


    The Future
        Evolution - final stages
        We’re starting to use it in production
        We hope to release to the CPAN soon




                      Chisel Wright   Going Postal
Motivation
                       Our Solution
                            Issues
                         Summary


Summary


    Avoid direct database interaction
    Use message queues
    DRY


    The Future
        Evolution - final stages
        We’re starting to use it in production
        We hope to release to the CPAN soon




                      Chisel Wright   Going Postal
Motivation
                       Our Solution
                            Issues
                         Summary


Summary


    Avoid direct database interaction
    Use message queues
    DRY


    The Future
        Evolution - final stages
        We’re starting to use it in production
        We hope to release to the CPAN soon




                      Chisel Wright   Going Postal
Motivation
                       Our Solution
                            Issues
                         Summary


Summary


    Avoid direct database interaction
    Use message queues
    DRY


    The Future
        Evolution - final stages
        We’re starting to use it in production
        We hope to release to the CPAN soon




                      Chisel Wright   Going Postal
Motivation
                       Our Solution
                            Issues
                         Summary


Summary


    Avoid direct database interaction
    Use message queues
    DRY


    The Future
        Evolution - final stages
        We’re starting to use it in production
        We hope to release to the CPAN soon




                      Chisel Wright   Going Postal
Motivation
                       Our Solution
                            Issues
                         Summary


Summary


    Avoid direct database interaction
    Use message queues
    DRY


    The Future
        Evolution - final stages
        We’re starting to use it in production
        We hope to release to the CPAN soon




                      Chisel Wright   Going Postal
Motivation
                       Our Solution
                            Issues
                         Summary


Summary


    Avoid direct database interaction
    Use message queues
    DRY


    The Future
        Evolution - final stages
        We’re starting to use it in production
        We hope to release to the CPAN soon




                      Chisel Wright   Going Postal
Motivation
  Our Solution
       Issues
    Summary




QUESTIONS?



  Chisel Wright   Going Postal
Motivation
                    Our Solution
                         Issues
                      Summary


Obligatory LOLCAT
LOL-Rilla?




             chisel.wright@net-a-porter.com

                    Chisel Wright   Going Postal

More Related Content

Recently uploaded

Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxNeo4j
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxSatishbabu Gunukula
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechProduct School
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024Brian Pichman
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)IES VE
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationKnoldus Inc.
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdfThe Good Food Institute
 
The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)codyslingerland1
 
Introduction - IPLOOK NETWORKS CO., LTD.
Introduction - IPLOOK NETWORKS CO., LTD.Introduction - IPLOOK NETWORKS CO., LTD.
Introduction - IPLOOK NETWORKS CO., LTD.IPLOOK Networks
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and businessFrancesco Corti
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0DanBrown980551
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch TuesdayIvanti
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTopCSSGallery
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfInfopole1
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarThousandEyes
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxKaustubhBhavsar6
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTxtailishbaloch
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 

Recently uploaded (20)

Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptx
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its application
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf
 
The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)
 
Introduction - IPLOOK NETWORKS CO., LTD.
Introduction - IPLOOK NETWORKS CO., LTD.Introduction - IPLOOK NETWORKS CO., LTD.
Introduction - IPLOOK NETWORKS CO., LTD.
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and business
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch Tuesday
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptx
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

YAPC::EU 2010 - Going Postal

  • 1. Motivation Our Solution Issues Summary Going Postal Chisel Wright NET-A-PORTER YAPC::EU 2010 Chisel Wright Going Postal
  • 2. Motivation Our Solution Talking To Strangers Issues Summary Motivation Why Bother? Chisel Wright Going Postal
  • 3. Motivation Our Solution Talking To Strangers Issues Summary A Long Time Ago When There Weren’t Any Better Solutions Direct, far away database writes Need to know their dialect They can’t easily change their schema Tightly coupled Chisel Wright Going Postal
  • 4. Motivation Our Solution Talking To Strangers Issues Summary A Long Time Ago When There Weren’t Any Better Solutions Direct, far away database writes Need to know their dialect They can’t easily change their schema Tightly coupled Chisel Wright Going Postal
  • 5. Motivation Our Solution Talking To Strangers Issues Summary A Long Time Ago When There Weren’t Any Better Solutions Direct, far away database writes Need to know their dialect They can’t easily change their schema Tightly coupled Chisel Wright Going Postal
  • 6. Motivation Our Solution Talking To Strangers Issues Summary A Long Time Ago When There Weren’t Any Better Solutions Direct, far away database writes Need to know their dialect They can’t easily change their schema Tightly coupled Chisel Wright Going Postal
  • 7. Motivation Our Solution Talking To Strangers Issues Summary Not quite so long ago When There Were Options TheSchwartz resolved a slightly different issue first step in the right direction didn’t help with far away issue perl only Chisel Wright Going Postal
  • 8. Motivation Our Solution Talking To Strangers Issues Summary Not quite so long ago When There Were Options TheSchwartz resolved a slightly different issue first step in the right direction didn’t help with far away issue perl only Chisel Wright Going Postal
  • 9. Motivation Our Solution Talking To Strangers Issues Summary Not quite so long ago When There Were Options TheSchwartz resolved a slightly different issue first step in the right direction didn’t help with far away issue perl only Chisel Wright Going Postal
  • 10. Motivation Our Solution Talking To Strangers Issues Summary Not quite so long ago When There Were Options TheSchwartz resolved a slightly different issue first step in the right direction didn’t help with far away issue perl only Chisel Wright Going Postal
  • 11. Motivation Our Solution Talking To Strangers Issues Summary Not quite so long ago When There Were Options TheSchwartz resolved a slightly different issue first step in the right direction didn’t help with far away issue perl only Chisel Wright Going Postal
  • 12. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Our Solution Chisel Wright Going Postal
  • 13. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary ActiveMQ Chisel Wright Going Postal
  • 14. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary ActiveMQ Java guys like it Perl guys can interact with it Reliable, well-used solution Chisel Wright Going Postal
  • 15. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary ActiveMQ Java guys like it Perl guys can interact with it Reliable, well-used solution Chisel Wright Going Postal
  • 16. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary ActiveMQ Java guys like it Perl guys can interact with it Reliable, well-used solution Chisel Wright Going Postal
  • 17. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::Stomp STOMP is great for talking to ActiveMQ Net::Stomp excellent for quickly interacting with ActiveMQ Chisel Wright Going Postal
  • 18. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::Stomp STOMP is great for talking to ActiveMQ Net::Stomp excellent for quickly interacting with ActiveMQ Chisel Wright Going Postal
  • 19. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::Stomp Talking to a Queue # send a message to the queue ’foo’ use Net::Stomp; my $stomp = Net::Stomp->new({ hostname => ’localhost’, port => ’61613’, }); $stomp->connect({ login => ’hello’, passcode => ’there’, }); $stomp->send({ destination => ’/queue/foo’, body => ’test message’, }); $stomp->disconnect; Chisel Wright Going Postal
  • 20. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Receiving with Net::Stomp Subscribing to a Queue # subscribe to messages from the queue ’foo’ use Net::Stomp; my $stomp = Net::Stomp->new({ hostname => ’localhost’, port => ’61613’, }); $stomp->connect({ login => ’hello’, passcode => ’there’, }); $stomp->subscribe({ destination => ’/queue/foo’, ’ack’ => ’client’, ’activemq.prefetchSize’ => 1, }); Chisel Wright Going Postal
  • 21. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Receiving with Net::Stomp Plucking from the Queue while (1) { my $frame = $stomp->receive_frame; warn $frame->body; # do something here $stomp->ack( { frame => $frame } ); } $stomp->disconnect; Chisel Wright Going Postal
  • 22. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::Stomp Thoughts Quickly and easily talk to ActiveMQ Does what it promises Low-level Copy-and-paste coding Error-handling, . . . Chisel Wright Going Postal
  • 23. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::Stomp Thoughts Quickly and easily talk to ActiveMQ Does what it promises Low-level Copy-and-paste coding Error-handling, . . . Chisel Wright Going Postal
  • 24. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::Stomp Thoughts Quickly and easily talk to ActiveMQ Does what it promises Low-level Copy-and-paste coding Error-handling, . . . Chisel Wright Going Postal
  • 25. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::Stomp Thoughts Quickly and easily talk to ActiveMQ Does what it promises Low-level Copy-and-paste coding Error-handling, . . . Chisel Wright Going Postal
  • 26. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::Stomp Thoughts Quickly and easily talk to ActiveMQ Does what it promises Low-level Copy-and-paste coding Error-handling, . . . Chisel Wright Going Postal
  • 27. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::ActiveMQ Chisel Wright Going Postal
  • 28. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::ActiveMQ Standardise our AMQ solution across apps Lower barrier to entry Chisel Wright Going Postal
  • 29. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Net::ActiveMQ Standardise our AMQ solution across apps Lower barrier to entry Chisel Wright Going Postal
  • 30. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary What Is It? Essentially: Net::Stomp Catalyst::Engine::Stomp with a lovely ribbon and bow around it. Message producers Message consumers all in one place. Chisel Wright Going Postal
  • 31. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Talking to a Queue use Net::ActiveMQ::Producer; my $producer = Net::ActiveMQ::Producer->new({ hostname => ’localhost’, port => 61613 }); $producer->send( ’Some::Message’, { message => ’data’, goes => ’here’ } ); Net::ActiveMQ::Producer - message type does not exist - Some::Message at /path/to/.../Class/MOP/Method/Wrapped.pm line 159 Chisel Wright Going Postal
  • 32. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ A Producer package Net::ActiveMQ::Producer::Some::Message; use Moose; with ’Net::ActiveMQ::Role::Producer’; sub transform { my ($self, $header, $data) = @_; # make sure it goes somewhere $header->{destination} ||= ’/queue/some-message’; # the desired action from the consumer $data->{’@type’} ||= ’action_method’; # "transform" the data $data->{process_time} = scalar localtime; return ($header, $data); } 1; Chisel Wright Going Postal
  • 33. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Validate What You Send # This is completely optional! sub message_spec { # Data::Rx format return { type => ’//rec’, required => { message => ’//str’, }, optional => { ’@type’ => ’//str’, goes => ’//str’, process_time => ’//str’, }, }; } Chisel Wright Going Postal
  • 34. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Catalyst Model # create your model class ./script/myapp_create.pl model MyMQ Net::ActiveMQ localhost 61613 YES # in your controller $c->model(’MyMQ’)->send( ’Some::Message’, { message => { a => ’shiny’, hash => ’reference’ } } ); Chisel Wright Going Postal
  • 35. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Why did you do that? sub message_spec Used by proof-of-concept Can catch your own mistakes No compelling reason to remove it Data::Rx Nicer error messages Slightly more agnostic Chisel Wright Going Postal
  • 36. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Why did you do that? sub message_spec Used by proof-of-concept Can catch your own mistakes No compelling reason to remove it Data::Rx Nicer error messages Slightly more agnostic Chisel Wright Going Postal
  • 37. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Why did you do that? sub message_spec Used by proof-of-concept Can catch your own mistakes No compelling reason to remove it Data::Rx Nicer error messages Slightly more agnostic Chisel Wright Going Postal
  • 38. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Why did you do that? sub message_spec Used by proof-of-concept Can catch your own mistakes No compelling reason to remove it Data::Rx Nicer error messages Slightly more agnostic Chisel Wright Going Postal
  • 39. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Why did you do that? sub message_spec Used by proof-of-concept Can catch your own mistakes No compelling reason to remove it Data::Rx Nicer error messages Slightly more agnostic Chisel Wright Going Postal
  • 40. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Why did you do that? sub message_spec Used by proof-of-concept Can catch your own mistakes No compelling reason to remove it Data::Rx Nicer error messages Slightly more agnostic Chisel Wright Going Postal
  • 41. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Sending with Net::ActiveMQ Why did you do that? sub message_spec Used by proof-of-concept Can catch your own mistakes No compelling reason to remove it Data::Rx Nicer error messages Slightly more agnostic Chisel Wright Going Postal
  • 42. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Receiving with Net::ActiveMQ Quick But Boring $ CATALYST_DEBUG=1 > net_activemq_consumer_server.pl [debug] Loaded engine "Catalyst::Engine::Stomp" ... [debug] Loaded components: .--------------------------------+----------. | Class | Type | +--------------------------------+----------+ | ...::Controller::Root | instance | ’--------------------------------+----------’ ... [info] Application powered by Catalyst 5.80016 Not very useful in this state Fairly easy to add something useful Chisel Wright Going Postal
  • 43. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Receiving with Net::ActiveMQ Quick But Boring $ CATALYST_DEBUG=1 > net_activemq_consumer_server.pl [debug] Loaded engine "Catalyst::Engine::Stomp" ... [debug] Loaded components: .--------------------------------+----------. | Class | Type | +--------------------------------+----------+ | ...::Controller::Root | instance | ’--------------------------------+----------’ ... [info] Application powered by Catalyst 5.80016 Not very useful in this state Fairly easy to add something useful Chisel Wright Going Postal
  • 44. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Receiving with Net::ActiveMQ Consuming Some::Message $ net_activemq_consumer_create.pl controller Some::Message ActiveMQ created "lib/Net/ActiveMQ/Consumer/Controller/Some" created "t" created "lib/Net/ActiveMQ/Consumer/Controller/Some/Message.pm" created "t/controller_Some-Message.t" Catalyst::Helper to do the hard work Chisel Wright Going Postal
  • 45. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Receiving with Net::ActiveMQ Consuming Some::Message $ CATALYST_DEBUG=1 > PERL5LIB=$PWD/lib > net_activemq_consumer_server.pl [debug] Loaded engine "Catalyst::Engine::Stomp" ... [debug] Loaded components: .--------------------------------+----------. | Class | Type | +--------------------------------+----------+ | ...::Controller::Root | instance | | ...::Controller::Some::Message | instance | ’--------------------------------+----------’ ... [info] Application powered by Catalyst 5.80016 Chisel Wright Going Postal
  • 46. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Receiving with Net::ActiveMQ Controller Actions package Net::ActiveMQ::Consumer::Controller::Some::Message; use Moose; BEGIN { extends ’Net::ActiveMQ::Consumer::ControllerBase::MessageDriven’ } __PACKAGE__->config( action_namespace => ’some-message’ ); # this will handle ’@type’ of ’action_method’ in # the ’some-message’ queue sub action_method :Local { my ($self, $c, $message) = @_; $c->log->warn(’Some::Message / some-message / action_method’); } __PACKAGE__->meta->make_immutable; 1; Chisel Wright Going Postal
  • 47. Motivation ActiveMQ Our Solution Net::Stomp Issues Net::ActiveMQ Summary Receiving with Net::ActiveMQ Queue::Spec package Net::ActiveMQ::Consumer::Queue::Spec::Some::Message; use Moose; sub action_method { return { type => ’//any’ }; } 1; Chisel Wright Going Postal
  • 48. Motivation Our Solution Peer Review Issues Implementation Summary Issues Chisel Wright Going Postal
  • 49. Motivation Our Solution Peer Review Issues Implementation Summary Peer Review Only recently been used by the rest of the team Bugs Handling errors Lack of clear documentation POD How-To / “How do I. . . ?” Chisel Wright Going Postal
  • 50. Motivation Our Solution Peer Review Issues Implementation Summary Peer Review Only recently been used by the rest of the team Bugs Handling errors Lack of clear documentation POD How-To / “How do I. . . ?” Chisel Wright Going Postal
  • 51. Motivation Our Solution Peer Review Issues Implementation Summary Peer Review Only recently been used by the rest of the team Bugs Handling errors Lack of clear documentation POD How-To / “How do I. . . ?” Chisel Wright Going Postal
  • 52. Motivation Our Solution Peer Review Issues Implementation Summary Peer Review Only recently been used by the rest of the team Bugs Handling errors Lack of clear documentation POD How-To / “How do I. . . ?” Chisel Wright Going Postal
  • 53. Motivation Our Solution Peer Review Issues Implementation Summary Peer Review Only recently been used by the rest of the team Bugs Handling errors Lack of clear documentation POD How-To / “How do I. . . ?” Chisel Wright Going Postal
  • 54. Motivation Our Solution Peer Review Issues Implementation Summary Peer Review Only recently been used by the rest of the team Bugs Handling errors Lack of clear documentation POD How-To / “How do I. . . ?” Chisel Wright Going Postal
  • 55. Motivation Our Solution Peer Review Issues Implementation Summary Implementation General Some early features not fully phased out @type => ’...’ JMSType Chisel Wright Going Postal
  • 56. Motivation Our Solution Peer Review Issues Implementation Summary Implementation General Some early features not fully phased out @type => ’...’ JMSType Chisel Wright Going Postal
  • 57. Motivation Our Solution Peer Review Issues Implementation Summary Implementation General Some early features not fully phased out @type => ’...’ JMSType Chisel Wright Going Postal
  • 58. Motivation Our Solution Peer Review Issues Implementation Summary Implementation Producers Shared spec files implementation not complete Still living in the ::Consumer:: namespace Not easily used by ::Producer:: classes message_spec vs build_message_spec Chisel Wright Going Postal
  • 59. Motivation Our Solution Peer Review Issues Implementation Summary Implementation Producers Shared spec files implementation not complete Still living in the ::Consumer:: namespace Not easily used by ::Producer:: classes message_spec vs build_message_spec Chisel Wright Going Postal
  • 60. Motivation Our Solution Peer Review Issues Implementation Summary Implementation Producers Shared spec files implementation not complete Still living in the ::Consumer:: namespace Not easily used by ::Producer:: classes message_spec vs build_message_spec Chisel Wright Going Postal
  • 61. Motivation Our Solution Peer Review Issues Implementation Summary Implementation Producers Shared spec files implementation not complete Still living in the ::Consumer:: namespace Not easily used by ::Producer:: classes message_spec vs build_message_spec Chisel Wright Going Postal
  • 62. Motivation Our Solution Peer Review Issues Implementation Summary Implementation Consumers Consumers limited to Net::ActiveMQ namespace Error-Handling still evolving Chisel Wright Going Postal
  • 63. Motivation Our Solution Peer Review Issues Implementation Summary Implementation Consumers Consumers limited to Net::ActiveMQ namespace Error-Handling still evolving Chisel Wright Going Postal
  • 64. Motivation Our Solution Issues Summary Summary Avoid direct database interaction Use message queues DRY The Future Evolution - final stages We’re starting to use it in production We hope to release to the CPAN soon Chisel Wright Going Postal
  • 65. Motivation Our Solution Issues Summary Summary Avoid direct database interaction Use message queues DRY The Future Evolution - final stages We’re starting to use it in production We hope to release to the CPAN soon Chisel Wright Going Postal
  • 66. Motivation Our Solution Issues Summary Summary Avoid direct database interaction Use message queues DRY The Future Evolution - final stages We’re starting to use it in production We hope to release to the CPAN soon Chisel Wright Going Postal
  • 67. Motivation Our Solution Issues Summary Summary Avoid direct database interaction Use message queues DRY The Future Evolution - final stages We’re starting to use it in production We hope to release to the CPAN soon Chisel Wright Going Postal
  • 68. Motivation Our Solution Issues Summary Summary Avoid direct database interaction Use message queues DRY The Future Evolution - final stages We’re starting to use it in production We hope to release to the CPAN soon Chisel Wright Going Postal
  • 69. Motivation Our Solution Issues Summary Summary Avoid direct database interaction Use message queues DRY The Future Evolution - final stages We’re starting to use it in production We hope to release to the CPAN soon Chisel Wright Going Postal
  • 70. Motivation Our Solution Issues Summary Summary Avoid direct database interaction Use message queues DRY The Future Evolution - final stages We’re starting to use it in production We hope to release to the CPAN soon Chisel Wright Going Postal
  • 71. Motivation Our Solution Issues Summary QUESTIONS? Chisel Wright Going Postal
  • 72. Motivation Our Solution Issues Summary Obligatory LOLCAT LOL-Rilla? chisel.wright@net-a-porter.com Chisel Wright Going Postal