https://github.com/devrezaur/redis-publisher-subscriber
Publisher Subscriber Pattern Demonstration Using Redis & Spring Boot
https://github.com/devrezaur/redis-publisher-subscriber
Last synced: 6 months ago
JSON representation
Publisher Subscriber Pattern Demonstration Using Redis & Spring Boot
- Host: GitHub
- URL: https://github.com/devrezaur/redis-publisher-subscriber
- Owner: DevRezaur
- Created: 2023-10-06T15:01:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-10T05:59:38.000Z (over 2 years ago)
- Last Synced: 2025-03-12T03:46:41.334Z (over 1 year ago)
- Language: Java
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Publisher Subscriber Pattern Demonstration Using Redis
---
## Instructions To Run The Project
### Step 01:
From the parent directory `redis-publisher-subscriber` type the below commands to navigate to the `docker-compose`
directory and start the redis server.
```bash
cd ./docker-compose
docker compose up
```
### Step 02:
Start the `publisher-service` and `subscriber-service` application.
### Step 03:
Now execute the below CURL to publish an event.
```bash
curl --location --request POST 'localhost:8080/publish' \
--header 'Content-Type: application/json' \
--data-raw '{
"orderId": "oder-1",
"userId": "12345",
"productName": "Some product",
"price": 200,
"quantity": 1
}'
```
Once an event is published, `subscriber-service` will listen to that. And consume the event. You can check the log of
`subscriber-service` for that.