Class WsEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.ahc.AhcEndpoint
-
- org.apache.camel.component.ahc.ws.WsEndpoint
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.AsyncEndpoint,org.apache.camel.CamelContextAware,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasId,org.apache.camel.spi.HeaderFilterStrategyAware,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.14.0", scheme="ahc-ws,ahc-wss", extendsScheme="ahc,ahc", title="Async HTTP Client (AHC) Websocket,Async HTTP Client (AHC) Secure Websocket", syntax="ahc-ws:httpUri", category=WEBSOCKET) public class WsEndpoint extends org.apache.camel.component.ahc.AhcEndpointExchange data with external Websocket servers using Async Http Client.
-
-
Constructor Summary
Constructors Constructor Description WsEndpoint(String endpointUri, WsComponent component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()protected org.asynchttpclient.AsyncHttpClientcreateClient(org.asynchttpclient.AsyncHttpClientConfig config)org.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor)org.apache.camel.ProducercreateProducer()protected voiddoStop()WsComponentgetComponent()booleanisSendMessageOnError()booleanisUseStreaming()voidsetSendMessageOnError(boolean sendMessageOnError)Whether to send an message if the web-socket listener received an error.voidsetUseStreaming(boolean useStreaming)To enable streaming to send data as multiple text fragments.-
Methods inherited from class org.apache.camel.component.ahc.AhcEndpoint
doStart, getBinding, getBufferSize, getClient, getClientConfig, getClientConfigOptions, getClientConfigRealmOptions, getCookieHandler, getHeaderFilterStrategy, getHttpUri, getSslContextParameters, isBridgeEndpoint, isConnectionClose, isLenientProperties, isThrowExceptionOnFailure, isTransferException, setBinding, setBridgeEndpoint, setBufferSize, setClient, setClientConfig, setClientConfigOptions, setClientConfigRealmOptions, setConnectionClose, setCookieHandler, setHeaderFilterStrategy, setHttpUri, setSslContextParameters, setThrowExceptionOnFailure, setTransferException
-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
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
-
Methods inherited from class org.apache.camel.support.service.BaseService
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.camel.Endpoint
configureExchange, configureProperties, createAsyncProducer, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isSingletonProducer, setCamelContext
-
-
-
-
Constructor Detail
-
WsEndpoint
public WsEndpoint(String endpointUri, WsComponent component)
-
-
Method Detail
-
getComponent
public WsComponent getComponent()
- Overrides:
getComponentin classorg.apache.camel.component.ahc.AhcEndpoint
-
createProducer
public org.apache.camel.Producer createProducer() throws Exception- Specified by:
createProducerin interfaceorg.apache.camel.Endpoint- Overrides:
createProducerin classorg.apache.camel.component.ahc.AhcEndpoint- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception- Specified by:
createConsumerin interfaceorg.apache.camel.Endpoint- Overrides:
createConsumerin classorg.apache.camel.component.ahc.AhcEndpoint- Throws:
Exception
-
isUseStreaming
public boolean isUseStreaming()
-
setUseStreaming
public void setUseStreaming(boolean useStreaming)
To enable streaming to send data as multiple text fragments.
-
isSendMessageOnError
public boolean isSendMessageOnError()
-
setSendMessageOnError
public void setSendMessageOnError(boolean sendMessageOnError)
Whether to send an message if the web-socket listener received an error.
-
createClient
protected org.asynchttpclient.AsyncHttpClient createClient(org.asynchttpclient.AsyncHttpClientConfig config)
- Overrides:
createClientin classorg.apache.camel.component.ahc.AhcEndpoint
-
connect
public void connect() throws ExecutionException, InterruptedException
-
-