[
https://issues.apache.org/jira/browse/CAMEL-24591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-24591.
---------------------------------
Resolution: Fixed
> camel-seda - Send fails with "No queue available" after producer route
> restart (regression from CAMEL-24408)
> ------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-24591
> URL: https://issues.apache.org/jira/browse/CAMEL-24591
> Project: Camel
> Issue Type: Bug
> Components: camel-seda
> Affects Versions: 4.23.0
> Reporter: Jiří Ondrušek
> Assignee: Jiří Ondrušek
> Priority: Major
> Fix For: 4.18.5, 4.22.1, 4.23.0
>
>
> Since CAMEL-24408, restarting a route that produces to a SEDA endpoint breaks
> all subsequent sends:
> {code:java}
> from("direct:start").routeId("producer").to("seda:bar");
> context.getRouteController().stopRoute("producer");
> context.getRouteController().startRoute("producer");
> template.sendBody("direct:start", "hi");
> // SedaConsumerNotAvailableException: No queue available on endpoint:
> seda://bar
> {code}
> On route stop the queue reference is now released from the component, but the
> singleton endpoint keeps stale non-null {{ref}}/{{queue}} fields. The
> re-registration guard in {{SedaEndpoint.onStarted(SedaProducer)}} only checks
> for null, so it is skipped, and the next send resolves a released reference
> ({{count == 0}}) to null.
> Fix: also re-register when the reference was released:
> {code:java}
> if (getComponent() != null && (ref == null || ref.getCount() == 0 || queue ==
> null)) {
> {code}
> Found via the Camel Quarkus kafka integration test ({{kafka -> seda}} route
> restarted to verify redelivery).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)