mogronalol
mogronalol

Reputation: 3015

Binding objects to apache mq jndi provider

I have found numerous examples on the internet, in which I can use spring with JNDI to setup apache mq:

<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <prop key="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</prop>
            <prop key="java.naming.provider.url">tcp://localhost:61616</prop>
            <prop key="java.naming.security.principle">system</prop>
            <prop key="java.naming.security.credentials">credentials</prop>
        </props>
    </property>
</bean>

<bean id="jndiQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="jndiTemplate"/>
    <property name="jndiName" value="ConnectionFactory"/>
</bean>

What I can't find out, is where the objects are being bound to the JNDI provider. In the above example I don't understand where ConnectionFactory is coming from? It appears to exist in the context, but is there a configuration file I am supposed to be editing in order to determine which java objects are included / made part of it?

Upvotes: 0

Views: 735

Answers (1)

judomu
judomu

Reputation: 538

You're requesting the jndi-objects from the foreign jndi-provider activemq. So a jndi-lookup on the object ConnectionFactory will be resolved through activemq.

Upvotes: 1

Related Questions