Bind object to multiple NameServices

327 Views Asked by At

I'm trying to bind my CORBA service to multiple NameServices. The code is as follows (simplified):

org.omg.CORBA.Object objRef = orb.string_to_object("corbaloc::127.0.0.1:1337,:127.0.0.1:1338/NameService");
NamingContextExt ctx = NamingContextExtHelper.narrow(objRef);
NameComponent path[] = { new NameComponent("toto", "") };
ctx.rebind(path, new MyObject());

VisiBroker 8.5 libraries accept the corbaloc URI, but the service is only bound to the 1337 port.

EDIT: I know that manually binding to multiple NameServices should work, but the corbaloc URI is supposed to do the job.

Any CORBA expert here?

Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

Multi-address corbaloc URIs don't behave the way you'd like them to, unfortunately. The extra addresses are just treated as backups in case of failure. The only one that will be "chosen" will be the first one in the list to respond. Here's some documentation that describes its behavior.

You'll have to manually bind your object reference into each Naming Service, unless your Naming Service implementation supports some kind of replication (I'm not sure if Visibroker's does).