-
some key method code bellows:
test code:
the subject 'bus.bus' has been publish message before . then while program run, the message handler always trigger and output '"receive message : xxx' looks the stream replay . what is the mechanism? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Where is the code for Please have a look at the top of the readme https://github.com/nats-io/nats.java?tab=readme-ov-file#examples-and-other-documentation there are links to many examples. |
Beta Was this translation helpful? Give feedback.
-
most PUB/SUB framework is quit simple, subscribe meaning listen now and future, maybe replay stream is great idea, but it obviously not common use case. default do not load history message is more easy to use |
Beta Was this translation helpful? Give feedback.
Where is the code for
getStream(subject)
As far as I know this returns a JetStreamContext. When you subscribe this way you are making a brand new consumer to the stream. As you've configured the subscription, your consumer starts at the first message of the stream.Please have a look at the top of the readme https://github.com/nats-io/nats.java?tab=readme-ov-file#examples-and-other-documentation there are links to many examples.