-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 a call ACK / unack example to avoid confusing the retrial mechani… #11166
Conversation
@yonyong thanks for your contribution! 🤝 |
site2/docs/concepts-messaging.md
Outdated
@@ -164,6 +170,12 @@ In the shared and Key_Shared subscription modes, you can negatively acknowledge | |||
|
|||
Be aware that negative acknowledgment on ordered subscription types, such as Exclusive, Failover and Key_Shared, can cause failed messages to arrive consumers out of the original order. | |||
|
|||
The following example shows how to call the API : | |||
|
|||
``` |
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.
``` | |
```java |
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.
Please also apply the change to other code snippets to mark the code block as Java language for correct highlight.
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.
It's done
…a language for correct highlight
site2/docs/concepts-messaging.md
Outdated
@@ -149,6 +149,17 @@ Messages can be acknowledged in the following two ways: | |||
- Messages are acknowledged individually. With individual acknowledgement, the consumer needs to acknowledge each message and sends an acknowledgement request to the broker. | |||
- Messages are acknowledged cumulatively. With cumulative acknowledgement, the consumer only needs to acknowledge the last message it received. All messages in the stream up to (and including) the provided message are not re-delivered to that consumer. | |||
|
|||
The following example shows how to call the API With individual acknowledgement: |
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 following example shows how to call the API With individual acknowledgement: | |
If you want to acknowledge messages individually, you can use the following API. |
Pls keep consistent overall
site2/docs/concepts-messaging.md
Outdated
```java | ||
consumer.acknowledge(msg); | ||
``` | ||
If you are going to acknowledge messages cumulatively, you can use the following API: |
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 you are going to acknowledge messages cumulatively, you can use the following API: | |
If you want to acknowledge messages cumulatively, you can use the following API. |
site2/docs/concepts-messaging.md
Outdated
@@ -164,6 +175,13 @@ In the shared and Key_Shared subscription modes, you can negatively acknowledge | |||
|
|||
Be aware that negative acknowledgment on ordered subscription types, such as Exclusive, Failover and Key_Shared, can cause failed messages to arrive consumers out of the original order. | |||
|
|||
The following example shows how to call the API : |
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 following example shows how to call the API : | |
If you want to acknowledge messages negatively, you can use the following API. |
site2/docs/concepts-messaging.md
Outdated
@@ -242,6 +260,14 @@ Consumer<byte[]> consumer = pulsarClient.newConsumer(Schema.BYTES) | |||
.subscribe(); | |||
``` | |||
|
|||
The following example shows how to call the API to put messages into the retrial queue: |
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 following example shows how to call the API to put messages into the retrial queue: | |
If you want to put messages into a retrial queue, you can use the following API. |
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.
done @Anonymitaet
apache#11166) * Add a call ACK / unack example to avoid confusing the retrial mechanism for beginners Co-authored-by: yangde <yangde@myai.tech>
Add a call ACK / unack example to avoid confusing the retrial mechanism for beginners