You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2015/05/13 09:07:40 UTC
[1/3] camel git commit: Clean up the code of netty component
Repository: camel
Updated Branches:
refs/heads/master 746e42634 -> 4e5cdfadc
Clean up the code of netty component
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4e5cdfad
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4e5cdfad
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4e5cdfad
Branch: refs/heads/master
Commit: 4e5cdfadcd526db147c4ccde93b6f35bf4b06cc9
Parents: a86f22b
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed May 13 14:54:58 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed May 13 15:06:51 2015 +0800
----------------------------------------------------------------------
.../main/java/org/apache/camel/component/netty/NettyComponent.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/4e5cdfad/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java
index e1be1c2..3613fa6 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java
@@ -36,7 +36,7 @@ public class NettyComponent extends UriEndpointComponent {
private Timer timer;
private NettyConfiguration configuration;
private int maximumPoolSize = 16;
- private OrderedMemoryAwareThreadPoolExecutor executorService;
+ private volatile OrderedMemoryAwareThreadPoolExecutor executorService;
public NettyComponent() {
super(NettyEndpoint.class);
[3/3] camel git commit: CAMEL-8770 Fixed the depends-on issue of
Camel Blueprint
Posted by ni...@apache.org.
CAMEL-8770 Fixed the depends-on issue of Camel Blueprint
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9facd03a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9facd03a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9facd03a
Branch: refs/heads/master
Commit: 9facd03a3a92697a1023047fef05e45b48672fbf
Parents: 746e426
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed May 13 14:37:38 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed May 13 15:06:51 2015 +0800
----------------------------------------------------------------------
.../apache/camel/blueprint/handler/CamelNamespaceHandler.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/9facd03a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
index 475c057..393004a 100644
--- a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
+++ b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
@@ -259,6 +259,10 @@ public class CamelNamespaceHandler implements NamespaceHandler {
factory2.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
factory2.addProperty("bundleContext", createRef(context, "blueprintBundleContext"));
factory2.addDependsOn(propertiesComponentResolver.getId());
+ // We need to add other components which the camel context dependsOn
+ if (ObjectHelper.isNotEmpty(ccfb.getDependsOn())) {
+ factory2.addDependsOn(ccfb.getDependsOn());
+ }
context.getComponentDefinitionRegistry().registerComponentDefinition(factory2);
MutableBeanMetadata ctx = context.createMetadata(MutableBeanMetadata.class);
[2/3] camel git commit: CAMEL-8771 Add MaxChannelMemorySize and
MaxTotalMemorySize for OrderedMemoryAwareThreadPoolExecutor
Posted by ni...@apache.org.
CAMEL-8771 Add MaxChannelMemorySize and MaxTotalMemorySize for OrderedMemoryAwareThreadPoolExecutor
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a86f22b6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a86f22b6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a86f22b6
Branch: refs/heads/master
Commit: a86f22b6ba400946f120f0c7c977bc39fbfa9e66
Parents: 9facd03
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed May 13 14:52:21 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed May 13 15:06:51 2015 +0800
----------------------------------------------------------------------
.../camel/component/netty/NettyComponent.java | 7 ++++++-
.../component/netty/NettyConfiguration.java | 20 ++++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/a86f22b6/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java
index ac622d0..e1be1c2 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyComponent.java
@@ -138,10 +138,15 @@ public class NettyComponent extends UriEndpointComponent {
// replies in the expected order. eg this is required by TCP.
// and use a Camel thread factory so we have consistent thread namings
// we should use a shared thread pool as recommended by Netty
+
+ // NOTE: if we don't specify the MaxChannelMemorySize and MaxTotalMemorySize, the thread pool
+ // could eat up all the heap memory when the tasks are added very fast
+
String pattern = getCamelContext().getExecutorServiceManager().getThreadNamePattern();
ThreadFactory factory = new CamelThreadFactory(pattern, "NettyOrderedWorker", true);
return new OrderedMemoryAwareThreadPoolExecutor(getMaximumPoolSize(),
- 0L, 0L, 30, TimeUnit.SECONDS, factory);
+ configuration.getMaxChannelMemorySize(), configuration.getMaxTotalMemorySize(),
+ 30, TimeUnit.SECONDS, factory);
}
@Override
http://git-wip-us.apache.org/repos/asf/camel/blob/a86f22b6/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
index 700fa0a..ca06845 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java
@@ -96,6 +96,10 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem
private boolean clientMode;
@UriParam
private boolean useChannelBuffer;
+ @UriParam(defaultValue = "" + 10 * 1024 * 1024L)
+ private long maxChannelMemorySize = 10 * 1024 * 1024L;
+ @UriParam(defaultValue = "" + 200 * 1024 * 1024L)
+ private long maxTotalMemorySize = 200 * 1024 * 1024L;
/**
* Returns a copy of this configuration
@@ -476,6 +480,22 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem
this.useChannelBuffer = useChannelBuffer;
}
+ public long getMaxChannelMemorySize() {
+ return maxChannelMemorySize;
+ }
+
+ public void setMaxChannelMemorySize(long maxChannelMemorySize) {
+ this.maxChannelMemorySize = maxChannelMemorySize;
+ }
+
+ public long getMaxTotalMemorySize() {
+ return maxTotalMemorySize;
+ }
+
+ public void setMaxTotalMemorySize(long maxTotalMemorySize) {
+ this.maxTotalMemorySize = maxTotalMemorySize;
+ }
+
private static <T> void addToHandlersList(List<T> configured, List<T> handlers, Class<T> handlerType) {
if (handlers != null) {
for (T handler : handlers) {