File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
test/src/com/rabbitmq/client/test/server Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ protected void restart() throws IOException {
4646
4747 Host .executeCommand ("cd ../rabbitmq-test; make restart-secondary-node" );
4848 }
49+ restartPrimary ();
50+ }
51+
52+ private void restartPrimary () throws IOException {
4953 tearDown ();
5054 Host .executeCommand ("cd ../rabbitmq-test; make restart-app" );
5155 setUp ();
@@ -129,5 +133,24 @@ public void testDefaultBindingRecovery() throws IOException {
129133 deleteQueue (Q );
130134 }
131135
136+ /**
137+ * Test that when we have a transient exchange bound to a durable queue and the
138+ * durable queue is on a cluster node that restarts, we do not lose the binding.
139+ * See bug 24009.
140+ */
141+ public void testTransientExchangeDurableQueue () throws IOException {
142+ // This test depends on the second node in the cluster to keep the transient X alive
143+ if (clusteredChannel != null ) {
144+ channel .exchangeDeclare ("transientX" , "fanout" , false );
145+ declareAndBindDurableQueue ("durableQ" , "transientX" , "" );
146+
147+ restartPrimary ();
148+
149+ basicPublishVolatile ("transientX" , "" );
150+ assertDelivered ("durableQ" , 1 );
132151
152+ deleteExchange ("transientX" );
153+ deleteQueue ("durableQ" );
154+ }
155+ }
133156}
You can’t perform that action at this time.
0 commit comments