Looking into the exception details I can see that the token was expired when you have tried to perform the operation. Can you please confirm whether there is no clock sync issue at the client end. Tokens are internally generated by the SDK using primary/secondary connection string and the SDK takes care of renewing these token before it expired. If there is any issue at the client end and the renew token request fails and if you try to perform any operation on the service bus with the expired token then you will be receiving these exceptions.
Unable to connect to ASB Queue while running java app through docker
I'm trying connecting to ASB Queue through java application and running through Docker but getting the below exception
INFO [2020-06-03 13:49:07,910] com.microsoft.azure.servicebus.primitives.MessagingFactory: Created CBS link to $cbs
ERROR [2020-06-03 13:49:07,991] com.microsoft.azure.servicebus.primitives.CommonRequestResponseOperations: Sending CBS Token to 'amqp://a3dvhrbsb01.servicebus.windows.net/cpc
-notification' failed
ERROR [2020-06-03 13:49:07,992] com.microsoft.azure.servicebus.primitives.CoreMessageReceiver: Sending SAS Token failed. ReceivePath:cpc-notification
! com.microsoft.azure.servicebus.primitives.ServiceBusException: Error{condition=com.microsoft:auth-failed, description='ExpiredToken: The token is expired. Expiration time:
'2020-06-03 14:09:07Z'', info=null}
! at com.microsoft.azure.servicebus.primitives.ExceptionUtil.toException(ExceptionUtil.java:113)
! at com.microsoft.azure.servicebus.primitives.RequestResponseUtils.generateExceptionFromError(RequestResponseUtils.java:97)
! at com.microsoft.azure.servicebus.primitives.RequestResponseUtils.genereateExceptionFromResponse(RequestResponseUtils.java:92)
! at com.microsoft.azure.servicebus.primitives.CommonRequestResponseOperations.lambda$sendCBSTokenAsync$1(CommonRequestResponseOperations.java:96)
! at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:966)
! at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:940)
! at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456)
! at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
! at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
! at java.lang.Thread.run(Thread.java:748)
I dont have any issue while running through command line, this happens only while running through docker.