我们使用HornetQ核心API来从HornetQClient创建ServerLocator。 ServerLocator用于创建队列。 下面的代码:在HornetQClient中设置max-size-bytes和address-full-policy
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);
的问题是,我们需要配置的最大尺寸字节和Te地址全政策,为每个队列。
我知道如何通过在XML中做到这一点,但由于我使用hornetq核心来配置队列,这些参数也需要通过代码进行配置。
我看到有一个叫AddressSettings类,这些参数可以设置
我的问题是 - 如何配置此AddressSettings对象到ServerLocator?
或者 - 在从HornetQCLient创建的ServerLocator中配置这些参数还有另一种方法吗?
我知道,因为我使用Horn etQCLient,我不能使用AddressSettings。但目前我没有使用任何XML来配置HornetQClient。我怎样才能添加这样的XML?这个XML应该放在哪里? – 2013-04-08 12:59:41
(有帖子用你问我的信息编辑了答案) – 2013-04-08 14:27:02