Skip to content

feat: implement annotation-driven event observer framework#82

Open
Twiineenock wants to merge 4 commits intohiero-ledger:mainfrom
Twiineenock:feat/event-observer
Open

feat: implement annotation-driven event observer framework#82
Twiineenock wants to merge 4 commits intohiero-ledger:mainfrom
Twiineenock:feat/event-observer

Conversation

@Twiineenock
Copy link
Copy Markdown

Description:
This PR implements a declarative, annotation-driven Event Observer Framework to enable reactive monitoring of Hiero network transactions and HCS topic messages.

  • Implement AbstractPollingObserver core engine for stable, background network monitoring.
  • Add @HieroTransactionListener and @HieroTopicListener annotations for high-level event subscription.
  • Introduce HieroListenerProcessor for automatic bean discovery and lifecycle management in Spring Boot.
  • Extend MirrorNodeClient and Repository layers with timestamp-based filtering support.
  • Add deduplication logic to ensure exact-once delivery of network events.
  • Provide a working demonstration in the hiero-enterprise-spring-sample module.

Related issue(s):

Fixes #81

Notes for reviewer:
The framework uses a polling-based approach against the Mirror Node REST API, which provides better stability for long-running observers in enterprise environments compared to raw gRPC streams.

I've verified the implementation by adding a sample listener in the spring-sample app (see HieroEventListener.java). Below is a snippet of how a developer would use this new functionality:

@HieroTopicListener(topicId = "0.0.5678", interval = 5000)
public void handleMessages(TopicMessage msg) {
    log.info("New message received: {}", msg.message());
}
\```

**Checklist**

- [x] Documented (Code comments, README, etc.)
- [x] Tested (unit, integration, etc.)

@Twiineenock Twiineenock marked this pull request as draft April 24, 2026 15:02
@Twiineenock
Copy link
Copy Markdown
Author

Signed-off-by: Twiineenock <Twiineenock@users.noreply.github.com>
…k stability

Signed-off-by: Twiineenock <Twiineenock@users.noreply.github.com>
@Twiineenock Twiineenock force-pushed the feat/event-observer branch from ba090c7 to 1863733 Compare April 26, 2026 05:47
Signed-off-by: Twiineenock <Twiineenock@users.noreply.github.com>
@Twiineenock Twiineenock marked this pull request as ready for review April 26, 2026 10:35
@Twiineenock Twiineenock force-pushed the feat/event-observer branch from 72c6574 to c7e35a5 Compare April 27, 2026 20:47
Signed-off-by: Twiineenock <Twiineenock@users.noreply.github.com>
@Twiineenock Twiineenock force-pushed the feat/event-observer branch from c7e35a5 to 4316e6d Compare April 27, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Annotation-driven Event Observer Framework for Reactive Network Monitoring

1 participant