ActiveMQ 自带的JNDI实现

本文深入探讨了ActiveMQ中JNDI配置的原理与实践,包括客户端配置、主题或队列的绑定方式及使用场景。特别强调了ActiveMQ JNDI提供者的本地客户端配置设计,以及如何通过Spring等工具避免远程JNDI依赖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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


从网上搜到一个解释:


[quote]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 [/quote]

[url]http://activemq.apache.org/jndi-support.html[/url]
[url]http://activemq.2283324.n4.nabble.com/ActiveMQ-JNDI-support-only-for-testing-td2363888.html[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值