I have implemented from the docs a custom replication group filter. I wanted to do the first tests, but the filter doesn't get called with the context, only after the SessionManager created it's session. I'd like to select (pre-filter) the SessionManager from the Replica Group, to decide where to create the session.
I am referring to these sections from the docs:
var id = new Ice.InitializationData(); id.properties = Ice.createProperties(); id.properties.setProperty("Ice.Default.Router", getRouterProxyAddress(datacenter)); communicator = Ice.initialize(id); var implicitContext = communicator.getImplicitContext(); implicitContext.put("Region", region); return Glacier2.RouterPrx.checkedCast(communicator.getDefaultRouter());
So far so good. The Context is being parsed and sent along with the requests, after the session has been created. For selecting the appropriate SessionManager from the replica group, I need the RegistryPlugin to be called before, which does get called, except without the Context.
Glacier2 Ice Log:
I even tried to set the context on the router explicitly before creating the session.
routerContext = new Ice.Context(); routerContext.add("Region", region); var router = routerPrx.ice_context(routerContext); // create a session with the router var sessionPrx = router.createSession("username", "password");
This results in having my context to double up.
What's confusing is, that the replicated SessionManager does receive the context, for the create operation:
I'd like to pick the appropriate SessionManager based on the context before the adapter is selected from the replicate group. How can I achieve that?
Thanks in advance!