A simple service that keeps track of different topics and allows clients subscribe to these topics, receiving notification messages based on the topics they subscribe to.
This is built using
- PHP 7.4+
- MySQL 5.7+
- Composer
Clone the repository by running
git clone https://github.com/kennedy-osaze/http-notification-system.git
Install Dependencies
composer install
Run service
php -S localhost:8000 -t public
POST /subscribe/{topic}
{
"url": "http://localhost:9000"
}
Payload | Type | Description |
---|---|---|
url |
string |
Required. The url to recieve notifications to |
POST /publish/{topic}
{
"data": {
"message": "Hello World!"
}
}
Payload | Type | Description |
---|---|---|
data |
json |
Required. Must be a key-value paired |
To enable workers to send notifications, run
php artisan queue:work
To run tests, run the following command
./vendor/bin/phpunit