【发布时间】:2013-03-30 09:39:28
【问题描述】:
我们使用 HornetQ 核心 API 来从 HornetQClient 创建 ServerLocator。 ServerLocator 用于创建队列。 这是代码:
TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName());
ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(connectorConfig);
int ackBatchSize = ConfigWrapperHelper.getIntParameter(ProductMarkingConfigParamEnum.ACK_BATCH_SIZE_FOR_JMS_QUEUES);
locator.setAckBatchSize(ackBatchSize);
locator.setConsumerWindowSize(CONSUMER_WINDOW_SIZE);
locator.setClientFailureCheckPeriod(Long.MAX_VALUE);
locator.setConnectionTTL(-1);
ClientSessionFactory clientSessionFactory = locator.createSessionFactory(connectorConfig);
ClientSession clientSession = _clientSessionFactory.createSession(XA, AUTO_COMMIT_SENDS, AUTO_COMMIT_ACKS);
clientSession.createQueue(queueName, queueName, IS_DURABLE);
问题是我们需要为每个队列配置 max-size-bytes 和 te address-full-policy。
我知道如何通过 XML 中的
我看到有一个名为 AddressSettings 的类,可以在其中设置这些参数。
我的问题是 - 如何将此 AddressSettings 对象配置到 ServerLocator 中?
或者 - 是否有其他方法可以在从 HornetQCLient 创建的 ServerLocator 中配置这些参数?
【问题讨论】: