Skip to content

Commit 4d8f839

Browse files
author
Matthias Radestock
committed
add test for topic routing
in particular for the conditions that trigger bug20046
1 parent f50e4d8 commit 4d8f839

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/src/com/rabbitmq/client/test/functional/Routing.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,26 @@ public void testFanoutRouting() throws Exception {
144144
}
145145
}
146146

147+
public void testTopicRouting() throws Exception {
148+
149+
List<String> queues = new ArrayList<String>();
150+
151+
//100+ queues is the trigger point for bug20046
152+
for (int i = 0; i < 100; i++) {
153+
channel.queueDeclare();
154+
AMQP.Queue.DeclareOk ok = channel.queueDeclare();
155+
String q = ok.getQueue();
156+
channel.queueBind(q, "amq.topic", "#");
157+
queues.add(q);
158+
}
159+
160+
channel.basicPublish("amq.topic", "", null, "topic".getBytes());
161+
162+
for (String q : queues) {
163+
checkGet(q, true);
164+
}
165+
}
166+
147167
public void testUnbind() throws Exception {
148168
AMQP.Queue.DeclareOk ok = channel.queueDeclare();
149169
String queue = ok.getQueue();

0 commit comments

Comments
 (0)