'Azure Service Bus Amqp token issue

I'm using Azure Service Bus, and Managed ID to authenticate to it. I'm using Kotlin and Quarkus, in an AKS environment.

Now my issue is that when I deploy my code I get the following error:

2022-04-03 09:34:20,287 ERROR [com.azu.cor.amq.imp.ActiveClientTokenManager] (reactor-executor-2) 
Error occurred while refreshing token that is not retriable. Not scheduling refresh task. Use ActiveClientTokenManager.authorize() to 
schedule task again.
period >= 0 required but it was -1484002855000000000

It seems there's something wrong with the refresh token, but I can't really figure out what it is.

I'm creating my Service Bus processor client using a producer method like this:

    @Produces
    @Singleton
    fun serviceBusProducerClientBuilder(): ServiceBusProcessorClientBuilder = ServiceBusClientBuilder()
        .credential(messagingConfig.namespace(), tokenCredential)
        .transportType(AmqpTransportType.AMQP_WEB_SOCKETS)
        .processor()
        .topicName(messagingConfig.topics().captureResults())
        .subscriptionName(messagingConfig.subscription())

Now I can add a method called ".retryOptions()" and feed it some retry options, but I'm not sure if that's the issue here.

Does anyone know what I should look for?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source