You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jörg Gonschior (Jira)" <ji...@apache.org> on 2021/01/18 15:44:00 UTC

[jira] [Created] (CAMEL-16062) Custom AsyncHttpClient is ignored when using ahc-ws component

Jörg Gonschior created CAMEL-16062:
--------------------------------------

             Summary: Custom AsyncHttpClient is ignored when using ahc-ws component
                 Key: CAMEL-16062
                 URL: https://issues.apache.org/jira/browse/CAMEL-16062
             Project: Camel
          Issue Type: Bug
          Components: camel-ahc-ws
    Affects Versions: 3.4.4
            Reporter: Jörg Gonschior


Hello,

we have defined a Spring based custom instance of AsyncHttpClient. This instance should be used by adding the property
{code:java}
camel.component.ahc-ws.client = asyncHttpClientTimeseriesImpl{code}
to yaml file.

The implementation looks like this:

 
{code:java}
@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 */
}
{code}
 

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:
{code:java}
<route id="distributorCloudRoute">
  <from uri="seda:distributorEntryPoint?multipleConsumers=true"/>
  <to uri="ahc-wss:<url_of_externalHost>"/>
</route>{code}
 

used dependencies from pom.xml:
{code:java}
<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>{code}
 

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

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)