You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/07/29 07:32:28 UTC

[1/3] camel git commit: CAMEL-10184 - Allow to use a custom ChannelGroup for NettyProducer

Repository: camel
Updated Branches:
  refs/heads/master 376deb916 -> a47cee597


CAMEL-10184 - Allow to use a custom ChannelGroup for NettyProducer


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/687b906d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/687b906d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/687b906d

Branch: refs/heads/master
Commit: 687b906daea377af71141a73cc5421b080e63f38
Parents: 376deb9
Author: Jean-Yves BESSON <je...@external.partecis.eu>
Authored: Thu Jul 28 17:14:55 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jul 29 09:25:35 2016 +0200

----------------------------------------------------------------------
 .../apache/camel/component/netty4/NettyProducer.java    | 12 ++++++++++--
 .../netty4/NettyServerBootstrapConfiguration.java       |  2 +-
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/687b906d/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java
index e04452e..ca4ea84 100644
--- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java
+++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java
@@ -56,7 +56,7 @@ import org.slf4j.LoggerFactory;
 
 public class NettyProducer extends DefaultAsyncProducer {
     private static final Logger LOG = LoggerFactory.getLogger(NettyProducer.class);
-    private final ChannelGroup allChannels = new DefaultChannelGroup("NettyProducer", ImmediateEventExecutor.INSTANCE);
+    private ChannelGroup allChannels;
     private CamelContext context;
     private NettyConfiguration configuration;
     private ClientInitializerFactory pipelineFactory;
@@ -100,7 +100,7 @@ public class NettyProducer extends DefaultAsyncProducer {
                 .withWorkerCount(configuration.getWorkerCount())
                 .withName("NettyClientTCPWorker").build();
         }
-        
+               
         if (configuration.isProducerPoolEnabled()) {
             // setup pool where we want an unbounded pool, which allows the pool to shrink on no demand
             GenericObjectPool.Config config = new GenericObjectPool.Config();
@@ -136,6 +136,14 @@ public class NettyProducer extends DefaultAsyncProducer {
             pipelineFactory = new DefaultClientInitializerFactory(this);
         }
 
+        // setup channel group
+        if(configuration.getChannelGroup() == null) {
+            allChannels = new DefaultChannelGroup("NettyProducer", ImmediateEventExecutor.INSTANCE);
+        }
+        else {
+            allChannels = configuration.getChannelGroup();
+        }
+        
         if (!configuration.isLazyChannelCreation()) {
             // ensure the connection can be established when we start up
             Channel channel = pool.borrowObject();

http://git-wip-us.apache.org/repos/asf/camel/blob/687b906d/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 3972da5..6ccfb8b 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
@@ -99,7 +99,7 @@ public class NettyServerBootstrapConfiguration implements Cloneable {
     protected EventLoopGroup bossGroup;
     @UriParam(label = "consumer,advanced")
     protected EventLoopGroup workerGroup;
-    @UriParam(label = "consumer,advanced")
+    @UriParam(label = "advanced")
     protected ChannelGroup channelGroup;
     @UriParam(label = "consumer,advanced")
     protected String networkInterface;


[2/3] camel git commit: CAMEL-10184: Updated docs and NettyComponentAutoConfiguration for Spring-boot

Posted by ac...@apache.org.
CAMEL-10184: Updated docs and NettyComponentAutoConfiguration for Spring-boot


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7fc698cf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7fc698cf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7fc698cf

Branch: refs/heads/master
Commit: 7fc698cfb7ef21451a8a886fdc7065e9051afa1d
Parents: 687b906
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Jul 29 09:27:32 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jul 29 09:27:32 2016 +0200

----------------------------------------------------------------------
 components/camel-netty4/src/main/docs/netty4.adoc                | 4 +++-
 .../netty4/springboot/NettyComponentAutoConfiguration.java       | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7fc698cf/components/camel-netty4/src/main/docs/netty4.adoc
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/main/docs/netty4.adoc b/components/camel-netty4/src/main/docs/netty4.adoc
index 0c8d518..b6bb378 100644
--- a/components/camel-netty4/src/main/docs/netty4.adoc
+++ b/components/camel-netty4/src/main/docs/netty4.adoc
@@ -79,6 +79,7 @@ The Netty4 component supports 3 options which are listed below.
 
 
 
+
 // endpoint options: START
 The Netty4 component supports 73 endpoint options which are listed below:
 
@@ -102,7 +103,6 @@ The Netty4 component supports 73 endpoint options which are listed below:
 | backlog | consumer (advanced) |  | int | Allows to configure a backlog for netty consumer (server). Note the backlog is just a best effort depending on the OS. Setting this option to a value such as 200 500 or 1000 tells the TCP stack how long the accept queue can be If this option is not configured then the backlog depends on OS setting.
 | bossCount | consumer (advanced) | 1 | int | When netty works on nio mode it uses default bossCount parameter from Netty which is 1. User can use this operation to override the default bossCount from Netty
 | bossGroup | consumer (advanced) |  | EventLoopGroup | Set the BossGroup which could be used for handling the new connection of the server side across the NettyEndpoint
-| channelGroup | consumer (advanced) |  | ChannelGroup | To use a explicit ChannelGroup.
 | disconnectOnNoReply | consumer (advanced) | true | boolean | If sync is enabled then this option dictates NettyConsumer if it should disconnect where there is no reply to send back.
 | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
 | nettyServerBootstrapFactory | consumer (advanced) |  | NettyServerBootstrapFactory | To use a custom NettyServerBootstrapFactory
@@ -127,6 +127,7 @@ The Netty4 component supports 73 endpoint options which are listed below:
 | udpConnectionlessSending | producer (advanced) | false | boolean | This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port.
 | useByteBuf | producer (advanced) | false | boolean | If the useByteBuf is true netty producer will turn the message body into ByteBuf before sending it out.
 | bootstrapConfiguration | advanced |  | NettyServerBootstrapConfiguration | To use a custom configured NettyServerBootstrapConfiguration for configuring this endpoint.
+| channelGroup | advanced |  | ChannelGroup | To use a explicit ChannelGroup.
 | exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
 | nativeTransport | advanced | false | boolean | Whether to use native transport instead of NIO. Native transport takes advantage of the host operating system and is only supported on some platforms. You need to add the netty JAR for the host operating system you are using. See more details at: http://netty.io/wiki/native-transports.html
 | options | advanced |  | Map | Allows to configure additional netty options using option. as prefix. For example option.child.keepAlive=false to set the netty option child.keepAlive=false. See the Netty documentation for possible options that can be used.
@@ -168,6 +169,7 @@ The Netty4 component supports 73 endpoint options which are listed below:
 
 
 
+
 [[Netty4-RegistrybasedOptions]]
 Registry based Options
 ^^^^^^^^^^^^^^^^^^^^^^

http://git-wip-us.apache.org/repos/asf/camel/blob/7fc698cf/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentAutoConfiguration.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentAutoConfiguration.java
index 03aeb8d..0ad4bdb 100644
--- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentAutoConfiguration.java
+++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentAutoConfiguration.java
@@ -34,7 +34,7 @@ import org.springframework.context.annotation.Configuration;
 @EnableConfigurationProperties(NettyComponentConfiguration.class)
 public class NettyComponentAutoConfiguration {
 
-    @Bean(name = "netty4-component")
+    @Bean
     @ConditionalOnClass(CamelContext.class)
     @ConditionalOnMissingBean(NettyComponent.class)
     public NettyComponent configureNettyComponent(CamelContext camelContext,


[3/3] camel git commit: Fixed CS

Posted by ac...@apache.org.
Fixed CS


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a47cee59
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a47cee59
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a47cee59

Branch: refs/heads/master
Commit: a47cee597431b0ed700a4efd0666d61a8feae7cb
Parents: 7fc698c
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Jul 29 09:30:48 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jul 29 09:30:48 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/netty4/NettyProducer.java   | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a47cee59/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java
index ca4ea84..5099de4 100644
--- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java
+++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java
@@ -137,10 +137,9 @@ public class NettyProducer extends DefaultAsyncProducer {
         }
 
         // setup channel group
-        if(configuration.getChannelGroup() == null) {
+        if (configuration.getChannelGroup() == null) {
             allChannels = new DefaultChannelGroup("NettyProducer", ImmediateEventExecutor.INSTANCE);
-        }
-        else {
+        } else {
             allChannels = configuration.getChannelGroup();
         }