2222import org .apache .activemq .broker .BrokerService ;
2323import org .junit .jupiter .api .AfterAll ;
2424import org .junit .jupiter .api .BeforeAll ;
25- import org .junit .jupiter .api .Disabled ;
2625import org .junit .jupiter .api .Test ;
2726
2827import org .springframework .context .ApplicationEvent ;
4645import org .springframework .integration .stomp .inbound .StompInboundChannelAdapter ;
4746import org .springframework .integration .stomp .outbound .StompMessageHandler ;
4847import org .springframework .integration .support .converter .PassThruMessageConverter ;
48+ import org .springframework .integration .test .condition .LogLevels ;
4949import org .springframework .messaging .Message ;
5050import org .springframework .messaging .MessageChannel ;
5151import org .springframework .messaging .MessageDeliveryException ;
6363 *
6464 * @since 4.2
6565 */
66- @ Disabled ( "Until the fix in reactor- netty-core" )
66+ @ LogLevels ( level = "trace" , categories = { " reactor. netty.tcp" , "io.netty" } )
6767public class StompServerIntegrationTests {
6868
6969 private static BrokerService activeMQBroker ;
@@ -109,11 +109,12 @@ public void testStompAdapters() throws Exception {
109109 MessageChannel stompOutputChannel1 = context1 .getBean ("stompOutputChannel" , MessageChannel .class );
110110 MessageChannel stompOutputChannel2 = context2 .getBean ("stompOutputChannel" , MessageChannel .class );
111111
112+ int n = 0 ;
112113 Message <?> eventMessage ;
113114 do {
114115 eventMessage = stompEvents1 .receive (10000 );
115116 }
116- while (eventMessage != null && !(eventMessage .getPayload () instanceof StompSessionConnectedEvent ));
117+ while (eventMessage != null && !(eventMessage .getPayload () instanceof StompSessionConnectedEvent ) && n ++ < 100 );
117118
118119 assertThat (eventMessage ).isNotNull ();
119120
@@ -193,11 +194,12 @@ public void testStompAdapters() throws Exception {
193194
194195 activeMQBroker .stop ();
195196
197+ n = 0 ;
196198 do {
197199 eventMessage = stompEvents1 .receive (10000 );
198200 assertThat (eventMessage ).isNotNull ();
199201 }
200- while (!(eventMessage .getPayload () instanceof StompConnectionFailedEvent ));
202+ while (!(eventMessage .getPayload () instanceof StompConnectionFailedEvent ) && n ++ < 100 );
201203
202204
203205 assertThatExceptionOfType (MessageDeliveryException .class )
@@ -206,11 +208,12 @@ public void testStompAdapters() throws Exception {
206208
207209 activeMQBroker .start (false );
208210
211+ n = 0 ;
209212 do {
210213 eventMessage = stompEvents1 .receive (20000 );
211214 assertThat (eventMessage ).isNotNull ();
212215 }
213- while (!(eventMessage .getPayload () instanceof StompReceiptEvent ));
216+ while (!(eventMessage .getPayload () instanceof StompReceiptEvent ) && n ++ < 100 );
214217
215218 do {
216219 eventMessage = stompEvents2 .receive (10000 );
0 commit comments