ActiveMQ 自带的JNDI实现

activeMQ的jndi配置居然是在客户端配置的,消息的生产者和消费者都需要配置jndi.properties, 配置绑定相同主题或队列,除非使用“Dynamically creating destinations”方式。




从网上搜到一个解释:


引用
2009/2/10 janylj <[hidden email]>:
>
> Hello,
>
> I tried ActiveMQ JNDI support. It seems to me only for testing, because the
> administrative objects are specified in the jndi.properties of client
> machine. There is no centralized place to manage the ConnectionFactory or
> Destination. And we could not control who could access them.
>
> Is my understanding correct or I miss something? Thank you very much.

You can use any JNDI provider you want. If you really want to store
the topic and queue objects in some remote JNDI server go right ahead,
noone is stopping you.

However the ActiveMQ JNDI provider is intended to avoid dependency on
some remote JNDI server and so by *design* it uses a local client side
configuration. This is perfectly fine for production use too

Another approach is using Spring to avoid depending on a remote,
distributed JNDI provider. But if you really wanna use a distributed
JNDI provider just pick one you want and put the ActiveMQ administered
objects (queues, topics and connection factories) in there. Pretty
much all J2EE containers come with some remote JNDI server
implementation.

--
James


http://activemq.apache.org/jndi-support.html
http://activemq.2283324.n4.nabble.com/ActiveMQ-JNDI-support-only-for-testing-td2363888.html

猜你喜欢

转载自zhoukai.iteye.com/blog/1328065