Skip to content

PravinShahi0007/pubsub-redis-laravel

 
 

Repository files navigation

About

A simple Pub/Sub example written in Lumen Framework and using Redis.

It consist of three parts:

  • Tracking system
  • Pub/sub service
  • CLI app

Tracking system

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>

Pub/Sub

It's using a built-in lumen Redis commands to interact with the Redis

Cli App

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=

Requirements

  • Docker
  • Docker-compose

Install

  1. Clone repository
  2. Run make install

This will build the docker containers and seed the database.

Tests

Run make test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 91.8%
  • Dockerfile 3.7%
  • Makefile 2.9%
  • Shell 1.6%