com.github.fridujo.rabbitmq.mock.MockConnectionFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rabbitmq-mock Show documentation
Show all versions of rabbitmq-mock Show documentation
Mock for RabbitMQ Java amqp-client
package com.github.fridujo.rabbitmq.mock;
import com.github.fridujo.rabbitmq.mock.metrics.MetricsCollectorWrapper;
import com.rabbitmq.client.AddressResolver;
import com.rabbitmq.client.ConnectionFactory;
import java.util.concurrent.ExecutorService;
public class MockConnectionFactory extends ConfigurableConnectionFactory {
public MockConnectionFactory() {
setAutomaticRecoveryEnabled(false);
}
@Override
public MockConnection newConnection(ExecutorService executor, AddressResolver addressResolver, String clientProvidedName) {
return newConnection();
}
public MockConnection newConnection() {
MetricsCollectorWrapper metricsCollectorWrapper = MetricsCollectorWrapper.Builder.build(this);
MockConnection mockConnection = new MockConnection(mockNode, metricsCollectorWrapper);
return mockConnection;
}
}