Repository: camel Updated Branches: refs/heads/master 9b0b25886 -> 200e097d9
CAMEL-10441 Updated the documentation of WorkerGroup option in camel-netty4 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/200e097d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/200e097d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/200e097d Branch: refs/heads/master Commit: 200e097d9df501724b4e7681768562daef3e4359 Parents: 9b0b258 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Thu Nov 3 18:34:29 2016 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Thu Nov 3 18:34:29 2016 +0800 ---------------------------------------------------------------------- .../netty4/springboot/NettyComponentConfiguration.java | 5 +++-- .../camel-netty4-http/src/main/docs/netty4-http-component.adoc | 4 ++-- components/camel-netty4/src/main/docs/netty4-component.adoc | 4 ++-- .../component/netty4/NettyServerBootstrapConfiguration.java | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/200e097d/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java b/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java index 2c6ffe0..fb5f59d 100644 --- a/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java +++ b/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java @@ -449,8 +449,9 @@ public class NettyComponentConfiguration { private EventLoopGroup bossGroup; /** * To use a explicit EventLoopGroup as the boss thread pool. For example - * to share a thread pool with multiple consumers. By default each - * consumer has their own boss pool with 1 core thread. + * to share a thread pool with multiple consumers or producers. By + * default each consumer or producer has their own worker pool with 2 x + * cpu count core threads. */ private EventLoopGroup workerGroup; /** http://git-wip-us.apache.org/repos/asf/camel/blob/200e097d/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc index f122836..382e090 100644 --- a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc +++ b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc @@ -148,8 +148,6 @@ The Netty4 HTTP component supports 83 endpoint options which are listed below: | traceEnabled | consumer (advanced) | false | boolean | Specifies whether to enable HTTP TRACE for this Netty HTTP consumer. By default TRACE is turned off. | urlDecodeHeaders | consumer (advanced) | false | boolean | If this option is enabled then during binding from Netty to Camel Message then the header values will be URL decoded (eg 20 will be a space character. Notice this option is used by the default org.apache.camel.component.netty.http.NettyHttpBinding and therefore if you implement a custom org.apache.camel.component.netty4.http.NettyHttpBinding then you would need to decode the headers accordingly to this option. | usingExecutorService | consumer (advanced) | true | boolean | Whether to use ordered thread pool to ensure events are processed orderly on the same channel. -| workerCount | consumer (advanced) | | int | When netty works on nio mode it uses default workerCount parameter from Netty which is cpu_core_threads2. User can use this operation to override the default workerCount from Netty -| workerGroup | consumer (advanced) | | EventLoopGroup | To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers. By default each consumer has their own boss pool with 1 core thread. | connectTimeout | producer | 10000 | int | Time to wait for a socket connection to be available. Value is in millis. | cookieHandler | producer | | CookieHandler | Configure a cookie handler to maintain a HTTP session | requestTimeout | producer | | long | Allows to use a timeout for the Netty producer when calling a remote server. By default no timeout is in use. The value is in milli seconds so eg 30000 is 30 seconds. The requestTimeout is using Netty's ReadTimeoutHandler to trigger the timeout. @@ -179,6 +177,8 @@ The Netty4 HTTP component supports 83 endpoint options which are listed below: | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | transferException | advanced | false | boolean | If enabled and an Exchange failed processing on the consumer side and if the caused Exception was send back serialized in the response as a application/x-java-serialized-object content type. On the producer side the exception will be deserialized and thrown as is instead of the HttpOperationFailedException. The caused exception is required to be serialized. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. | transferExchange | advanced | false | boolean | Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body Out body fault body In headers Out headers fault headers exchange properties exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. +| workerCount | advanced | | int | When netty works on nio mode it uses default workerCount parameter from Netty which is cpu_core_threads2. User can use this operation to override the default workerCount from Netty +| workerGroup | advanced | | EventLoopGroup | To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers or producers. By default each consumer or producer has their own worker pool with 2 x cpu count core threads. | decoder | codec | | ChannelHandler | To use a single decoder. This options is deprecated use encoders instead. | decoders | codec | | String | A list of decoders to be used. You can use a String which have values separated by comma and have the values be looked up in the Registry. Just remember to prefix the value with so Camel knows it should lookup. | encoder | codec | | ChannelHandler | To use a single encoder. This options is deprecated use encoders instead. http://git-wip-us.apache.org/repos/asf/camel/blob/200e097d/components/camel-netty4/src/main/docs/netty4-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/main/docs/netty4-component.adoc b/components/camel-netty4/src/main/docs/netty4-component.adoc index fba30af..745ac05 100644 --- a/components/camel-netty4/src/main/docs/netty4-component.adoc +++ b/components/camel-netty4/src/main/docs/netty4-component.adoc @@ -117,8 +117,6 @@ The Netty4 component supports 74 endpoint options which are listed below: | serverExceptionCaughtLogLevel | consumer (advanced) | WARN | LoggingLevel | If the server (NettyConsumer) catches an exception then its logged using this logging level. | serverInitializerFactory | consumer (advanced) | | ServerInitializerFactory | To use a custom ServerInitializerFactory | usingExecutorService | consumer (advanced) | true | boolean | Whether to use ordered thread pool to ensure events are processed orderly on the same channel. -| workerCount | consumer (advanced) | | int | When netty works on nio mode it uses default workerCount parameter from Netty which is cpu_core_threads2. User can use this operation to override the default workerCount from Netty -| workerGroup | consumer (advanced) | | EventLoopGroup | To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers. By default each consumer has their own boss pool with 1 core thread. | connectTimeout | producer | 10000 | int | Time to wait for a socket connection to be available. Value is in millis. | requestTimeout | producer | | long | Allows to use a timeout for the Netty producer when calling a remote server. By default no timeout is in use. The value is in milli seconds so eg 30000 is 30 seconds. The requestTimeout is using Netty's ReadTimeoutHandler to trigger the timeout. | reuseChannel | producer | false | boolean | This option allows producers to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useable if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an exchange property with the key link NettyConstantsNETTY_CHANNEL which allows you to obtain the channel during routing and use it as well. @@ -142,6 +140,8 @@ The Netty4 component supports 74 endpoint options which are listed below: | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | transferExchange | advanced | false | boolean | Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body Out body fault body In headers Out headers fault headers exchange properties exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. | udpByteArrayCodec | advanced | false | boolean | For UDP only. If enabled the using byte array codec instead of Java serialization protocol. +| workerCount | advanced | | int | When netty works on nio mode it uses default workerCount parameter from Netty which is cpu_core_threads2. User can use this operation to override the default workerCount from Netty +| workerGroup | advanced | | EventLoopGroup | To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers or producers. By default each consumer or producer has their own worker pool with 2 x cpu count core threads. | allowDefaultCodec | codec | true | boolean | The netty component installs a default codec if both encoder/deocder is null and textline is false. Setting allowDefaultCodec to false prevents the netty component from installing a default codec as the first element in the filter chain. | autoAppendDelimiter | codec | true | boolean | Whether or not to auto append missing end delimiter when sending using the textline codec. | decoder | codec | | ChannelHandler | A custom ChannelHandler class that can be used to perform special marshalling of inbound payloads. http://git-wip-us.apache.org/repos/asf/camel/blob/200e097d/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyServerBootstrapConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyServerBootstrapConfiguration.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyServerBootstrapConfiguration.java index 6ccfb8b..a6de4f4 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyServerBootstrapConfiguration.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyServerBootstrapConfiguration.java @@ -48,7 +48,7 @@ public class NettyServerBootstrapConfiguration implements Cloneable { protected int receiveBufferSizePredictor; @UriParam(label = "consumer,advanced", defaultValue = "1") protected int bossCount = 1; - @UriParam(label = "consumer,advanced") + @UriParam(label = "advanced") protected int workerCount; @UriParam(defaultValue = "true") protected boolean keepAlive = true; @@ -97,7 +97,7 @@ public class NettyServerBootstrapConfiguration implements Cloneable { protected boolean nativeTransport; @UriParam(label = "consumer,advanced") protected EventLoopGroup bossGroup; - @UriParam(label = "consumer,advanced") + @UriParam(label = "advanced") protected EventLoopGroup workerGroup; @UriParam(label = "advanced") protected ChannelGroup channelGroup; @@ -496,7 +496,7 @@ public class NettyServerBootstrapConfiguration implements Cloneable { /** * To use a explicit EventLoopGroup as the boss thread pool. - * For example to share a thread pool with multiple consumers. By default each consumer has their own boss pool with 1 core thread. + * For example to share a thread pool with multiple consumers or producers. By default each consumer or producer has their own worker pool with 2 x cpu count core threads. */ public void setWorkerGroup(EventLoopGroup workerGroup) { this.workerGroup = workerGroup;