Bug 61128

Summary: Allow cluster manager mapSendOptions to be specified with verbose, human-readable names
Product: Tomcat 9 Reporter: Christopher Schultz <chris>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: enhancement CC: dev
Priority: P2    
Version: unspecified   
Target Milestone: -----   
Hardware: All   
OS: All   

Description Christopher Schultz 2017-05-26 20:49:54 UTC
Cluster managers support "mapSendOptions" which is specified as an integer value, bitwise-ORd from the individual bits which make-up the various options.

The default value is 8 for the DeltaManager which means "asynchronous".

It would be nice if the configuration could use human-readable options like "async" instead of "8".

These are the channel send options available:


They could be specified as human-readable strings e.g. mapSendOptions="async,multicast" instead of mapSendOptions="72" which would make the configuration much easier to both read and write.

For backward compatibility, the integer values should also be acceptable.

This bug is nearly the same as bug #61127, but on a different component.
Comment 1 Igal Sapir 2017-05-28 22:36:05 UTC
Please see https://github.com/apache/tomcat/pull/56 as a WIP.

Especially given the fact that this is my first PR I would need more feedback.
Comment 2 Igal Sapir 2017-05-29 22:08:21 UTC

https://github.com/apache/tomcat/pull/56/files should take care of #61127, but where do you set "mapSendOptions"?

I see `public void setMapSendOptions(int mapSendOptions)` in 3 classes:

* BackupManager
* ClusterSingleSignOn  
* ReplicatedContext

The "fix" should be to add another method that takes a String input, as follows:

    public void setMapSendOptions(String mapSendOptions) {

        int value = Channel.parseChannelSendOptions(mapSendOptions);
        if (value > 0)

But... Do all 3 of them use that?  TBH I'm not sure and I've never set up a Cluster in Tomcat so I don't know if I should add those or not.  For example, are those used in config elements like "Cluster" in server.xml?  I can't find anything about that.
Comment 3 Christopher Schultz 2017-06-21 19:39:54 UTC

*** This bug has been marked as a duplicate of bug 61127 ***