Amazon-SQS-Client

 view release on metacpan or  search on metacpan

bin/QueueDaemon.pl  view on Meta::CPAN


=over 5

=item * easy configuration using the command line options or a configuration file

=item * automatically create a queue if it doesn't exist

=item * long or short polling. Set --wait-time for long polling, --queue-interval for short polling

=item * configurable message disposition options for successful handling of messages and exceptions

=item * can be run as a daemon or in a terminal

=back

=head1 HINTS & TIPS

=head2 Quick Start

 QueueDaemon.pl --create-queue -q fooManQueue

=over 5 

=item 1. If the queue does not exist it will be created if you use the --create-queue option.

=item 2. If no logfile is given, log output will be sent to STDERR

=item 3. See L<Amazon::SQS::Config> regarding the available options in a config file.

=item 4. The default is to daemonize the script. Use --no-daemonize to run in a terminal.

=item 5. If you do not provide a handler on the command line or in
your .ini file the default handler will be used. The default hanlder will dump the
message to the log and delete the message.

=item 6. By default messages will only be deleted from the queue if your
handler returns a true value. If you want to delete messages which cannot be
decoded or when you handler returns a non-true value, set the
--delete-when or set 'delete' option in the [error] section of your .ini file.

=item 7. To exit the daemon when your handler returns a non-true value
set the --exit-when option to 'false' or in the [error] section of your .ini
file, set 'exit = false'.

=item 8. To exit the daemon if your handler throws an exception, 
set the --exit-when option to 'error' or in the [error] section of your .ini
file, set 'exit = error'.

=back

The daemon can be started using the helper script C<aws-sqsd>.

=over 5

=item Starting

By default the startup script will look for the script
(C<QueueDaemon.pl>) and the configuration file (C<aws-sqs.ini>) in all
of the places where they should have been installed regardless of
whether you installed the program as a CPAN distribution or manually
(C<./configure && make && make install>).  If you've relocated the
program or the configuration file you use environment variables to
tell the startup script where to look for these artifacts.

=over 10

=item CONFIG - fully qualified path the configuration file

=item DAEMON - fully qualified path to the C<QueueDaemon.pl> script.

=back

 sudo CONFIG=/etc/myapp/aws-sqs.ini aws-sqsd start

=item Stopping

 sudo /sbin/service aws-sqsd stop

=item Restarting

 $ sudo /sbin/service aws-sqsd restart

=item Rereading Config file after changes

 $ sudo /sbin/service aws-sqsd graceful

=back

=head1 CONFIGURATION

See L</Amazon::SQS::Config>

=cut

=head1 AUTHOR

Rob Lauer - <bigfoot@cpan.org>

=head1 SEE ALSO

L<Proc::Daemon>, L<Amazon::SQS::Config>, L<Amazon::SQS::Client>

=cut



( run in 0.510 second using v1.01-cache-2.11-cpan-71847e10f99 )