Class NettyHttpEndpoint

  • 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="netty-http",
                 extendsScheme="netty",
                 title="Netty HTTP",
                 syntax="netty-http:protocol://host:port/path",
                 category={NETWORKING,HTTP},
                 lenientProperties=true)
    @Metadata(excludeProperties="textline,delimiter,autoAppendDelimiter,decoderMaxLineLength,encoding,allowDefaultCodec,udpConnectionlessSending,networkInterface,clientMode,reconnect,reconnectInterval,useByteBuf,udpByteArrayCodec,broadcast,correlationManager")
    public class NettyHttpEndpoint
    extends org.apache.camel.component.netty.NettyEndpoint
    implements org.apache.camel.AsyncEndpoint, org.apache.camel.spi.HeaderFilterStrategyAware
    Netty HTTP server and client using the Netty 4.x.
    • 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
      org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)  
      org.apache.camel.PollingConsumer createPollingConsumer()  
      org.apache.camel.Producer createProducer()  
      protected void doInit()  
      NettyHttpComponent getComponent()  
      NettyHttpConfiguration getConfiguration()  
      org.apache.camel.http.base.cookie.CookieHandler getCookieHandler()  
      org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()  
      String getHttpMethodRestrict()  
      NettyHttpBinding getNettyHttpBinding()  
      NettySharedHttpServer getNettySharedHttpServer()  
      NettyHttpSecurityConfiguration getSecurityConfiguration()  
      Map<String,​Object> getSecurityOptions()  
      boolean isLenientProperties()  
      boolean isTraceEnabled()  
      void setConfiguration​(org.apache.camel.component.netty.NettyConfiguration configuration)  
      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 org.apache.camel.spi.HeaderFilterStrategy to filter headers.
      void setHttpMethodRestrict​(String httpMethodRestrict)
      To disable HTTP methods on the Netty HTTP consumer.
      void setNettyHttpBinding​(NettyHttpBinding nettyHttpBinding)
      To use a custom org.apache.camel.component.netty.http.NettyHttpBinding for binding to/from Netty and Camel Message API.
      void setNettySharedHttpServer​(NettySharedHttpServer nettySharedHttpServer)
      To use a shared Netty HTTP server.
      void setSecurityConfiguration​(NettyHttpSecurityConfiguration securityConfiguration)
      Refers to a org.apache.camel.component.netty.http.NettyHttpSecurityConfiguration for configuring secure web resources.
      void setSecurityOptions​(Map<String,​Object> securityOptions)
      To configure NettyHttpSecurityConfiguration using key/value pairs from the map
      void setTraceEnabled​(boolean traceEnabled)
      Specifies whether to enable HTTP TRACE for this Netty HTTP consumer.
      • Methods inherited from class org.apache.camel.component.netty.NettyEndpoint

        createEndpointUri, enrichWithClientCertInformation, getSSLSession, isSynchronous, setSynchronous, updateMessageHeader
      • Methods inherited from class org.apache.camel.support.DefaultEndpoint

        configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createExchange, createExchange, doStart, doStop, 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, 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

      • NettyHttpEndpoint

        public NettyHttpEndpoint​(String endpointUri,
                                 NettyHttpComponent component,
                                 org.apache.camel.component.netty.NettyConfiguration configuration)
    • Method Detail

      • getComponent

        public NettyHttpComponent getComponent()
        Overrides:
        getComponent in class org.apache.camel.component.netty.NettyEndpoint
      • 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.netty.NettyEndpoint
        Throws:
        Exception
      • 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.netty.NettyEndpoint
        Throws:
        Exception
      • createPollingConsumer

        public org.apache.camel.PollingConsumer createPollingConsumer()
                                                               throws Exception
        Specified by:
        createPollingConsumer in interface org.apache.camel.Endpoint
        Overrides:
        createPollingConsumer in class org.apache.camel.support.DefaultEndpoint
        Throws:
        Exception
      • isLenientProperties

        public boolean isLenientProperties()
        Specified by:
        isLenientProperties in interface org.apache.camel.Endpoint
        Overrides:
        isLenientProperties in class org.apache.camel.support.DefaultEndpoint
      • setConfiguration

        public void setConfiguration​(org.apache.camel.component.netty.NettyConfiguration configuration)
        Overrides:
        setConfiguration in class org.apache.camel.component.netty.NettyEndpoint
      • getConfiguration

        public NettyHttpConfiguration getConfiguration()
        Overrides:
        getConfiguration in class org.apache.camel.component.netty.NettyEndpoint
      • setNettyHttpBinding

        public void setNettyHttpBinding​(NettyHttpBinding nettyHttpBinding)
        To use a custom org.apache.camel.component.netty.http.NettyHttpBinding for binding to/from Netty and Camel Message API.
      • getHeaderFilterStrategy

        public org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
        Specified by:
        getHeaderFilterStrategy in interface org.apache.camel.spi.HeaderFilterStrategyAware
      • setHeaderFilterStrategy

        public void setHeaderFilterStrategy​(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
        To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter headers.
        Specified by:
        setHeaderFilterStrategy in interface org.apache.camel.spi.HeaderFilterStrategyAware
      • isTraceEnabled

        public boolean isTraceEnabled()
      • setTraceEnabled

        public void setTraceEnabled​(boolean traceEnabled)
        Specifies whether to enable HTTP TRACE for this Netty HTTP consumer. By default TRACE is turned off.
      • getHttpMethodRestrict

        public String getHttpMethodRestrict()
      • setHttpMethodRestrict

        public void setHttpMethodRestrict​(String httpMethodRestrict)
        To disable HTTP methods on the Netty HTTP consumer. You can specify multiple separated by comma.
      • setNettySharedHttpServer

        public void setNettySharedHttpServer​(NettySharedHttpServer nettySharedHttpServer)
        To use a shared Netty HTTP server. See Netty HTTP Server Example for more details.
      • setSecurityConfiguration

        public void setSecurityConfiguration​(NettyHttpSecurityConfiguration securityConfiguration)
        Refers to a org.apache.camel.component.netty.http.NettyHttpSecurityConfiguration for configuring secure web resources.
      • setSecurityOptions

        public void setSecurityOptions​(Map<String,​Object> securityOptions)
        To configure NettyHttpSecurityConfiguration using key/value pairs from the map
      • getCookieHandler

        public org.apache.camel.http.base.cookie.CookieHandler getCookieHandler()
      • setCookieHandler

        public void setCookieHandler​(org.apache.camel.http.base.cookie.CookieHandler cookieHandler)
        Configure a cookie handler to maintain a HTTP session
      • doInit

        protected void doInit()
                       throws Exception
        Overrides:
        doInit in class org.apache.camel.support.DefaultEndpoint
        Throws:
        Exception