Package org.apache.camel.component.ahc
Class AhcComponent
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultComponent
-
- org.apache.camel.support.HeaderFilterStrategyComponent
-
- org.apache.camel.component.ahc.AhcComponent
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Component
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HeaderFilterStrategyAware
,org.apache.camel.SSLContextParametersAware
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@Component("ahc") public class AhcComponent extends org.apache.camel.support.HeaderFilterStrategyComponent implements org.apache.camel.SSLContextParametersAware
To call external HTTP services using Async Http Client
-
-
Constructor Summary
Constructors Constructor Description AhcComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
createAddressUri(String uri, String remaining)
protected AhcEndpoint
createAhcEndpoint(String endpointUri, AhcComponent component, URI httpUri)
protected org.apache.camel.Endpoint
createEndpoint(String uri, String remaining, Map<String,Object> parameters)
AhcBinding
getBinding()
org.asynchttpclient.AsyncHttpClient
getClient()
org.asynchttpclient.AsyncHttpClientConfig
getClientConfig()
org.apache.camel.support.jsse.SSLContextParameters
getSslContextParameters()
boolean
isAllowJavaSerializedObject()
boolean
isUseGlobalSslContextParameters()
void
setAllowJavaSerializedObject(boolean allowJavaSerializedObject)
Whether to allow java serialization when a request uses context-type=application/x-java-serialized-objectvoid
setBinding(AhcBinding binding)
To use a customAhcBinding
which allows to control how to bind between AHC and Camel.void
setClient(org.asynchttpclient.AsyncHttpClient client)
To use a customAsyncHttpClient
void
setClientConfig(org.asynchttpclient.AsyncHttpClientConfig clientConfig)
To configure the AsyncHttpClient to use a custom com.ning.http.client.AsyncHttpClientConfig instance.void
setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
Reference to a org.apache.camel.support.jsse.SSLContextParameters in the Registry.void
setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
Enable usage of global SSL context parameters.-
Methods inherited from class org.apache.camel.support.HeaderFilterStrategyComponent
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy
-
Methods inherited from class org.apache.camel.support.DefaultComponent
afterConfiguration, createEndpoint, createEndpoint, doBuild, doInit, doStart, doStop, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
Methods inherited from interface org.apache.camel.SSLContextParametersAware
retrieveGlobalSslContextParameters
-
-
-
-
Method Detail
-
createEndpoint
protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
- Specified by:
createEndpoint
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
getClient
public org.asynchttpclient.AsyncHttpClient getClient()
-
setClient
public void setClient(org.asynchttpclient.AsyncHttpClient client)
To use a customAsyncHttpClient
-
getBinding
public AhcBinding getBinding()
-
setBinding
public void setBinding(AhcBinding binding)
To use a customAhcBinding
which allows to control how to bind between AHC and Camel.
-
getClientConfig
public org.asynchttpclient.AsyncHttpClientConfig getClientConfig()
-
setClientConfig
public void setClientConfig(org.asynchttpclient.AsyncHttpClientConfig clientConfig)
To configure the AsyncHttpClient to use a custom com.ning.http.client.AsyncHttpClientConfig instance.
-
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()
-
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
Reference to a org.apache.camel.support.jsse.SSLContextParameters in the Registry. Note that configuring this option will override any SSL/TLS configuration options provided through the clientConfig option at the endpoint or component level.
-
isAllowJavaSerializedObject
public boolean isAllowJavaSerializedObject()
-
setAllowJavaSerializedObject
public void setAllowJavaSerializedObject(boolean allowJavaSerializedObject)
Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.
-
isUseGlobalSslContextParameters
public boolean isUseGlobalSslContextParameters()
- Specified by:
isUseGlobalSslContextParameters
in interfaceorg.apache.camel.SSLContextParametersAware
-
setUseGlobalSslContextParameters
public void setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
Enable usage of global SSL context parameters.- Specified by:
setUseGlobalSslContextParameters
in interfaceorg.apache.camel.SSLContextParametersAware
-
createAhcEndpoint
protected AhcEndpoint createAhcEndpoint(String endpointUri, AhcComponent component, URI httpUri)
-
-