Skip to content

Add a call ACK / unack example to avoid confusing the retrial mechani…#11166

Merged
sijie merged 4 commits into
apache:masterfrom
yonyong:yonyong
Jul 2, 2021
Merged

Add a call ACK / unack example to avoid confusing the retrial mechani…#11166
sijie merged 4 commits into
apache:masterfrom
yonyong:yonyong

Conversation

@yonyong

@yonyong yonyong commented Jun 30, 2021

Copy link
Copy Markdown
Contributor

Add a call ACK / unack example to avoid confusing the retrial mechanism for beginners

@yonyong yonyong closed this Jun 30, 2021
@yonyong yonyong reopened this Jun 30, 2021
@Jennifer88huang-zz
Jennifer88huang-zz self-requested a review June 30, 2021 09:45
@tuhaihe

tuhaihe commented Jun 30, 2021

Copy link
Copy Markdown
Member

@yonyong thanks for your contribution! 🤝

@Jennifer88huang-zz Jennifer88huang-zz added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Jun 30, 2021
@Jennifer88huang-zz Jennifer88huang-zz added this to the 2.9.0 milestone Jun 30, 2021
Comment thread site2/docs/concepts-messaging.md
Comment thread site2/docs/concepts-messaging.md Outdated

The following example shows how to call the API :

```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```java

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done

Comment thread site2/docs/concepts-messaging.md Outdated
- 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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Comment thread site2/docs/concepts-messaging.md Outdated
```java
consumer.acknowledge(msg);
```
If you are going to acknowledge messages cumulatively, you can use the following API:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment thread site2/docs/concepts-messaging.md Outdated

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 :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following example shows how to call the API :
If you want to acknowledge messages negatively, you can use the following API.

Comment thread site2/docs/concepts-messaging.md Outdated
.subscribe();
```

The following example shows how to call the API to put messages into the retrial queue:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sijie
sijie merged commit c080c84 into apache:master Jul 2, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
apache#11166)

* Add a call ACK / unack example to avoid confusing the retrial mechanism for beginners

Co-authored-by: yangde <yangde@myai.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants