New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) #13556
Conversation
Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
🌟 Thank you for your contribution to the Apache Camel project! 🌟 If necessary Apache Camel Committers may access logs and test results in the job summaries! |
Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
🚫 There are (likely) no components to be tested in this PR |
Core test results:
|
🚫 There are (likely) no components to be tested in this PR |
Core test results:
|
🚫 There are (likely) no components to be tested in this PR |
Core test results:
|
Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
🚫 There are (likely) no components to be tested in this PR |
Core test results:
|
is the map empty, as checking for empty is faster. If you do a exists and then after wards get, then you do x2 the operation. |
Hi @davsclaus
Without the contains check the lock is applied even if the entry does not exist. The ReplyManagerSupport calls the get method excessively causing a delay.
ForegroundTask no longer being able to locate it (this will happen 50 times). Implementing the 'contains' method ensures that the lock is acquired only when necessary. |
camel-rabbitmq is deprecated and removed in v4. You should use camel-spring-rabbitmq, and can you check what it does in this spring component |
Sure! I'll test it. |
I'll come back soon with results of camel-spring-rabbitmq |
Yeah sure the contains check is outside the lock, but is the locking really a bootleneck. And that frequencey is only every 100ms. @orpiske ^^ |
IMHO, as long as we retain the second Obs.: without measuring is hard to attest if the lock is a bottleneck , but I think the proposed fix makes sense. |
…ut) (#13556) * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> --------- Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
…ut) (#13556) * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> --------- Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
…ut) (#13556) * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> --------- Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
…ut) (#13556) * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> * CAMEL-20590: avoiding delay to execute timeout to Camel RabbitMQ (InOut) Signed-off-by: Rhuan Rocha <rhuan080@gmail.com> --------- Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
Description
As described on the issue, the https://github.com/apache/camel/blob/camel-3.21.x/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/reply/ReplyManagerSupport.java#L217 is executing the get excessively. This delay occurs because the ReplyHandler has already been removed by the RabbitMQReplyManagerTimeoutChecker. The contains avoid getting locked when the TimeoutMapEntry does not exist.
Target
camel-3.x
, whereas Camel 4 uses themain
branch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTests
locally and I have committed all auto-generated changes