[ 
https://issues.apache.org/jira/browse/CAMEL-18195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lance S updated CAMEL-18195:
----------------------------
    Description: 
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)

  was:
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.createSjmsEndpoin(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)


> 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
>
> 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)

Reply via email to