ActiveMQ 集群可以在不同的传输协议上有代理 运行 吗?

Can ActiveMQ cluster have brokers running on different transport protocol?

我想知道是否可以有一个 Active MQ 的故障转移集群,其中代理 运行 使用不同的传输协议。 比如说,一个在 ssl:// 上是 运行,另一个在 tcp:// 上。 例子: 故障转移:(tcp://localhost:61616,ssl://localhost:61626).

如果是,那么工厂 class 的用途是什么? ActiveMQConnectionFactory 或 ActiveMQSslConnectionFactory

您可以在故障转移 URI 中混合基于 SSL 和非 SSL 的传输连接(要小心,因为 TCP 不安全)。在任何一种情况下,您通常都会使用 ActiveMQConnectionFactory,因为如果您出于某种原因需要在代码中控制密钥和信任存储配置,则只需要使用 ActiveMQSslConnectionFactory。 SSL 配置可以在 URI 上完成,因此如果您确实需要,可以将它们混合用于故障转移。

请参阅 ActiveMQSslConnectionFactory 的文档了解为什么您只在某些情况下需要它:

An ActiveMQConnectionFactory that allows access to the key and trust managers used for SslConnections. There is no reason to use this class unless SSL is being used AND the key and trust managers need to be specified from within code. In fact, if the URI passed to this class does not have an "ssl" scheme, this class will pass all work on to its superclass.