akbarali / nats-sender
Laravel Nats Sender
0.2.1
2024-12-19 12:38 UTC
Requires
- php: >=8.0
- ext-json: *
- ext-pcntl: *
- ext-posix: *
- akbarali/data-object: ^2.8.0
- basis-company/nats: ^0.26.2
Requires (Dev)
- laravel/framework: ^9.0|^10.0|^11.0
- predis/predis: ^2.0.2
- roave/security-advisories: dev-latest
README
TODO
Install
composer require akbarali/nats-sender
Supervisor add Artisan command:
php artisan nats:redis:sender
Supervisor Configuration
Supervisor configuration files are typically stored within your server's /etc/supervisor/conf.d
directory.
Within this directory, you may create any number of configuration files that instruct supervisor how your processes should be monitored.
For example, let's create a nats_sender.conf
file that starts and monitors a nats listener process:
[program:nats_sender]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan nats:redis:sender
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
numprocs=1
user=forge
redirect_stderr=true
stdout_logfile=/var/www/supervisor/nats_sender_queue.log
Emotional Damage
I originally wrote this package because RabbitMQ was slow and had a lot of issues with our entire project. I thought NATS would be faster and more reliable. But in the end, it turned out that RabbitMQ is 25% faster.