Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/com/rabbitmq/client/BuiltinExchangeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
*/
public enum BuiltinExchangeType {

DIRECT("direct"), FANOUT("fanout"), TOPIC("topic"), HEADERS("headers");
DIRECT("direct"), FANOUT("fanout"), TOPIC("topic"), HEADERS("headers"),
CONSISTENT_HASH("x-consistent-hash"), MODULUS_HASH("x-modulus-hash"),
LOCAL_RANDOM("x-local-random"), RANDOM("x-random");

private final String type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeoutException;

Expand Down Expand Up @@ -101,8 +103,13 @@ public void releaseResources() throws IOException {
}

private void doTestExchangeDeclaredWithEnumerationEquivalent(Channel channel) throws IOException, InterruptedException {
assertEquals(4, BuiltinExchangeType.values().length, "There are 4 standard exchange types");
for (BuiltinExchangeType exchangeType : BuiltinExchangeType.values()) {
// Only test AMQP 0-9-1 standard types; plugin and newer core types
// (e.g. x-modulus-hash, x-local-random) may not be available on the test broker
List<BuiltinExchangeType> standardTypes = Arrays.asList(
BuiltinExchangeType.DIRECT, BuiltinExchangeType.FANOUT,
BuiltinExchangeType.TOPIC, BuiltinExchangeType.HEADERS
);
for (BuiltinExchangeType exchangeType : standardTypes) {
channel.exchangeDeclare(NAME, exchangeType);
verifyEquivalent(NAME, exchangeType.getType(), false, false, null);
channel.exchangeDelete(NAME);
Expand Down