Base project for command line workers using Laravel
- PHP 8.1+
- Composer
- Git
- Docker Engine 17.09.0+
- docker-composer 1.26+
composer create-project arquivei/laravel-skeleton-worker my-worker
or
docker run -it --rm -v $PWD:/app composer create-project arquivei/laravel-skeleton-worker my-worker
Edit .env
- APP_IDENTIFIER=
- COMPOSER_AUTH=
make setup
sudo chmod -R 777 storage/
php artisan start:worker
- Variables taken from .env file or class initialization options
- Will post in the topic:
- KAFKA_PREFIX + EVENTS_STREAM
- com.arquivei.stonks-events
- Variables taken from .env file or class initialization options
- Will consume from the queue:
- KAFKA_PREFIX + EVENTS_STREAM + 'topic'
- com.arquivei.stonks-events.example-app_example-event
- Edit .env with kafka information
- With artisan run the command example:consumer then example:producer
- Start docker compose with zookeeper, kafka and kafdrop:
docker-compose up
- Run tests: ProducerCommandtTest.php and ExampleConsumerTest.php
- Go to http://localhost:9090 to see topics created in local kafka