[
https://issues.jboss.org/browse/WFLY-5913?page=com.atlassian.jira.plugin....
]
Guillermo González de Agüero updated WFLY-5913:
-----------------------------------------------
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:
{code:xml}
<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>
{code}
was:
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:
{code:xml}
<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>
{code}
Add ability to specify external context on JNDI lookup binding
--------------------------------------------------------------
Key: WFLY-5913
URL:
https://issues.jboss.org/browse/WFLY-5913
Project: WildFly
Issue Type: Feature Request
Components: Naming
Affects Versions: 10.0.0.CR5
Reporter: Guillermo González de Agüero
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:
{code:xml}
<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>
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)