azure-sdk-for-java: [BUG] azure-messaging-servicebus:7.15.1 - Application not consume any message from Azure Service Bus after logs "The connection was closed by container because it did not have any active links in the past 300000 milliseconds" printed on AKS

Describe the bug The application working well with Spring, Tomcat, and azure-messaging-servicebus:7.10.1. While migrate from 7.10.1 to 7.15.1, application working well on local (macbook) but not working well on Azure Kubernetes Service. The Connection closed by container as ServiceBusReceiveLinkProcessor not detected action links during 300000 milliseconds.

Exception or Stack Trace 2024/08/05 20:40:07.477 [reactor-executor-14] WARN c.a.c.a.i.RequestResponseChannel - {“az.sdk.message”:“Error in SendLinkHandler. Disposing unconfirmed sends.”,“exception”:“The connection was closed by container ‘xxx_G18’ because it did not have any active links in the past 300000 milliseconds. TrackingId:xxx_G18, SystemTracker:gateway5, Timestamp:2024-08-05T20:40:07, errorContext[NAMESPACE: <name-space>.servicebus.windows.net. ERROR CONTEXT: N/A, PATH: $cbs, REFERENCE_ID: cbs:sender, LINK_CREDIT: 99]”,“connectionId”:“yyy”,“linkName”:“cbs”}

2024/08/05 20:40:16.567 [receiverPump-4] WARN c.a.c.a.implementation.MessageFlux - {“az.sdk.message”:“Receiver emitted terminal error.”,“exception”:“The link ‘G13:122632033:<subscription_name>/subscriptions/zzz’ is force detached. Code: consumer(link70350). Details: AmqpMessageConsumer.IdleTimerExpired: Idle timeout: 00:10:00. TrackingId:xxx_G13_B18, SystemTracker:gi::G13:122632033:<subcription_name>/subscriptions/zzzz, bi::in-connection772(G13-3498347)::session773::link70350, Timestamp:2024-08-05T20:40:16, errorContext[NAMESPACE: <namespace>.servicebus.windows.net. ERROR CONTEXT: N/A, PATH: <subscription_name>/subscriptions/yyy, REFERENCE_ID: <subcription_name>/subscriptions/yyy, LINK_CREDIT: 0]”,“messageFlux”:“mf_8ddb3a_1722886936377”,“connectionId”:“MF_636c89_1722886936378”,“linkName”:“<subcription_name>/subscriptions/<topic_name>_ea7fa2_1722886936377”,“entityPath”:“<subcription_name>/subscriptions/<topic_name>”} 2024/08/05 20:40:16.568 [receiverPump-4] WARN c.a.c.a.implementation.MessageFlux - {“az.sdk.message”:“Current mediator reached terminal error-state (retriable:true).”,“exception”:“The link ‘G13:122632033:<subcription_name>/subscriptions/<topic_name>_ea7fa2_1722886936377’ is force detached. Code: consumer(link70350). Details: AmqpMessageConsumer.IdleTimerExpired: Idle timeout: 00:10:00. TrackingId:f70403d60017141c000112ce66b12b1a_G13_B18, SystemTracker:gi::G13:122632033:<subcription_name>/subscriptions/<topic_name>_ea7fa2_1722886936377, bi::in-connection772(G13-3498347)::session773::link70350, Timestamp:2024-08-05T20:40:16, errorContext[NAMESPACE: <name_space>.servicebus.windows.net. ERROR CONTEXT: N/A, PATH: <subcription_name>/subscriptions/<topic_name>, REFERENCE_ID: <subcription_name>/subscriptions/<topic_name>_ea7fa2_1722886936377, LINK_CREDIT: 0]”,“messageFlux”:“mf_8ddb3a_1722886936377”,“connectionId”:“MF_636c89_1722886936378”,“linkName”:“<subcription_name>/subscriptions/<topic_name>_ea7fa2_1722886936377”,“entityPath”:“<subcription_name>/subscriptions/<topic_name>”,“attempt”:1,“retryAfter”:4511} 2024/08/05 20:40:21.083 [parallel-4] WARN c.a.c.a.implementation.MessageFlux - {“az.sdk.message”:“Requesting a new mediator.”,“messageFlux”:“mf_8ddb3a_1722886936377”,“connectionId”:“MF_636c89_1722886936378”,“linkName”:“<subcription_name>/subscriptions/<topic_name>_ea7fa2_1722886936377”,“entityPath”:“<subcription_name>/subscriptions/<topic_name>”} 2024/08/05 20:40:21.125 [reactor-executor-7] WARN c.a.c.a.implementation.MessageFlux - {“az.sdk.message”:“Setting next mediator and waiting for activation.”,“messageFlux”:“mf_8ddb3a_1722886936377”,“connectionId”:“MF_636c89_1722886936378”,“linkName”:“<subcription_name>/subscriptions/<topic_name>_ea7fa2_1722886936377”,“entityPath”:“<subcription_name>/subscriptions/<topic_name>”} 2024/08/05 20:40:21.164 [receiverPump-13] WARN c.a.c.a.implementation.MessageFlux - {“az.sdk.message”:“The mediator is active.”,“messageFlux”:“mf_8ddb3a_1722886936377”,“connectionId”:“MF_636c89_1722886936378”,“linkName”:“<subcription_name>/subscriptions/<topic_name>_ea7fa2_1722886936377”,“entityPath”:“<subcription_name>/subscriptions/<topic_name>”}

2024/08/05 20:41:01.390 [receiverPump-7] WARN c.a.c.a.implementation.MessageFlux - {“az.sdk.message”:“Receiver emitted terminal error.”,“exception”:“The link ‘G20:60205512:<subcription_name>/subscriptions/delete_d4fbe7_1722886935378’ is force detached. Code: consumer(link70356). Details: AmqpMessageConsumer.IdleTimerExpired: Idle timeout: 00:10:00. TrackingId:f70403d60005141c000112d466b12b1a_G20_B18, SystemTracker:gi::G20:60205512:<subcription_name>/subscriptions/delete_d4fbe7_1722886935378, bi::in-connection6011(G20-195874)::session6012::link70356, Timestamp:2024-08-05T20:41:01, errorContext[NAMESPACE: <name_space>.servicebus.windows.net. ERROR CONTEXT: N/A, PATH: <subcription_name>/subscriptions/delete, REFERENCE_ID: <subcription_name>/subscriptions/delete_d4fbe7_1722886935378, LINK_CREDIT: 0]”,“messageFlux”:“mf_72cff5_1722886935378”,“connectionId”:“MF_60b1a3_1722886935379”,“linkName”:“<subcription_name>/subscriptions/delete_d4fbe7_1722886935378”,“entityPath”:“<subcription_name>/subscriptions/delete”}

To Reproduce Steps to reproduce the behavior: Step 1: Setup a application with Spring WebFlux (Spring 5) running on tomcat Step 2: Setup a AKS environment to deploy the service to 3 regions (EUS, SCUS, WUS). min is 4, and max is 10 pods. Step 3: Create a 10 subscriptions, each subscription have 10 topic to subscribe message, min delivery count is 3, and max delivery count is 10

Code Snippet

			ConnectionStringProperties properties = new ConnectionStringProperties(connectionString);

			this.subscriptionClient = new ServiceBusClientBuilder()
					.connectionString(connectionString)
					.processor()
					.topicName("ABC")
					.subscriptionName("DEF")
					.processMessage(this::processMessage)
					.processError(this::processError)
					.receiveMode(ServiceBusReceiveMode.PEEK_LOCK)
					.maxAutoLockRenewDuration(Duration.ofMinutes(config.getMaxAutoRenewDuration()))
					.maxConcurrentCalls(config.getMaxConcurrentCalls())
					.disableAutoComplete()
					.buildProcessorClient();

			this.subscriptionClient.start();

Expected behavior Expected that no code change and version 7.15.1 is working well on AKS as version 7.10.1

Screenshots No screenshot, service on AKS not able to consumer message from azure service bus. Already provide logs

Setup (please complete the following information):

  • Environment: [Azure Kubernetes Service]
  • Library/Libraries: [com.azure:azure-core:1.46.0, azure-messaging-servicebus:jar:7.15.1],
  • Java version: [11]
  • App Server/Environment: [Tomcat]
  • Frameworks: [Spring 5]

Libs: [INFO] | ± com.azure:azure-messaging-servicebus:jar:7.15.1:compile [INFO] | | ± com.azure:azure-core:jar:1.46.0:compile [INFO] | | | ± com.azure:azure-json:jar:1.1.0:compile [INFO] | | | - com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.3:compile [INFO] | | ± com.azure:azure-core-amqp:jar:2.9.1:compile [INFO] | | | ± com.microsoft.azure:qpid-proton-j-extensions:jar:1.2.4:compile [INFO] | | | - org.apache.qpid:proton-j:jar:0.33.8:compile [INFO] | | ± com.azure:azure-core-http-netty:jar:1.14.0:compile [INFO] | | | ± io.netty:netty-handler:jar:4.1.101.Final:compile [INFO] | | | | ± io.netty:netty-resolver:jar:4.1.101.Final:compile [INFO] | | | | - io.netty:netty-transport:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-handler-proxy:jar:4.1.101.Final:compile [INFO] | | | | - io.netty:netty-codec-socks:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-buffer:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-codec:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-codec-http:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-codec-http2:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-transport-native-unix-common:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.101.Final:compile [INFO] | | | | - io.netty:netty-transport-classes-epoll:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.101.Final:compile [INFO] | | | | - io.netty:netty-transport-classes-kqueue:jar:4.1.101.Final:compile [INFO] | | | ± io.netty:netty-tcnative-boringssl-static:jar:2.0.62.Final:compile [INFO] | | | | ± io.netty:netty-tcnative-classes:jar:2.0.62.Final:compile [INFO] | | | | ± io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.62.Final:compile [INFO] | | | | ± io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.62.Final:compile [INFO] | | | | ± io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.62.Final:compile [INFO] | | | | ± io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.62.Final:compile [INFO] | | | | - io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.62.Final:compile [INFO] | | | ± io.projectreactor.netty:reactor-netty-http:jar:1.0.40:compile [INFO] | | | | ± io.netty:netty-resolver-dns:jar:4.1.101.Final:compile [INFO] | | | | | - io.netty:netty-codec-dns:jar:4.1.101.Final:compile [INFO] | | | | ± io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.101.Final:compile [INFO] | | | | | - io.netty:netty-resolver-dns-classes-macos:jar:4.1.101.Final:compile [INFO] | | | | - io.projectreactor.netty:reactor-netty-core:jar:1.0.40:compile [INFO] | | | - io.netty:netty-common:jar:4.1.101.Final:compile

Glad to looking forward to hear from you soon.

Thanks, John

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

Hi team,

I have found that to troubleshoot the azure service bus issue from https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/TROUBLESHOOTING.md. My application stop consume message from Azure Service Bus because default pool size 2 * CPUs were not support. It is working well after I reduce number of Concurrent calls. Could you please help to add logs for this issue to help developers identify and knowing the issue while application stop consume messaging.

Thanks, John