You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/06/15 19:51:00 UTC
[jira] [Resolved] (CAMEL-18195) Add setExceptionListener(...) to SjmsComponent
[ https://issues.apache.org/jira/browse/CAMEL-18195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-18195.
---------------------------------
Resolution: Fixed
> Add setExceptionListener(...) to SjmsComponent
> -----------------------------------------------
>
> Key: CAMEL-18195
> URL: https://issues.apache.org/jira/browse/CAMEL-18195
> Project: Camel
> Issue Type: New Feature
> Components: camel-sjms
> Reporter: Lance S
> Priority: Minor
> Fix For: 3.18.0
>
>
> I'd like to set an exception listener for all topics using "sjms2" but SjmsComponent is missing a setExceptionListener(...) method
> [https://github.com/apache/camel/blob/main/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsComponent.java]
>
> You can see that the "jms" component has a setExceptionListener(...) method but I don't want spring-jms on my classpath
> [https://github.com/apache/camel/blob/main/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java#L331-L333]
>
> As a workaround I have the choice to:
> 1. Set the exception listener in the URI of every jms inbound adapter
> eg: "sjms2:some-topic?exceptionListener=#myExceptionListener"
>
> 2. Extend SjmsComponent2 to set the ExceptionListener on the Sjms2Component
> {code:java}
> ExceptionListener myExceptionListener = ex -> handleException(ex);
> Sjms2Component jmsComponent = new Sjms2Component() {
> protected SjmsEndpoint createSjmsEndpoint(String uri, String remaining) {
> SjmsEndpoint endpoint super.createSjmsEndpoint(uri, remaining);
> endpoint.setExceptionListener(exceptionListener);
> return endpoint;
> }
> }{code}
>
> I'd like to request that setExceptionListener(...) be added to SjmsComponent (which will be inherited by Sjms2Component)
--
This message was sent by Atlassian Jira
(v8.20.7#820007)