Skip to content

Microservice pattern: Polling publisher #2673

Open
@iluwatar

Description

@iluwatar
Owner

Description:
The Polling Publisher design pattern is used within microservices architecture to allow services to periodically check for updates or changes and then publish the results to subscribers. This pattern is particularly useful for ensuring that microservices are loosely coupled and can independently manage their data refresh cycles without requiring direct communication or immediate event-based updates.

Main Elements of the Pattern:

  1. Polling Service: A microservice that periodically checks for updates or changes in a specific data source.
  2. Publisher: The component within the polling service that publishes the updated data to interested subscribers.
  3. Subscriber: Services or components that subscribe to the updates published by the polling service.
  4. Scheduler: A mechanism to trigger the polling service at regular intervals.
  5. Data Source: The source from which the polling service fetches updates.
  6. Communication Protocol: Defines how the polling service communicates with subscribers, typically using RESTful APIs, message brokers, or other asynchronous messaging systems.

References:

Acceptance Criteria:

  1. Implement a basic polling service that checks for updates in a predefined data source at regular intervals.
  2. Ensure the polling service can publish updates to subscribers using a RESTful API or message broker.
  3. Provide a sample subscriber that demonstrates how to consume updates from the polling service.

Activity

converted this from a draft issue on Oct 15, 2023
YashKesh

YashKesh commented on Oct 16, 2023

@YashKesh

@iluwatar what feature you wanted to add i can do

CoderSleek

CoderSleek commented on Oct 2, 2024

@CoderSleek

Hey @iluwatar, I can pick this task up.

moved this from Todo to In Progress in Java Design Patterns projecton Oct 13, 2024
stale

stale commented on Dec 13, 2024

@stale

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

added
status: staleissues and pull requests that have not had recent interaction
on Dec 13, 2024
CoderSleek

CoderSleek commented on Dec 13, 2024

@CoderSleek

still working on it, albeit a bit slow :)
The stale label can be removed

removed
status: staleissues and pull requests that have not had recent interaction
on Dec 13, 2024
github-actions

github-actions commented on Feb 12, 2025

@github-actions

This issue is stale because it has been open 60 days with no activity.

8 remaining items

moved this from Todo to In Progress in Java Design Patterns projecton Feb 22, 2025
quantdevv

quantdevv commented on Feb 24, 2025

@quantdevv

Thanks @iluwatar @CoderSleek , i'll have a look on this.

quantdevv

quantdevv commented on Mar 1, 2025

@quantdevv

Hey @iluwatar , i want to discuss something on this... is there any dedicated server to discuss any kind issue..?

iluwatar

iluwatar commented on Mar 2, 2025

@iluwatar
OwnerAuthor

Hey @iluwatar , i want to discuss something on this... is there any dedicated server to discuss any kind issue..?

Try Gitter channel here: https://app.gitter.im/#/room/#iluwatar_java-design-patterns:gitter.im

quantdevv

quantdevv commented on Mar 4, 2025

@quantdevv

Hi @iluwatar , here i'm planning to implement this micro-service pattern in below architecture .. would you like to review it once..?

Here will create two services polling-service & subscriber-service. as i made two to keep it true microservice architecture.

  1. polling-service -> which will handles the periodically check for update or change in datasource & schedule , polling controller alongwith rest-controller so can be tested manually... or can be used either way.

  2. subscriber service -> this contains the kafka MQ , which consume the published message by polling controller & schedular ...

the dummy structure will be like this..

Data-source ------> polling service (polling schedular, controller (publish)) ----> MQ (Kafka) -----> notification

Image

let me know if you have any suggestion on this.. or else i'll proceed with it.

iluwatar

iluwatar commented on Mar 5, 2025

@iluwatar
OwnerAuthor

Yes, sounds good @quantdevv 👍

github-actions

github-actions commented on May 5, 2025

@github-actions

This issue is stale because it has been open 60 days with no activity.

moved this from In Progress to Todo in Java Design Patterns projecton May 29, 2025
quantdevv

quantdevv commented on Jun 5, 2025

@quantdevv

Hi @iluwatar , please have a look to PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @iluwatar@quantdevv@CoderSleek@YashKesh

      Issue actions

        Microservice pattern: Polling publisher · Issue #2673 · iluwatar/java-design-patterns