-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add the documentation for ReliableMessageListener [API-2182] #941
Conversation
…rfaces and capabilities.
✅ Deploy Preview for hardcore-allen-f5257d ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
I feel like we should somehow give a link to the source code after all this nitty gritty details. (due to references of methods) You can even copy the interface and paste it in the documentation
Co-authored-by: Serkan Özel <[email protected]>
Co-authored-by: Serkan Özel <[email protected]>
Co-authored-by: Serkan Özel <[email protected]>
…nto relaibleListenerDoc
Added link at commit 0efad8f |
@ihsandemir , two things I'd like to get your opinion:
|
@Serdaro Yes, definitely we can move the content to that section. Naturally, I was thinking that it needs to be under associated data structure but you probably made a choice to put them separately for some reason. Just for consistency, I can move it to that section. The new callback |
…nto the object-events.adoc and added a sample code.
Changed as requested. Can you review again @Serdaro ? |
|
||
link:https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/topic/ReliableMessageListener.java[ReliableMessageListener] is a link:https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/topic/MessageListener.java[MessageListener] to better integrate with the reliable topic. | ||
|
||
If a regular MessageListener is registered on a reliable topic, the message listener works fine, but it can't do much more than listen to messages. |
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.
If a regular MessageListener is registered on a reliable topic, the message listener works fine, but it can't do much more than listen to messages. | |
If a `MessageListener` is registered on a reliable topic, it can listen to messages. |
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.
Changed to :
If a regular MessageListener is registered on a reliable topic, it can't do much more than listening to new messages but the ReliableMessageListener
gives you more capabilities on controlling the listener behaviour.
If a ReliableMessageListener
is registered on a normal ITopic, only the methods inherited from MessageListener
are called.
|
||
**Durable Subscription** | ||
|
||
The ReliableMessageListener allows you to control where you want to start processing a message when the listener is registered. This makes it possible to create a durable subscription by storing the sequence of the last message and using this sequenceId as the sequenceId to start from. |
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.
The ReliableMessageListener allows you to control where you want to start processing a message when the listener is registered. This makes it possible to create a durable subscription by storing the sequence of the last message and using this sequenceId as the sequenceId to start from. | |
You can use the `ReliableMessageListener` to control where you want to start processing a message when the listener is registered. This supports the creation of a durable subscription by storing the sequence of the last message and then starting from this `sequenceId`. |
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.
Changed to:
You can use the ReliableMessageListener
to control which message you want processing to start when the listener is registered. This supports the creation of a durable subscription by storing the sequence of the last message and then re-starting from this sequenceId
.
|
||
**Exception Handling** | ||
|
||
The ReliableMessageListener also gives the ability to deal with exceptions using the `isTerminal(Throwable)` method. This method allows you to control which exceptions should terminate the execution of the listener and cancel it. If a plain MessageListener is used, it won't terminate on exceptions and it will keep on running. But in some cases it is better to stop running. |
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.
The ReliableMessageListener also gives the ability to deal with exceptions using the `isTerminal(Throwable)` method. This method allows you to control which exceptions should terminate the execution of the listener and cancel it. If a plain MessageListener is used, it won't terminate on exceptions and it will keep on running. But in some cases it is better to stop running. | |
The `ReliableMessageListener` also copes with exceptions using the `isTerminal(Throwable)` method. This method allows you to control which exceptions can terminate and cancel the listener. If a `MessageListener` is used, it doesn't terminate following an exception and continues to run. In some situations, such as ????, it is better to cancel the listener following an exception. |
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.
you'll need to replace the ???? with a quick example of when this is the preferred behaviour
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.
Changed as:
The ReliableMessageListener
also copes with exceptions using the isTerminal(Throwable)
method. This method allows you to control which exceptions can terminate and cancel the listener. If a MessageListener
is used, it doesn't terminate following an exception and continues to run. In some situations, such as cluster being stopped, it is better to cancel the listener following the exception.
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[email protected]>
Co-authored-by: rebekah-lawrence <[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.
One last suggestion - for consistency in the wording of the sections on this page - this section could be headed:
Listening for Reliable Messages
Added the documentation section to describe the ReliableTopic ReliableMessageListener interface and capabilities.