-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Added subscribeTopic method to TopicClient #194
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Manish Dait <[email protected]>
Signed-off-by: Manish Dait <[email protected]>
Signed-off-by: Manish Dait <[email protected]>
Signed-off-by: Manish Dait <[email protected]>
Signed-off-by: Manish Dait <[email protected]>
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.
Pull Request Overview
This PR adds subscription functionality to the TopicClient interface, allowing users to subscribe to Hedera topics and listen for incoming messages. The implementation supports various subscription patterns including unlimited subscriptions, limited message counts, and time-bounded subscriptions.
- Introduces
subscribeTopic()method with four overloaded variants for different subscription scenarios - Adds
getConsensusServiceAddress()to NetworkSettings to provide gRPC endpoints for mirror node connectivity - Updates configuration classes to support the new consensus service address field
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| TopicClient.java | Added four overloaded subscribeTopic methods to the interface |
| TopicClientImpl.java | Implemented subscription methods with parameter validation |
| NetworkSettings.java | Added getConsensusServiceAddress method to interface |
| HieroConfig.java | Added consensus service address support and updated client creation |
| HieroContext.java | Added getMirrorNodeEndPoint method |
| TopicMessageRequest.java | Added factory methods for different subscription parameter combinations |
| TopicMessageResult.java | Updated to include SubscriptionHandle |
| ProtocolLayerClientImpl.java | Updated to return subscription handle from query execution |
hiero-enterprise-test/src/main/java/com/openelements/hiero/test/SoloActionNetworkSettings.java
Outdated
Show resolved
Hide resolved
...-enterprise-base/src/test/java/com/openelements/hiero/base/test/config/HieroTestContext.java
Outdated
Show resolved
Hide resolved
...-enterprise-base/src/test/java/com/openelements/hiero/base/test/config/HieroTestContext.java
Outdated
Show resolved
Hide resolved
...-enterprise-base/src/test/java/com/openelements/hiero/base/test/config/HieroTestContext.java
Outdated
Show resolved
Hide resolved
hiero-enterprise-spring/src/test/java/com/openelements/hiero/spring/test/TopicClientTest.java
Outdated
Show resolved
Hide resolved
hiero-enterprise-base/src/test/java/com/openelements/hiero/base/test/TopicClientImplTest.java
Outdated
Show resolved
Hide resolved
hiero-enterprise-base/src/test/java/com/openelements/hiero/base/test/TopicClientImplTest.java
Outdated
Show resolved
Hide resolved
...nterprise-base/src/main/java/com/openelements/hiero/base/implementation/TopicClientImpl.java
Outdated
Show resolved
Hide resolved
...nterprise-base/src/main/java/com/openelements/hiero/base/implementation/TopicClientImpl.java
Outdated
Show resolved
Hide resolved
...rprise-base/src/main/java/com/openelements/hiero/base/protocol/data/TopicMessageRequest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Manish Dait <[email protected]>
|
@manishdait Could you investigate the cause of the build failure? It doesn't appear to be test-related. And tests were fixed so they should pass |
Signed-off-by: Manish Dait <[email protected]>
Signed-off-by: Manish Dait <[email protected]>
I have added the missing methodS to |
This PR introduces
subscribeTopic()method to theTopicClientinterface, which help to subscribe and listen to the messages received by the specific Hedera Topic.Key Changes:
getConsensusServiceAddresstoNetworkSettingsto store the HCS gRPC API inorder to set themirrorNodeAddressinClientbecause is becauseTopicMessageQueryuses the gRPC protocol.Method Added:
Closes: #193