1
- # Polling Publisher-Subscriber System
1
+ # Polling Publisher-Subscriber Microservice Pattern
2
2
3
3
This project implements a ** Polling Publisher-Subscriber** system using ** Spring Boot** and ** Apache Kafka** . It consists of two microservices:
4
4
5
- 1 . ** Publisher Module ** → Periodically polls a data source and publishes updates via Kafka.
6
- 2 . ** Subscriber Module ** → Listens to Kafka for updates and processes them.
5
+ 1 . ** Publisher Service ** → Periodically polls a data source and publishes updates via Kafka.
6
+ 2 . ** Subscriber Service ** → Listens to Kafka for updates and processes them.
7
7
8
8
## 📌 ** Project Structure**
9
9
```
10
10
polling-publisher-subscriber/
11
11
│️— pom.xml (Parent POM)
12
12
│️— README.md (This file)
13
13
│
14
- ├── publisher-module /
15
- │ ├── src/main/java/com/iluwatar/polling-service /
14
+ ├── polling-service /
15
+ │ ├── src/main/java/com/iluwatar/polling/
16
16
│ ├── src/main/resources/application.yml
17
17
│ ├── pom.xml
18
18
│ └── README.md (Polling-specific documentation)
19
19
│
20
- ├── subscriber-module /
21
- │ ├── src/main/java/com/iluwatar/subscriber-service /
20
+ ├── subscriber-service /
21
+ │ ├── src/main/java/com/iluwatar/subscriber/
22
22
│ ├── src/main/resources/application.yml
23
23
│ ├── pom.xml
24
24
│ └── README.md (Subscriber-specific documentation)
@@ -41,21 +41,7 @@ docker-compose up -d
41
41
mvn clean install
42
42
```
43
43
44
- ### 3️⃣ ** Run the Publisher Module **
44
+ ### 3️⃣ ** Run Service **
45
45
``` sh
46
- mvn spring-boot:run -pl publisher-module
46
+ mvn spring-boot:run
47
47
```
48
-
49
- ### 4️⃣ ** Run the Subscriber Module**
50
- ``` sh
51
- mvn spring-boot:run -pl subscriber-module
52
- ```
53
-
54
- ## 📝 ** Endpoints**
55
- | Service | Endpoint | Description |
56
- | ---------| ----------| -------------|
57
- | Publisher | ` GET /publish ` | Manually trigger data publishing |
58
- | Subscriber | (Kafka Consumer) | Listens for updates |
59
-
60
- ## 🛠 ** Testing**
61
- You can test Kafka messages using:
0 commit comments