Class 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.AhcEndpoint
    Exchange data with external Websocket servers using Async Http Client.
    • Field Summary

      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect()  
      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 doStop()  
      WsComponent getComponent()  
      boolean isSendMessageOnError()  
      boolean isUseStreaming()  
      void setSendMessageOnError​(boolean sendMessageOnError)
      Whether to send an message if the web-socket listener received an error.
      void setUseStreaming​(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 interface org.apache.camel.Endpoint

        configureExchange, configureProperties, createAsyncProducer, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isSingletonProducer, setCamelContext
      • Methods inherited from interface org.apache.camel.IsSingleton

        isSingleton
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Constructor Detail

    • Method Detail

      • getComponent

        public WsComponent getComponent()
        Overrides:
        getComponent in class org.apache.camel.component.ahc.AhcEndpoint
      • createProducer

        public org.apache.camel.Producer createProducer()
                                                 throws Exception
        Specified by:
        createProducer in interface org.apache.camel.Endpoint
        Overrides:
        createProducer in class org.apache.camel.component.ahc.AhcEndpoint
        Throws:
        Exception
      • createConsumer

        public org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)
                                                 throws Exception
        Specified by:
        createConsumer in interface org.apache.camel.Endpoint
        Overrides:
        createConsumer in class org.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:
        createClient in class org.apache.camel.component.ahc.AhcEndpoint
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.component.ahc.AhcEndpoint
        Throws:
        Exception