Details
-
Feature Request
-
Resolution: Done
-
Major
-
10.0.0.CR5
-
None
Description
The Naming subsystem allows to create alias to JNDI lookups on the local context, and also allows to bind an external context to an entry. However, it isn't possible to bind a lookup to an external context.
My personal use case is that I have an exported JMS Topic on a Remote WildFly. I'd like to be able to use it from my application like if it where local.
For now, I've created an Object Factory that lookups the external context and then lookups the topic.
An attribute indicating the context could be added. If none specified, local context should be used. Something like this:
<bindings> <external-context name="java:/global/mqserver" module="org.jboss.as.naming" class="javax.naming.InitialContext" cache="true"> <environment> <property name="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/> <property name="java.naming.provider.url" value="http-remoting://localhost:8290"/> <property name="java.naming.security.principal" value="remote"/> <property name="java.naming.security.credentials" value="remote"/> </environment> </external-context> <lookup name="java:/jms/topic/ImportedTopic" lookup="java:/jms/topic/MyTopic" externalContext="java:/global/mqserver"/> </bindings>