A simple Pub/Sub example written in Lumen Framework and using Redis.
It consist of three parts:
- Tracking system
- Pub/sub service
- CLI app
And endpoint is located at `BASE_URL/accountId?data=โ` that accepts an account ID. If the account exists it will check if it is active and then publish Account ID, Account Name and name query parameter to Redis channel
To start publishing to a channel, use API endpoint (POST).
BASE_URL/accountId?data=โ<data>
It's using a built-in lumen Redis commands to interact with the Redis
It's a Lumen artisan command, than accepts an optional account_id parameter. The parameter will filter messages so it's only displaying it for the required account id.
The command will connect to Redis and listen to messages on a predefined channel
To start listening, use
make track
You can filter by account id, by using command:
make track ACCOUNT_ID=
- Docker
- Docker-compose
- Clone repository
- Run
make install
This will build the docker containers and seed the database.
Run make test