Get topic messages
Last updated
Was this helpful?
Last updated
Was this helpful?
Subscribe to a topic ID's messages from a mirror node. You will receive all messages for the specified topic or within the defined start and end time.
Query Fees
Please see the transaction and query table for base transaction fee
Please use the to estimate your query fee cost
new MirrorConsensusTopicQuery()
Initializes the MirrorConsensusTopicQuery object
setTopicId(<topicId>)
TopicId
The topic ID to subscribe to
Required
setStartTime(<startTime>)
Instant
The time to start subscribing to a topic's messages
Optional
setEndTime(<endTime>)
Instant
The time to stop subscribing to a topic's messages
Optional
setLimit(<limit>)
long
The number of messages to return
Optional
subscribe(<mirrorClient, onNext onError)
MirrorClient, Consumer <MirrorConsensusTopicResponse>, Consumer<Throwable>
Subscribe and get the messages for a topic
Required