-
Bug
-
Resolution: Done
-
Major
-
3.6.13, 4.0.1
-
None
WildFly 11 recently started using the new JChannel(Protocol...) constructor for creating channels. This has resulted in the inability to configure certain protocol properties, most notably, initial_hosts for TCPPING.
Because this constructor calls resolveAndAssignFields(...) with an empty map, if a property was explicitly set, and its associated system property does not exist, and that property uses a non-default converter, then it will have its value undefined (or, more specifically, set to whatever the converter does with a null value).
Additionally, if the assocated system property did exist, it would take precedence over an explicitly set value. I don't think that's a good idea.
Consider the following:
TCP transport = new TCP(); transport.setBindAddress(InetAddress.getLocalHost()); transport.setBindPort(9600); TCPPING ping = new TCPPING(); ping.setInitialHosts(Collections.singletonList(new IpAddress(transport.getBindAddress(), transport.getBindPort()))); JChannel channel = new JChannel(transport, ping); assert !ping.getInitialHosts().isEmpty() : "No initial hosts!";
Side note: new JChannel(Collection<Protocol>) should really be new JChannel(List<Protocol>), since the collection should be ordered.
- causes
-
WFLY-8652 TCPPING initial_hosts not configurable
- Closed