Websocket API should support cumulative acknowledgement #18783
Replies: 10 comments
-
Does it like the TCP delayed acknowledgement? |
Beta Was this translation helpful? Give feedback.
-
I’m not sure how to accomplish that; can you give me an example of triggering a delayed ack of a block of messages that I could test? |
Beta Was this translation helpful? Give feedback.
-
Just forget it. I think I misunderstood the meaning of the feature. But now I know what you mean. |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarifying. I am attempting to build and run pulsar locally for development mode but I receive a 404 whenever attempting to connect to the websocket to create a producer due to a missing "serviceUrl" param. I have set this value to my local host/port in the conf/websocket.conf file but the result is the same. Is there somewhere else this should be set or an undocumented requirement for connecting from the websocket client? I have not experienced this issue when using the standard Pulsar docker image ( |
Beta Was this translation helpful? Give feedback.
-
@jeffgrunewald , Do you mean, you are running |
Beta Was this translation helpful? Give feedback.
-
Your assumption is correct, but adding that didn't seem to produce any different behavior. I also tried the same with |
Beta Was this translation helpful? Give feedback.
-
For further context, I am writing a pulsar client library for the Elixir language based on the websocket api. My producer and consumer is connecting to the endpoint |
Beta Was this translation helpful? Give feedback.
-
Thanks @jeffgrunewald for your feed back. Since the 404 error is not too related to the initial issue, I opened a new issue #5997, we could discuss it in 5997? |
Beta Was this translation helpful? Give feedback.
-
just as crosslink to an other websocket performance relevant issue: |
Beta Was this translation helpful? Give feedback.
-
@sijie this one likes to have the "component/websocket" label |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
In order to support feature parity with other clients, the WebSocket should also be able to cumulatively acknowledge messages up to and including the supplied message ID.
Describe the solution you'd like
Ideally, the acknowledgement payload that currently only seems to support
{"messageId":"CAoQKA=="}
could accept an optional second field specifying individual acknowledgement or cumulative acknowledgement. The absence of the field could be assumed to equate to individual acknowledgement. As an example, the following two options could be accepted to allow for individual acknowledgement of a message:{"messageId":"CAoQKA=="}
or{"messageId":"CAoQKA==","ackType":"Individual"}
while the following would be required to acknowledge messages cumulatively:
{"messageId":"CAoQKA==","ackType":"Cumulative"}
Describe alternatives you've considered
Perhaps a topic-level setting would also work in which case only it would be required at topic configuration as with partitioned topics but I image that would require more work to support.
Additional context
In order to maximize throughput of messages across a WebSocket, particularly when the same socket connection is handling acknowledgement, it would be ideal to support cumulative acknowledgement to minimize the processing on the cluster side by minimizing the number of acknowledgement messages needed to keep data flowing to the consumer, while also minimizing the amount of bottlenecking that occurs within the socket client itself by not requiring a one-for-one ack message to received message.
Thanks very much!
Beta Was this translation helpful? Give feedback.
All reactions