public class ConnectionFactory extends ConnectionConfiguration
ConnectionFactory.
Registers a health check, manages the rabbitmq connection, and adds metrics.
Note that automaticRecoveryEnabled and topologyRecoveryEnabled are not exposed because they are assumed to be true.| Constructor and Description |
|---|
ConnectionFactory() |
| Modifier and Type | Method and Description |
|---|---|
com.rabbitmq.client.Connection |
build(io.dropwizard.setup.Environment env,
ExecutorService deliveryExecutor,
String name)
Synchronously connect to rabbitmq, will cause application to fail if initial connection is unsuccessful.
|
void |
buildRetryInitialConnect(io.dropwizard.setup.Environment env,
ExecutorService deliveryExecutor,
String name,
ConnectedCallback callback)
Asynchronously connect to rabbitmq, and retry until successful
|
ConnectionFactory |
customeMetrics(ConnectionMetrics metrics) |
getClientProperties, getConnectionTimeout, getHandshakeTimeout, getHost, getNetworkRecoveryInterval, getPassword, getPort, getRequestedChannelMax, getRequestedFrameMax, getRequestedHeartbeat, getShutdownTimeout, getUsername, getVirtualHost, makeConnectionFactory, setClientProperties, setConnectionTimeout, setHandshakeTimeout, setHost, setNetworkRecoveryInterval, setPassword, setPort, setRequestedChannelMax, setRequestedFrameMax, setRequestedHeartbeat, setShutdownTimeout, setUsername, setVirtualHostpublic ConnectionFactory customeMetrics(ConnectionMetrics metrics)
public com.rabbitmq.client.Connection build(io.dropwizard.setup.Environment env,
ExecutorService deliveryExecutor,
String name)
throws Exception
env - dropwizard environmentdeliveryExecutor - executorname - name of rabbitmq connectionExceptionpublic void buildRetryInitialConnect(io.dropwizard.setup.Environment env,
ExecutorService deliveryExecutor,
String name,
ConnectedCallback callback)
throws Exception
env - dropwizard environmentdeliveryExecutor - the executor used by rabbitmq client to deliver messagesname - name of rabbitmq connectioncallback - callback when done - which may be after application startExceptionCopyright © 2016. All rights reserved.