Found it from source code, the example for netty4 should be following:

<!-- use the worker pool builder to create to help create the shared thread pool --> <bean id="poolBuilder" class="org.apache.camel.component.netty4.NettyWorkerPoolBuilder">
  <property name="workerCount" value="2"/>
</bean>

<!-- the shared worker event group -->
<bean id="sharedPool" class="io.netty.channel.EventLoopGroup"
factory-bean="poolBuilder" factory-method="build" destroy-method="destroy">
</bean>

Then in the Camel routes we can refer to this worker pools by configuring the workerGroup option in the URI as shown below:
<route>
  <from uri="direct:postData>
<to uri="netty4:tcp://localhost:5021?textline=true&sync=true&workerGroup=#sharedPool"/>
  <to uri="log:result"/>
  ...
</route>

Thanks,
Avnish Pundir

On 07-11-2016 14:44, Avnish Pundir wrote:
Hi Willem,
I just tried sharing the workerpool as per docs of netty4
(http://camel.apache.org/netty4.html) however the class mentioned in
example (org.jboss.netty.channel.socket.nio.WorkerPool) for sharing of
worker pools doesn't exist in netty4. I have camel-netty4 as a
dependency in maven and "netty-all(4.0.34.FINAL)" is present on my
project classpath as a transitive dependency. The mentioned class exists
in netty3 as far as I can tell from googling around.

Looks to me docs for netty4 are still pointing to camel-netty
documentation for example section at least, as the example mention "boss
and worker thread pools" whereas the options mention bossGroup and
workerGroup (not pools). You did mentioned that you have updated wiki
doc, if it's relevant can you please share updated doc link or point me
in right direction for sharing workerGroup with netty4?

Thanks,
Avnish Pundir


On 03-11-2016 15:14, Willem Jiang wrote:
Hi,

I just checked the code of camel-netty4, the workerGroup can be share
between the consumers and producers if the option is specified
otherwise camel creates a new workerGroup per consumer or producer.
The wiki doc is updated, I will commit a quick fix to the camel netty
component.

--
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem



On November 3, 2016 at 12:55:34 PM, Pundir Avnish
(avnish.pun...@tekmindz.com) wrote:
Hi Everyone,
I am trying to use netty4-http (in producer mode) to connect to remote
services. Apparently in my use case there are number of different remote
services (more than 30 in total) I have to talk to. To keep the threads
management under direct control, I was hoping to use same thread pool
for all these endpoints. At a glance it looked like sharing workerGroup
will do the trick. However from the documentation it feels like this
option is for consumer (at least from the examples in
http://camel.apache.org/netty4.html) whereas for producer we should be
using producerPool* properties. I need guidance on following from the
community experts -
1. Is the above understanding correct, i.e. workerGroup can be used ONLY
with consumer? If not what impact will it have if used with producer and
more importantly how does it impact/influence producerPool.
2. Is it possible to use single executor across all my netty4-http
producers? I don't see usual option of setting executorServiceRef option
with either netty4 or nett4-http.


--
Thanks,
*Avnish Pundir*


--



--

------------------------------
Disclaimer: The information contained in this communication is confidential, private, proprietary, or otherwise privileged and is intended only for the use of the addressee.Unauthorized use, disclosure, distribution or copying is strictly prohibited and may be unlawful. If you have received this communication in error, please delete this message and notify the sender immediately - Samin TekMindz India Pvt.Ltd. ------------------------------

Reply via email to