Repository navigation
[fix][client]Fixed getting an incorrect maxMessageSize value when accessing multiple clusters in the same process - #22306
Conversation
…iple clusters in the same process.
|
@chenhongSZ Please add the following content to your PR description and select a checkbox: |
|
Please fix checkstyle error src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:[96,8] (imports) UnusedImports: Unused import: org.apache.pulsar.client.impl.ClientCnx. |
fixed |
|
It might be necessary to fix this test: |
oh, I'll fix it later |
|
/pulsarbot run-failure-checks |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22306 +/- ##
============================================
+ Coverage 73.57% 73.81% +0.23%
- Complexity 32624 32841 +217
============================================
Files 1877 1887 +10
Lines 139502 139479 -23
Branches 15299 15292 -7
============================================
+ Hits 102638 102955 +317
+ Misses 28908 28600 -308
+ Partials 7956 7924 -32
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/pulsarbot run-failure-checks |
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <atomchchen@tencent.com> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <atomchchen@tencent.com> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <atomchchen@tencent.com> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <atomchchen@tencent.com> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <atomchchen@tencent.com> (cherry picked from commit 71598c1) (cherry picked from commit bff6ea2)
…ccessing multiple clusters in the same process (apache#22306) Co-authored-by: atomchchen <atomchchen@tencent.com>
Motivation
We are using two PulsarClients within the same process to connect to cluster A (maxMessageSize=5M) and cluster B (maxMessageSize=16M), and sometimes the following error occurs.
Got corrupted payload message size 5251327 at org.apache.pulsar.common.api.proto.MessageIdData@5e940463I think the root cause is that the client's
org.apache.pulsar.client.impl.ClientCnx#maxMessageSizevariable is static, which does not support different configurations of two clusters at the same time.Modifications
org.apache.pulsar.client.impl.ClientCnx#maxMessageSizevariable to be non-static, share this variable only within the same connection.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: