Class NettyHttpComponent

  • 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.spi.RestApiConsumerFactory, org.apache.camel.spi.RestConsumerFactory, org.apache.camel.spi.RestProducerFactory, org.apache.camel.SSLContextParametersAware, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @Component("netty-http")
    public class NettyHttpComponent
    extends org.apache.camel.component.netty.NettyComponent
    implements org.apache.camel.spi.HeaderFilterStrategyAware, org.apache.camel.spi.RestConsumerFactory, org.apache.camel.spi.RestApiConsumerFactory, org.apache.camel.spi.RestProducerFactory, org.apache.camel.SSLContextParametersAware
    Netty HTTP based component.
    • 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 createApiConsumer​(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String contextPath, org.apache.camel.spi.RestConfiguration configuration, Map<String,​Object> parameters)  
      org.apache.camel.Consumer createConsumer​(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String verb, String basePath, String uriTemplate, String consumes, String produces, org.apache.camel.spi.RestConfiguration configuration, Map<String,​Object> parameters)  
      protected org.apache.camel.Endpoint createEndpoint​(String uri, String remaining, Map<String,​Object> parameters)  
      org.apache.camel.Producer createProducer​(org.apache.camel.CamelContext camelContext, String host, String verb, String basePath, String uriTemplate, String queryParameters, String consumes, String produces, org.apache.camel.spi.RestConfiguration configuration, Map<String,​Object> parameters)  
      protected void doInit()  
      protected void doStop()  
      NettyHttpConfiguration getConfiguration()  
      org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()  
      HttpServerConsumerChannelFactory getMultiplexChannelHandler​(int port)  
      NettyHttpBinding getNettyHttpBinding()  
      protected HttpServerBootstrapFactory getOrCreateHttpNettyServerBootstrapFactory​(NettyHttpConsumer consumer)  
      NettyHttpSecurityConfiguration getSecurityConfiguration()  
      boolean isMuteException()  
      boolean isUseGlobalSslContextParameters()  
      protected NettyHttpConfiguration parseConfiguration​(org.apache.camel.component.netty.NettyConfiguration configuration, String remaining, Map<String,​Object> parameters)  
      void setConfiguration​(NettyHttpConfiguration configuration)  
      void setHeaderFilterStrategy​(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
      To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter headers.
      void setMuteException​(boolean muteException)
      If enabled and an Exchange failed processing on the consumer side the response's body won't contain the exception's stack trace.
      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 setSecurityConfiguration​(NettyHttpSecurityConfiguration securityConfiguration)
      Refers to a org.apache.camel.component.netty.http.NettyHttpSecurityConfiguration for configuring secure web resources.
      void setUseGlobalSslContextParameters​(boolean useGlobalSslContextParameters)
      Enable usage of global SSL context parameters.
      • Methods inherited from class org.apache.camel.component.netty.NettyComponent

        doStart, getExecutorService, getMaximumPoolSize, setConfiguration, setExecutorService, setMaximumPoolSize
      • Methods inherited from class org.apache.camel.support.DefaultComponent

        afterConfiguration, createEndpoint, createEndpoint, doBuild, 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 interface org.apache.camel.CamelContextAware

        getCamelContext, setCamelContext
      • 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.SSLContextParametersAware

        retrieveGlobalSslContextParameters
      • 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

      • NettyHttpComponent

        public NettyHttpComponent()
    • Method Detail

      • createEndpoint

        protected org.apache.camel.Endpoint createEndpoint​(String uri,
                                                           String remaining,
                                                           Map<String,​Object> parameters)
                                                    throws Exception
        Overrides:
        createEndpoint in class org.apache.camel.component.netty.NettyComponent
        Throws:
        Exception
      • parseConfiguration

        protected NettyHttpConfiguration parseConfiguration​(org.apache.camel.component.netty.NettyConfiguration configuration,
                                                            String remaining,
                                                            Map<String,​Object> parameters)
                                                     throws Exception
        Overrides:
        parseConfiguration in class org.apache.camel.component.netty.NettyComponent
        Throws:
        Exception
      • 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.
      • getConfiguration

        public NettyHttpConfiguration getConfiguration()
        Overrides:
        getConfiguration in class org.apache.camel.component.netty.NettyComponent
      • 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
      • setSecurityConfiguration

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

        public boolean isUseGlobalSslContextParameters()
        Specified by:
        isUseGlobalSslContextParameters in interface org.apache.camel.SSLContextParametersAware
        Overrides:
        isUseGlobalSslContextParameters in class org.apache.camel.component.netty.NettyComponent
      • setUseGlobalSslContextParameters

        public void setUseGlobalSslContextParameters​(boolean useGlobalSslContextParameters)
        Enable usage of global SSL context parameters.
        Specified by:
        setUseGlobalSslContextParameters in interface org.apache.camel.SSLContextParametersAware
        Overrides:
        setUseGlobalSslContextParameters in class org.apache.camel.component.netty.NettyComponent
      • isMuteException

        public boolean isMuteException()
      • setMuteException

        public void setMuteException​(boolean muteException)
        If enabled and an Exchange failed processing on the consumer side the response's body won't contain the exception's stack trace.
      • createConsumer

        public org.apache.camel.Consumer createConsumer​(org.apache.camel.CamelContext camelContext,
                                                        org.apache.camel.Processor processor,
                                                        String verb,
                                                        String basePath,
                                                        String uriTemplate,
                                                        String consumes,
                                                        String produces,
                                                        org.apache.camel.spi.RestConfiguration configuration,
                                                        Map<String,​Object> parameters)
                                                 throws Exception
        Specified by:
        createConsumer in interface org.apache.camel.spi.RestConsumerFactory
        Throws:
        Exception
      • createApiConsumer

        public org.apache.camel.Consumer createApiConsumer​(org.apache.camel.CamelContext camelContext,
                                                           org.apache.camel.Processor processor,
                                                           String contextPath,
                                                           org.apache.camel.spi.RestConfiguration configuration,
                                                           Map<String,​Object> parameters)
                                                    throws Exception
        Specified by:
        createApiConsumer in interface org.apache.camel.spi.RestApiConsumerFactory
        Throws:
        Exception
      • createProducer

        public org.apache.camel.Producer createProducer​(org.apache.camel.CamelContext camelContext,
                                                        String host,
                                                        String verb,
                                                        String basePath,
                                                        String uriTemplate,
                                                        String queryParameters,
                                                        String consumes,
                                                        String produces,
                                                        org.apache.camel.spi.RestConfiguration configuration,
                                                        Map<String,​Object> parameters)
                                                 throws Exception
        Specified by:
        createProducer in interface org.apache.camel.spi.RestProducerFactory
        Throws:
        Exception
      • doInit

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

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