essobedo commented on code in PR #9433:
URL: https://github.com/apache/camel/pull/9433#discussion_r1118992365
##########
core/camel-support/src/main/java/org/apache/camel/support/cache/DefaultProducerCache.java:
##########
@@ -54,6 +54,10 @@
public class DefaultProducerCache extends ServiceSupport implements
ProducerCache {
private static final Logger LOG =
LoggerFactory.getLogger(DefaultProducerCache.class);
+ private static final RejectedExecutionException
REJECTED_EXECUTION_EXCEPTION
+ = new RejectedExecutionException("CamelContext is stopped");
+ private volatile boolean filledStackTrace;
Review Comment:
You could rather use an `AtomicReference<RejectedExecutionException>`
instead , then in the `send` method you lazily initialize it with
`exchange.setException(REJECTED_EXECUTION_EXCEPTION.updateAndGet(ex -> ex ==
null ? new RejectedExecutionException("CamelContext is stopped") : ex));`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]