[jboss-jira] [JBoss JIRA] (WFLY-5913) Add ability to specify external context on JNDI lookup binding

Guillermo González de Agüero (JIRA) issues at jboss.org
Sun Dec 27 13:25:00 EST 2015


     [ https://issues.jboss.org/browse/WFLY-5913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillermo González de Agüero resolved WFLY-5913.
------------------------------------------------
    Resolution: Done


My fault. It's already possible to do a remote lookup by appending the path to the lookup of the remote context.

For reference porpuses, my configuration currently is:
{code:xml}
<subsystem xmlns="urn:jboss:domain:naming:2.0">
                <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:global/ExportedTopic" lookup="java:/global/mqserver/jms/topic/prueba"/>
                    <lookup name="java:global/ExportedFactory" lookup="java:/global/mqserver/jms/RemoteConnectionFactory"/>
                </bindings>
                <remote-naming/>
            </subsystem>
{code}

Maybe an explanation could be added to the docs.

> 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)



More information about the jboss-jira mailing list