SlideShare uma empresa Scribd logo
1 de 72
Baixar para ler 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

Mais conteúdo relacionado

Último

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Último (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
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
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
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...
 

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