You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the documentation for the reliable_topic listener callback on_cancel [API-2183] (#1217)
* Updated the documentation for the reliable_topic listener callback function usages including the new callback on_cancel.
Co-authored-by: Serdar Ozmen <[email protected]>
std::cout << "terminate_on_exception is called" << std::endl;
1928
+
return true;
1929
+
})
1930
+
.on_cancel([]() {
1931
+
std::cout << "on_cancel is called" << std::endl;
1932
+
});
1922
1933
}
1923
1934
1924
1935
void listen_with_default_config() {
@@ -1972,6 +1983,7 @@ void listen_with_config() {
1972
1983
client.shutdown().get();
1973
1984
}
1974
1985
```
1986
+
The above examples compose a reliable topic listener that listens to the new messages and increments the received message count atomically. The listener also prints a debug message for each callback function available in the listener. The `on_store_sequence_id` callback function is used to store the last received message's sequence ID. The `terminate_on_exception` function allows you to evaluate the exception and continue or terminate the listener. The `on_cancel` callback function notifies you before the listener is cancelled for any reason so that you can take the necessary action. The first example uses a default configuration for the reliable topic, and the second one uses a custom configuration.
0 commit comments