Search code examples
apache-camelcamel-http

HttpOperationFailedException deprecatted but still used in Camel 3


I have a route that calls the HTTP component in Camel 3.3. This is working fine and I am trying to catch the HttpOperationFailedException which is being thrown.

I have declared the following error handler in my camel route:

    <onException>
            <exception>org.apache.camel.http.common.HttpOperationFailedException</exception>
    </onException>

The org.apache.camel.http.common.HttpOperationFailedExceptionis showing up as being depcrecatted and when I look at the documentation for Camel 3.3 I cant even find the HttpOperationFailedException.

Accoding to the JavaDoc the last time HttpOperationFailedException was listed was in the 2.25.1 release. According to the 3.3.0 javadoc the HttpOperationFailedException has been removed yet in my project it still throws it.

I double check my effective pom and this my dependency:

 <dependency>
        <groupId>org.apache.camel.springboot</groupId>
        <artifactId>camel-http-common-starter</artifactId>
        <version>3.3.0</version>
 </dependency>

I am pushing forward and using the exception but can someone please share some light on what is going on? Is this a mistake in the docs? If the HttpOperationFailedException was deprecated and/or removed what will replace it?


Solution

  • See the javadoc of the deprecated class what to use: https://github.com/apache/camel/blob/master/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpOperationFailedException.java#L22