You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by robina <ra...@fomltd.com> on 2016/10/27 11:57:09 UTC

Setting TTL on Netty4 multicast endpoint

Hi all,

I'm using Netty4 to broadcast UDP datagrams using an endpoint configured as
follows:

netty4:udp://239.192.2.25:2100?sync=false&amp;broadcast=true&amp;allowDefaultCodec=false&amp;networkInterface=eth3&amp

The problem I have is that the default TTL is 1, but I'm required to
broadcast to a number of subnets, so need to increase the TTL to a higher
value.  Does anyone know what option I should be setting?

From the camel documentation, it looks like I should be using the
'option.XXX' option, however I'm not sure what the option value should be. 
I've tried a few different combinations, e.g. option.IP_MULTICAST_TTL=5,
option.DatagramChannelConfig.IP_MULTICAST_TTL=5, option.timeToLive=5 etc.

Could anyone help out with the correct option?  And/or confirm if the
ability to change the TTL is supported in the netty4 component?

Thanks in advance,
Rob



--
View this message in context: http://camel.465427.n5.nabble.com/Setting-TTL-on-Netty4-multicast-endpoint-tp5789344.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Setting TTL on Netty4 multicast endpoint

Posted by Tomohisa Igarashi <tm...@gmail.com>.
Hi,

I think it should be "IP_MULTICAST_TTL"
https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/ChannelOption.java#L122

But note that the ChannelOptions are no longer string literal unlike netty3... hopefully something like following would work
if (configuration.getOptions() != null) {
     for (Map.Entry<String, Object> entry : configuration.getOptions().entrySet()) {
         clientBootstrap.option(ChannelOption.valueOf(entry.getKey()), entry.getValue());
     }
}

Thanks,
Tomo

On 10/28/2016 11:39 PM, robina wrote:
> Aha, many thanks Tomo.
>
> I'll raise the issue in JIRA.
>
> Following the update, do you know what I'd replace the 'XXX' with in the
> 'option.XXX' option to update the multicast TTL?
>
> Regards,
> Rob
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-TTL-on-Netty4-multicast-endpoint-tp5789344p5789404.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Setting TTL on Netty4 multicast endpoint

Posted by robina <ra...@fomltd.com>.
Aha, many thanks Tomo.

I'll raise the issue in JIRA. 

Following the update, do you know what I'd replace the 'XXX' with in the
'option.XXX' option to update the multicast TTL?

Regards,
Rob




--
View this message in context: http://camel.465427.n5.nabble.com/Setting-TTL-on-Netty4-multicast-endpoint-tp5789344p5789404.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Setting TTL on Netty4 multicast endpoint

Posted by Tomohisa Igarashi <tm...@gmail.com>.
Hi,

I just took a look at this one, it seems camel-netty4 doesn't yet implement option.XXX
https://github.com/apache/camel/blob/master/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java#L417-L424

Would you file a JIRA for it?

Thanks,
Tomo

On 10/27/2016 08:57 PM, robina wrote:
> Hi all,
>
> I'm using Netty4 to broadcast UDP datagrams using an endpoint configured as
> follows:
>
> netty4:udp://239.192.2.25:2100?sync=false&amp;broadcast=true&amp;allowDefaultCodec=false&amp;networkInterface=eth3&amp
>
> The problem I have is that the default TTL is 1, but I'm required to
> broadcast to a number of subnets, so need to increase the TTL to a higher
> value.  Does anyone know what option I should be setting?
>
> From the camel documentation, it looks like I should be using the
> 'option.XXX' option, however I'm not sure what the option value should be.
> I've tried a few different combinations, e.g. option.IP_MULTICAST_TTL=5,
> option.DatagramChannelConfig.IP_MULTICAST_TTL=5, option.timeToLive=5 etc.
>
> Could anyone help out with the correct option?  And/or confirm if the
> ability to change the TTL is supported in the netty4 component?
>
> Thanks in advance,
> Rob
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-TTL-on-Netty4-multicast-endpoint-tp5789344.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>