@UriEndpoint(firstVersion="2.8.0",
scheme="ahc",
title="Async HTTP Client (AHC)",
syntax="ahc:httpUri",
producerOnly=true,
category=HTTP,
lenientProperties=true)
public class AhcEndpoint
extends org.apache.camel.support.DefaultEndpoint
implements org.apache.camel.AsyncEndpoint, org.apache.camel.spi.HeaderFilterStrategyAware
Constructor and Description |
---|
AhcEndpoint(String endpointUri,
AhcComponent component,
URI httpUri) |
Modifier and Type | Method and Description |
---|---|
protected org.asynchttpclient.AsyncHttpClient |
createClient(org.asynchttpclient.AsyncHttpClientConfig config) |
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
org.apache.camel.Producer |
createProducer() |
protected void |
doStart() |
protected void |
doStop() |
AhcBinding |
getBinding() |
int |
getBufferSize() |
org.asynchttpclient.AsyncHttpClient |
getClient() |
org.asynchttpclient.AsyncHttpClientConfig |
getClientConfig() |
Map<String,Object> |
getClientConfigOptions() |
Map<String,Object> |
getClientConfigRealmOptions() |
AhcComponent |
getComponent() |
org.apache.camel.http.base.cookie.CookieHandler |
getCookieHandler() |
org.apache.camel.spi.HeaderFilterStrategy |
getHeaderFilterStrategy() |
URI |
getHttpUri() |
org.apache.camel.support.jsse.SSLContextParameters |
getSslContextParameters() |
boolean |
isBridgeEndpoint() |
boolean |
isConnectionClose() |
boolean |
isLenientProperties() |
boolean |
isThrowExceptionOnFailure() |
boolean |
isTransferException() |
void |
setBinding(AhcBinding binding)
To use a custom
AhcBinding which allows to control how to bind between AHC and Camel. |
void |
setBridgeEndpoint(boolean bridgeEndpoint)
If the option is true, then the Exchange.HTTP_URI header is ignored, and use the endpoint's URI for request.
|
void |
setBufferSize(int bufferSize)
The initial in-memory buffer size used when transferring data between Camel and AHC Client.
|
void |
setClient(org.asynchttpclient.AsyncHttpClient client)
To use a custom
AsyncHttpClient |
void |
setClientConfig(org.asynchttpclient.AsyncHttpClientConfig clientConfig)
To configure the AsyncHttpClient to use a custom com.ning.http.client.AsyncHttpClientConfig instance.
|
void |
setClientConfigOptions(Map<String,Object> clientConfigOptions)
To configure the AsyncHttpClientConfig using the key/values from the Map.
|
void |
setClientConfigRealmOptions(Map<String,Object> clientConfigRealmOptions)
To configure the AsyncHttpClientConfig Realm using the key/values from the Map.
|
void |
setConnectionClose(boolean connectionClose)
Define if the Connection Close header has to be added to HTTP Request.
|
void |
setCookieHandler(org.apache.camel.http.base.cookie.CookieHandler cookieHandler)
Configure a cookie handler to maintain a HTTP session
|
void |
setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
To use a custom HeaderFilterStrategy to filter header to and from Camel message.
|
void |
setHttpUri(URI httpUri)
The URI to use such as http://hostname:port/path
|
void |
setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
Reference to a org.apache.camel.support.jsse.SSLContextParameters in the Registry.
|
void |
setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
Option to disable throwing the AhcOperationFailedException in case of failed responses from the remote server.
|
void |
setTransferException(boolean transferException)
If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back
serialized in the response as a application/x-java-serialized-object content type (for example using Jetty or
Servlet Camel components).
|
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
configureExchange, configureProperties, createAsyncProducer, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isSingletonProducer, setCamelContext
public AhcEndpoint(String endpointUri, AhcComponent component, URI httpUri)
public AhcComponent getComponent()
getComponent
in class org.apache.camel.support.DefaultEndpoint
public org.apache.camel.Producer createProducer() throws Exception
createProducer
in interface org.apache.camel.Endpoint
Exception
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
createConsumer
in interface org.apache.camel.Endpoint
Exception
public boolean isLenientProperties()
isLenientProperties
in interface org.apache.camel.Endpoint
isLenientProperties
in class org.apache.camel.support.DefaultEndpoint
public org.asynchttpclient.AsyncHttpClient getClient()
public void setClient(org.asynchttpclient.AsyncHttpClient client)
AsyncHttpClient
public org.asynchttpclient.AsyncHttpClientConfig getClientConfig()
public void setClientConfig(org.asynchttpclient.AsyncHttpClientConfig clientConfig)
public URI getHttpUri()
public void setHttpUri(URI httpUri)
public AhcBinding getBinding()
public void setBinding(AhcBinding binding)
AhcBinding
which allows to control how to bind between AHC and Camel.public org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
getHeaderFilterStrategy
in interface org.apache.camel.spi.HeaderFilterStrategyAware
public void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
setHeaderFilterStrategy
in interface org.apache.camel.spi.HeaderFilterStrategyAware
public boolean isBridgeEndpoint()
public void setBridgeEndpoint(boolean bridgeEndpoint)
public boolean isThrowExceptionOnFailure()
public void setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
public boolean isTransferException()
public void setTransferException(boolean transferException)
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
public int getBufferSize()
public void setBufferSize(int bufferSize)
public void setClientConfigOptions(Map<String,Object> clientConfigOptions)
public void setClientConfigRealmOptions(Map<String,Object> clientConfigRealmOptions)
public boolean isConnectionClose()
public void setConnectionClose(boolean connectionClose)
public org.apache.camel.http.base.cookie.CookieHandler getCookieHandler()
public void setCookieHandler(org.apache.camel.http.base.cookie.CookieHandler cookieHandler)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.DefaultEndpoint
Exception
protected org.asynchttpclient.AsyncHttpClient createClient(org.asynchttpclient.AsyncHttpClientConfig config)
Apache Camel