当前位置: 首页>>代码示例>>Java>>正文


Java Address.parseAddresses方法代码示例

本文整理汇总了Java中com.rabbitmq.client.Address.parseAddresses方法的典型用法代码示例。如果您正苦于以下问题:Java Address.parseAddresses方法的具体用法?Java Address.parseAddresses怎么用?Java Address.parseAddresses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.rabbitmq.client.Address的用法示例。


在下文中一共展示了Address.parseAddresses方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepare

import com.rabbitmq.client.Address; //导入方法依赖的package包/类
public synchronized void prepare() throws IOException, TimeoutException {
    if (rabbitMqChannelPool == null || rabbitMqChannelPool.isClosed()) {
        LOGGER.info("Creating RabbitMQ channel pool...");
        ConnectionFactory rabbitMqConnectionFactory = createConnectionFactory();
        if (rabbitMqConfig.hasAddresses()) {
            Address[] addresses = Address.parseAddresses(rabbitMqConfig.getAddresses());
            this.rabbitMqChannelFactory = new RabbitMqChannelFactory(rabbitMqConnectionFactory, addresses);
        } else {
            this.rabbitMqChannelFactory = new RabbitMqChannelFactory(rabbitMqConnectionFactory);
        }
        this.rabbitMqChannelPool = createRabbitMqChannelPool(rabbitMqChannelFactory);
        LOGGER.info("RabbitMQ channel pool was created");
    }
}
 
开发者ID:anderelate,项目名称:storm-rabbitmq,代码行数:15,代码来源:RabbitMqChannelProvider.java

示例2: setAddresses

import com.rabbitmq.client.Address; //导入方法依赖的package包/类
/**
 * If this option is set, camel-rabbitmq will try to create connection based on the setting of option addresses.
 * The addresses value is a string which looks like "server1:12345, server2:12345"
 */
public void setAddresses(String addresses) {
    Address[] addressArray = Address.parseAddresses(addresses);
    if (addressArray.length > 0) {
        this.addresses = addressArray;
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:RabbitMQEndpoint.java

示例3: withAddresses

import com.rabbitmq.client.Address; //导入方法依赖的package包/类
/**
 * Sets the {@code addresses}.
 * 
 * @param addresses formatted as "host1[:port],host2[:port]", etc.
 * @throws NullPointerException if {@code addresses} is null
 */
public ConnectionOptions withAddresses(String addresses) {
  this.addresses = Address.parseAddresses(Assert.notNull(addresses, "addresses"));
  return this;
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:11,代码来源:ConnectionOptions.java


注:本文中的com.rabbitmq.client.Address.parseAddresses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。