Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Cannot Reproduce
-
3.4.4
-
None
-
None
-
Unknown
Description
Hello,
we have defined a Spring based custom instance of AsyncHttpClient. This instance should be used by adding the property
camel.component.ahc-ws.client = asyncHttpClientTimeseriesImpl
to yaml file.
The implementation looks like this:
@Component @RequiredArgsConstructor public class AsyncHttpClientTimeseriesImpl extends DefaultAsyncHttpClient { /* ... custom members ... */ @Override @SuppressWarnings("ConstantConditions") public synchronized BoundRequestBuilder prepareGet(String url) { /* a token is requested to be added to the httpHeaders */ }
When using the ahc-wss endpoint in a route, the custom client is never used. Instead a DefaultAsyncHttpClient is instanciated and will fail to connect, due to missing httpHeader containing the valid token.
Example of the route:
<route id="distributorCloudRoute"> <from uri="seda:distributorEntryPoint?multipleConsumers=true"/> <to uri="ahc-wss:<url_of_externalHost>"/> </route>
used dependencies from pom.xml:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>2.2.0.RELEASE</version> </parent> <apache-camel.version>3.4.4</apache-camel.version> <dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-spring-boot-starter</artifactId> <version>${apache-camel.version}</version> </dependency> <dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-ahc-ws-starter</artifactId> <version>${apache-camel.version}</version> </dependency>
In the former version that was used - Camel 3.1.0 - the error didn't occur.
It would be nice if you can confirm the wrong behaviour of AHC-WS component and give an possible version containing the fix.
Best regards
Jörg Gonschior