async/sync mode in pulsar producer and consumer #22382
-
What is the best way to check and confirm that Async/Sync mode is working in Pulsar producer and consumer |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
@ragaur-tibco what exactly do you mean with "async/sync mode working"? Please elaborate. |
Beta Was this translation helpful? Give feedback.
-
@lhotari In Apache Pulsar, does async and sync mode work and how can I verify that the mode selected is working? There are multiple APIs used by the producer to send messages.
While internally, TypedMessageBuilderImpl.class present in package org.apache.pulsar.client.impl send() method is calling sendAsync()
|
Beta Was this translation helpful? Give feedback.
-
When sending messages asynchronously, you cannot assume that they are sent from the client to the broker until the callback receives a message id from each message that has been sent. This comment about the correct usage of the Pulsar Java client might be helpful: #22011 (comment) The relevant part:
|
Beta Was this translation helpful? Give feedback.
@ragaur-tibco For understanding the "internal process", it is good to start by reading the high level documentation for the Pulsar binary protocol. For example, the description of the producer gives good context to understand how the producer works. There's a presentation "Deep Dive into the Pulsar Binary Protocol" by @cbornet which explains a lot more around the binary protocol.
Pulsar's Java client and Pulsar broker use Netty to handle the network communications. If you really want to get into internal, it helps to get an understanding of Netty. One of the rare books on the topic is "Netty in Action".