POE::Component::Client::Stomp

A Perl extension for the POE Environment
Download

POE::Component::Client::Stomp Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Kevin L. Esteb
  • Publisher web site:
  • http://search.cpan.org/~kesteb/

POE::Component::Client::Stomp Tags


POE::Component::Client::Stomp Description

POE::Component::Client::Stomp is a Perl module that handles the nitty-gritty details of setting up the communications channel to a message queue server. You will need to sub-class this module with your own for it to be usefull.An attempt to maintain that channel will be made when/if that server should happen to disappear off the network. There is nothing more unpleasent then having to go around to dozens of servers and restarting processes.When messages are received, specific events are generated. Those events are based on the message type. If you are interested in those events you should override the default behaviour for those events. The default behaviour is to do nothing.SYNOPSISThis module is a class used to create clients that need to access a message server that communicates with the STOMP protocol. Your program could look as follows: package Client; use POE; use base qw(POE::Component::Client::Stomp); use strict; use warnings; sub handle_connection { my ($kernel, $self) = @_; my $nframe = $self->stomp->connect({login => 'testing', passcode => 'testing'}); $kernel->yield('send_data' => $nframe); } sub handle_connected { my ($kernel, $self, $frame) = @_; my $nframe = $self->stomp->subscribe({destination => $self->config('Queue'), ack => 'client'}); $kernel->yield('send_data' => $nframe); } sub handle_message { my ($kernel, $self, $frame) = @_; my $message_id = $frame->headers->{'message-id'}; my $nframe = $self->stomp->ack({'message-id' => $message_id}); $kernel->yield('send_data' => $nframe); } package main; use POE; use strict; Client->spawn( Alias => 'testing', Queue => '/queue/testing', ); $poe_kernel->run(); exit 0;Product's homepage


POE::Component::Client::Stomp Related Software