com.github.fridujo.rabbitmq.mock.exchange.MockExchangeFactory 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.exchange;
import com.github.fridujo.rabbitmq.mock.AmqArguments;
import com.github.fridujo.rabbitmq.mock.ReceiverRegistry;
public abstract class MockExchangeFactory {
public static BindableMockExchange build(String exchangeName, String type, AmqArguments arguments, ReceiverRegistry receiverRegistry) {
if ("topic".equals(type)) {
return new MockTopicExchange(exchangeName, arguments, receiverRegistry);
} else if ("direct".equals(type)) {
return new MockDirectExchange(exchangeName, arguments, receiverRegistry);
} else if ("fanout".equals(type)) {
return new MockFanoutExchange(exchangeName, arguments, receiverRegistry);
} else if ("headers".equals(type)) {
return new MockHeadersExchange(exchangeName, arguments, receiverRegistry);
}
throw new IllegalArgumentException("No exchange type " + type);
}
}