Perform Fault-Tolerant Lookups
TIBCO Enterprise Message Service can perform fault-tolerant JNDI lookups. If the active server fails and the standby server becomes active, the JNDI provider automatically uses the new active server for JNDI lookups. You accomplish this by providing multiple URLs in the
Context.PROVIDER_URL
property when creating the
InitialContext
. Specify more than one URL separated by commas (,) in the property.
Example
The following illustrates setting up the
Context.PROVIDER_URL
property with the URLs of a primary EMS server on the machine named
emshost
and a secondary EMS server on the machine named
backuphost
.
env.put(Context.PROVIDER_URL, "tibjmsnaming://jmshost:7222,tibjmsnaming://backuphost:7222");
Assuming
emshost
starts out as active, if at any time it fails the JNDI provider automatically switches to the EMS server on the host
backuphost
for JNDI lookups. If
emshost
is repaired and restarted, it then becomes the standby EMS server.
Limitations of Fault-Tolerant JNDI Lookups
Fault-tolerant JNDI lookups do not occur in scenarios:
- When using full URL names in argument to the lookup method.
- When looking up an object that has been bound into a foreign naming/directory service such as LDAP.