- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add publisher-subscriber design pattern (#2898) #3223
Conversation
PR SummaryThis PR implements the Publisher-Subscriber design pattern. It introduces a Publisher that manages topics and Subscribers that listen to specific topics. The implementation includes classes for Message, Topic, Publisher, and various Subscribers (WeatherSubscriber, DelayedWeatherSubscriber, CustomerSupportSubscriber). Unit tests are also included. Changes
autogenerated by presubmit.ai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- c535bb7: feat: add publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (19)
- pom.xml (1 hunk)
- publish-subscribe/README.md (1 hunk)
- publish-subscribe/pom.xml (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/CustomerSupportContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Message.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Topic.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/TopicName.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/WeatherContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/Publisher.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/PublisherImpl.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/CustomerSupportSubscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/Subscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/WeatherSubscriber.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/LoggerExtension.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/model/MessageTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/model/TopicTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/publisher/PublisherTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/subscriber/SubscriberTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- 8fcbb85: fix: check styles on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (11)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/CustomerSupportContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Message.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Topic.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/TopicName.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/WeatherContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/Publisher.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/PublisherImpl.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/CustomerSupportSubscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/Subscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/WeatherSubscriber.java (1 hunk)
Actionable Comments (0)
Skipped Comments (0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- d00524e: fix: check styles on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (9)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/CustomerSupportContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Message.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Topic.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/TopicName.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/WeatherContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/Publisher.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/PublisherImpl.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/Subscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/WeatherSubscriber.java (1 hunk)
Actionable Comments (0)
Skipped Comments (0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- 208ca21: fix: check styles on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (1)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/CustomerSupportSubscriber.java (1 hunk)
Actionable Comments (0)
Skipped Comments (1)
-
publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/CustomerSupportSubscriber.java [5-16]
redundancy: "Redundant logger initialization."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- d5ac9d4: fix: improve coverage on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (1)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/AppTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (1)
-
publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/AppTest.java [9-12]
enhancement: "Add more comprehensive tests to verify core functionality."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- 7fdc594: Merge branch 'master' into master
Files Processed (0)
Actionable Comments (0)
Skipped Comments (0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- 92bc114: fix: fix dependancy on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (1)
- publish-subscribe/pom.xml (1 hunk)
Actionable Comments (0)
Skipped Comments (0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- bb5f9a6: fix: fix documentation on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (12)
- publish-subscribe/README.md (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/CustomerSupportContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Message.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Topic.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/TopicName.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/WeatherContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/Publisher.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/PublisherImpl.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/CustomerSupportSubscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/Subscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/WeatherSubscriber.java (1 hunk)
Actionable Comments (0)
Skipped Comments (0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- fd0d33b: fix: apply spotless on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (11)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/CustomerSupportContent.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Message.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/Publisher.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/CustomerSupportSubscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/WeatherSubscriber.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/AppTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/LoggerExtension.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/model/MessageTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/publisher/PublisherTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/subscriber/SubscriberTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (0)
publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java
Outdated
Show resolved
Hide resolved
publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Topic.java
Outdated
Show resolved
Hide resolved
publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/TopicName.java
Outdated
Show resolved
Hide resolved
publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/model/MessageTest.java
Show resolved
Hide resolved
publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/WeatherContent.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- 24ca271: fix: changes after review on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (12)
- publish-subscribe/README.md (1 hunk)
- publish-subscribe/etc/pub-sub.png (0 hunks)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/model/Topic.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/publisher/PublisherImpl.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/CustomerSupportSubscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/DelayedWeatherSubscriber.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/WeatherSubscriber.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/model/MessageTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/model/TopicTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/publisher/PublisherTest.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/subscriber/SubscriberTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- 1813b99: fix: changes after review on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (4)
- publish-subscribe/README.md (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java (1 hunk)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/DelayedWeatherSubscriber.java (1 hunk)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/subscriber/SubscriberTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- 0f6b3b4: fix: fix sonar on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (1)
- publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/subscriber/SubscriberTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (1)
-
publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/subscriber/SubscriberTest.java [175-181]
enhancement: "Improve waiting mechanism in tests."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ LGTM!
Review Summary
Commits Considered (1)
- f68c624: fix: fix sonar on publisher-subscriber design pattern (Publish/Subscribe pattern #2898)
Files Processed (1)
- publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/DelayedWeatherSubscriber.java (1 hunk)
Actionable Comments (0)
Skipped Comments (1)
-
publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/subscriber/DelayedWeatherSubscriber.java [28-36]
performance: "Performance impact of artificial delay."
|
Looks good! Thank you for the contribution 🎉 @all-contributors please add @sanurah for code |
I've put up a pull request to add @sanurah! 🎉 |
This PR is adding the publisher subscriber design pattern for feature #2898