Search in sources :

Example 1 with SimpleChannelProvider

use of io.paradoxical.rabbitmq.connectionManagment.SimpleChannelProvider in project microservices by pwillhan.

the class RabbitMqMiddlewareModule method channelProvider.

@LazySingleton
@Provides
public ChannelProvider channelProvider(final ServiceConfiguration configuration) throws URISyntaxException, IOException, NoSuchAlgorithmException, KeyManagementException {
    final RabbitMqConfiguration rabbitMqConfiguration = configuration.getRabbitMqConfiguration();
    final Host host = new Host(rabbitMqConfiguration.getRmqUri());
    return new SimpleChannelProvider(rabbitMqConfiguration.getUsername(), rabbitMqConfiguration.getPassword(), rabbitMqConfiguration.getVhost(), new Address[] { new Address(host.getUri().getHost()) });
}
Also used : Address(com.rabbitmq.client.Address) RabbitMqConfiguration(com.godaddy.pubsub.configurations.RabbitMqConfiguration) SimpleChannelProvider(io.paradoxical.rabbitmq.connectionManagment.SimpleChannelProvider) Host(io.paradoxical.rabbitmq.connectionManagment.Host) LazySingleton(com.netflix.governator.guice.lazy.LazySingleton) Provides(com.google.inject.Provides)

Aggregations

RabbitMqConfiguration (com.godaddy.pubsub.configurations.RabbitMqConfiguration)1 Provides (com.google.inject.Provides)1 LazySingleton (com.netflix.governator.guice.lazy.LazySingleton)1 Address (com.rabbitmq.client.Address)1 Host (io.paradoxical.rabbitmq.connectionManagment.Host)1 SimpleChannelProvider (io.paradoxical.rabbitmq.connectionManagment.SimpleChannelProvider)1