You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/03/01 06:40:39 UTC

[camel] branch main updated: Revert "CAMEL-19058: cache the producer and endpoint locally to avoid hitting the type check scalability issue"

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 907a9d0c08d Revert "CAMEL-19058: cache the producer and endpoint locally to avoid hitting the type check scalability issue"
907a9d0c08d is described below

commit 907a9d0c08d40c5308bb440ec9ebaaa4d7544dc4
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Mar 1 07:39:56 2023 +0100

    Revert "CAMEL-19058: cache the producer and endpoint locally to avoid hitting the type check scalability issue"
    
    This reverts commit c8d36cb1ddb93331cbecb0efa10586737f1d72c6.
    
    See the notes on CAMEL-19102.
---
 .../org/apache/camel/support/cache/DefaultProducerCache.java | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/cache/DefaultProducerCache.java b/core/camel-support/src/main/java/org/apache/camel/support/cache/DefaultProducerCache.java
index c8ad9287213..17612316e62 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/cache/DefaultProducerCache.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/cache/DefaultProducerCache.java
@@ -58,9 +58,6 @@ public class DefaultProducerCache extends ServiceSupport implements ProducerCach
     private boolean extendedStatistics;
     private int maxCacheSize;
 
-    private Endpoint lastUsedEndpoint;
-    private AsyncProducer lastUsedProducer;
-
     public DefaultProducerCache(Object source, CamelContext camelContext, int cacheSize) {
         this.source = source;
         this.camelContext = camelContext;
@@ -122,20 +119,11 @@ public class DefaultProducerCache extends ServiceSupport implements ProducerCach
 
     @Override
     public AsyncProducer acquireProducer(Endpoint endpoint) {
-        // Try to favor thread locality as some data in the producer's cache may be shared among threads,
-        // triggering cases of false sharing
-        if (endpoint == lastUsedEndpoint) {
-            return lastUsedProducer;
-        }
-
         try {
             AsyncProducer producer = producers.acquire(endpoint);
             if (statistics != null) {
                 statistics.onHit(endpoint.getEndpointUri());
             }
-            lastUsedEndpoint = endpoint;
-            lastUsedProducer = producer;
-
             return producer;
         } catch (Throwable e) {
             throw new FailedToCreateProducerException(endpoint, e);