Interface NettySharedHttpServer
-
- All Superinterfaces:
AutoCloseable,org.apache.camel.Service
- All Known Implementing Classes:
DefaultNettySharedHttpServer
public interface NettySharedHttpServer extends org.apache.camel.ServiceA single interface to easily configure and setup a shared Netty HTTP server to be re-used among other Camel applications. To use this, just define aNettyServerBootstrapConfigurationconfiguration, and set this usingsetNettyServerBootstrapConfiguration(NettySharedHttpServerBootstrapConfiguration). Then call theService.start()to initialize this shared server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpServerConsumerChannelFactorygetConsumerChannelFactory()Gets theHttpServerConsumerChannelFactoryto use.intgetConsumersSize()Number of consumers using this shared Netty HTTP server.intgetPort()Gets the port number this Netty HTTP server uses.org.apache.camel.component.netty.NettyServerBootstrapFactorygetServerBootstrapFactory()Gets theNettyServerBootstrapFactoryto use.voidsetCamelContext(org.apache.camel.CamelContext camelContext)The CamelContextvoidsetNettyServerBootstrapConfiguration(NettySharedHttpServerBootstrapConfiguration configuration)Sets the bootstrap configuration to use by this shared Netty HTTP server.voidsetStartServer(boolean startServer)Whether to start the Netty HTTP server eager and bind to the port, or wait on first demandvoidsetThreadNamePattern(String pattern)Sets a custom thread name pattern to be used for naming the Netty HTTP server threads.
-
-
-
Method Detail
-
setNettyServerBootstrapConfiguration
void setNettyServerBootstrapConfiguration(NettySharedHttpServerBootstrapConfiguration configuration)
Sets the bootstrap configuration to use by this shared Netty HTTP server.
-
setCamelContext
void setCamelContext(org.apache.camel.CamelContext camelContext)
The CamelContext
-
setStartServer
void setStartServer(boolean startServer)
Whether to start the Netty HTTP server eager and bind to the port, or wait on first demand
-
setThreadNamePattern
void setThreadNamePattern(String pattern)
Sets a custom thread name pattern to be used for naming the Netty HTTP server threads.
-
getPort
int getPort()
Gets the port number this Netty HTTP server uses.
-
getConsumerChannelFactory
HttpServerConsumerChannelFactory getConsumerChannelFactory()
Gets theHttpServerConsumerChannelFactoryto use.
-
getServerBootstrapFactory
org.apache.camel.component.netty.NettyServerBootstrapFactory getServerBootstrapFactory()
Gets theNettyServerBootstrapFactoryto use.
-
getConsumersSize
int getConsumersSize()
Number of consumers using this shared Netty HTTP server.
-
-