Amazon-SQS-Client

 view release on metacpan or  search on metacpan

bin/QueueDaemon.pl  view on Meta::CPAN

 -D, --delete-when        never, always, error
 -E, --exit-when          never, always, error, false
 -e, --endpoint-url       default: https://sqs.amazonaws.com
 -L, --logfile            name of logfile
 -l, --loglevel           log level (trace, debug, info, warn, error)
 -H, --handler            name of the handler class, default: Amazon::SQS::QueueHandler
 -m, --max-children       not implemented (default: 1)
 -s, --max-sleep-time     default: 5 seconds
     --max-messages       fixed at 1 currently
 -M, --message-type       mime type of messages (text/plain, application/json, 
                          application/x-www-form-encoded), default: text/plain
 -q, --queue              queue name (not url)
     --queue-interval     amount of time to sleep
 -p, --pidfile            fully qualified path of pid file, default: /var/run/QueueDaemon.pl.in
 -v, --visibility-timeout visibility timeout in seconds, default: 30
 -w, --wait-time          long polling wait time in seconds, default: 0

=head2 LICENSE

(c) Copyright 2024 TBC Development Group, LLC. All rights reserved.
This is free software and may be used or distributed under the same terms as Perl itself.

=head1 FEATURES

=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>



( run in 0.757 second using v1.01-cache-2.11-cpan-c966e8aa7e8 )