commit | 9ece7a17dc5d157329347e5d439b3c5dbf0d09d3 | [log] [tgz] |
---|---|---|
author | Masahiro Sakamoto <massakam@yahoo-corp.jp> | Wed Dec 11 02:02:38 2019 +0900 |
committer | Sijie Guo <sijie@apache.org> | Tue Dec 10 09:02:38 2019 -0800 |
tree | 96a235cf8eb5a8afbc97e4a28caf2692d4d9da25 | |
parent | 9231d4f59c89485d68815f9a681cccde85b732a0 [diff] |
Ensure that the same message ID is not added to UnAckedMessageTracker multiple times (#5823) ### Motivation When a message ID is added to `UnAckedMessageTracker`, it is added as an instance of `MessageIdImpl`, not `BatchMessageIdImpl`. Since the batch index information is deleted at this time, the same message ID will be added to `UnAckedMessageTracker` multiple times when consumer receives batched messages. https://github.com/apache/pulsar/blob/a8c8a7ee1559bc607b3454fa55134094d8a2c208/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1124-L1134 There is no problem even if the same message ID is added without taking too much time. However, if the interval between these message IDs is long, the message IDs may be added to other elements of `timePartitions`. https://github.com/apache/pulsar/blob/09360682953d0cbc154630a470492c11a4f83184/pulsar-client/src/main/java/org/apache/pulsar/client/impl/UnAckedMessageTracker.java#L163-L172 As a result, even if the consumer sends ack, some message IDs remain without being deleted from `timePartitions`, and an unnecessary ack timeout event occurs. ### Modifications When adding a message ID to `UnAckedMessageTracker`, check if the same message ID is already included in` timePartitions`, and if it is included, do nothing.
Pulsar is a distributed pub-sub messaging platform with a very flexible messaging model and an intuitive client API.
Learn more about Pulsar at https://pulsar.apache.org
Requirements:
Compile and install:
$ mvn install -DskipTests
Run Unit Tests:
$ mvn test
Run Individual Unit Test:
$ cd module-name (e.g: pulsar-client) $ mvn test -Dtest=unit-test-name (e.g: ConsumerBuilderImplTest)
Start standalone Pulsar service:
$ bin/pulsar standalone
Check https://pulsar.apache.org for documentation and examples.
Apache Pulsar is using lombok so you have to ensure your IDE setup with required plugins.
To configure annotation processing in IntelliJ:
Open Annotation Processors Settings dialog box by going to Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors
.
Select the following buttons:
Set the generated source directories to be equal to the Maven directories:
Click “OK”.
Install the lombok plugin in intellij.
Follow the instructions here to configure your Eclipse setup.
Refer to the docs README.
Name | Scope | |||
---|---|---|---|---|
users@pulsar.apache.org | User-related discussions | Subscribe | Unsubscribe | Archives |
dev@pulsar.apache.org | Development-related discussions | Subscribe | Unsubscribe | Archives |
Pulsar slack channel at https://apache-pulsar.slack.com/
You can self-register at https://apache-pulsar.herokuapp.com/
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.
The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.
The following provides more details on the included cryptographic software: Pulsar uses the SSL library from Bouncy Castle written by http://www.bouncycastle.org.