Producer hangs when using BatchBuilder.KeyBased
See original GitHub issueWhen using the KEY_BASED BatchBuilder it is impossible to send messages. The producer hangs forever and nothing happens.
Sample code:
var client = await new PulsarClientBuilder()
.ServiceUrl("pulsar://localhost:6650")
.BuildAsync();
await using var producer = await client.NewProducer(Schema.STRING())
.Topic("some-topic")
.EnableBatching(true)
.BatchBuilder(BatchBuilder.KeyBased)
.CreateAsync();
// this hangs when using BatchBuilder.KeyBased
await producer.SendAsync("Oh no!");
I’ve tested this code against pulsar:2.11.0 and pulsar:3.0.0. The Pulsar.Client version is 2.12.6.
Issue Analytics
- State:
- Created a month ago
- Comments:5
Top Results From Across the Web
Apache Pulsar 2.8.0
In this case, you need to rebuild your Function using Apache Pulsar 2.8.0 as a dependency and redeploy it. If you are running...
Read more >Apache Pulsar Release Notes (Legacy)
NotSerializableException occurs when we use ... Fixed C++ client producer sendAsync() hang when no enough batched message #4657 ...
Read more >2.9.0 Milestone
[Java Client] Let producer reconnect for state RegisteringSchema ... [PIP 95][Issue 12040][broker] Decouple advertised listeners from bind ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve pushed a fix for empty key case, will publish a nuget once CI will pass. However what I’ve found that the docs from pulsar site you linked don’t correspond to the code - NON_KEY value is never sent (such thing doesn’t exist in the codebase) so I just used empty string as well.
To answer my own question:
It will use the ordering key as the batch key, when the ordering key is specified, as seen in the source code.