Java Code Examples for com.rabbitmq.client.Address#parseAddresses()

The following examples show how to use com.rabbitmq.client.Address#parseAddresses() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AMQPObservableQueue.java    From conductor with Apache License 2.0 5 votes vote down vote up
private Address[] buildAddressesFromHosts() {
	// Read hosts from config
	final String hosts = config.getProperty(
			String.format(AMQPConstants.PROPERTY_KEY_TEMPLATE, AMQPConfigurations.PROPERTY_HOSTS),
			ConnectionFactory.DEFAULT_HOST);
	if (StringUtils.isEmpty(hosts)) {
		throw new IllegalArgumentException("Hosts are undefined");
	}
	return Address.parseAddresses(hosts);
}
 
Example 2
Source File: ConnectionOptions.java    From lyra with Apache License 2.0 2 votes vote down vote up
/**
 * 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;
}