camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Burgazzoli (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-7054) CamelNetty - No way to get ChannelGroup
Date Tue, 12 Jan 2016 16:16:39 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-7054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15094131#comment-15094131
] 

Luca Burgazzoli edited comment on CAMEL-7054 at 1/12/16 4:16 PM:
-----------------------------------------------------------------

I had a look at this issue and it may not be the best option to change the interface of  NettyServerBootstrapFactory
as:
- for some concrete implementations returning true/false on add/removeChannel does not make
sense  
- some concrete implementations do not have a ChannelGroup

As a possible solution we could add the option to set the ChannelGroup in NettyServerBootstrapConfiguration
so people could use their own ChannelGroup.

An implementation is available here https://github.com/lburgazzoli/apache-camel/tree/CAMEL-7054,
if you agree on the comment I'll send a PR



was (Author: lb):
I had a look at this issue and it may not be the best option to change the interface of  NettyServerBootstrapFactory
as:
- for some concrete implementations returning true/false on add/removeChannel does not make
sense  
- some concrete implementations do not have a ChannelGroup

As a possible solution we could add the option to set the ChannelGroup in NettyServerBootstrapConfiguration
so people could use their own ChannelGroup.

> CamelNetty - No way to get ChannelGroup
> ---------------------------------------
>
>                 Key: CAMEL-7054
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7054
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-netty4
>    Affects Versions: 2.12.0, 2.12.1, 2.12.2
>            Reporter: Matthew McMahon
>            Priority: Trivial
>             Fix For: Future
>
>
> My use case is that I need to create a custom ServerPipelineFactory, and also require
access to the ChannelGroup so that I can know when a new channel is being added and when it
is removed. 
> I also sometimes use the channelGroup to send a message to all clients. 
> In 2.11.1 it was easy to get access to the ChannelGroup through the NettyConsumer. 
> However with the 2.12.0 restructure this has been hidden behind the NettyServerBootstrapFactory
interface. 
> To get around it for now, I looked at implementing my own NettyServerBootstrapFactory
class, but I could not work out how to do that and also use a custom ServerPipelineFactory.
Therefore the solution I came up with for now is Reflection!
> Basically, I am wondering is it possible to modify the NettyServerBootstrapFactory interface
so that the addChannel and removeChannel methods return the boolean from the channelGroup
calls. And either provide a getter for the channelGroup, or add a writeAllChannels (bulk write)
method interface that does the write method on the channelGroup? 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message