Link detached, reason: *Error{Condition: amqp:link:detach-forced, Description: The link 'G2:...' is force detached. Code: ServerError. Details: AmqpEventHubConsumer.IdleTimerExpired: Idle timeout: 00:30:00.
I am getting this error message and restarting the pod Kubernetes container frequently. I had this code working for a long time and it did not happen so frequently. The first time, I thought that it was idle, but I checked the last message received was one minute before and not 30 minutes, maybe I misunderstand the Azure concept of idle in the Iothub bus and be observing the wrong parameters.
My contantainer log is:
...
{"time":"2021-05-01T06:17:58.627919145Z", "message received"}
{"time":"2021-05-01T06:17:58.633331806Z", "message received"}
{"time":"2021-05-01T06:17:58.638524857Z", "message received"}
{"time":"2021-05-01T06:18:02.227702684Z","level":"FATAL","prefix":"-","file":"main.go","line":"47","message":"link detached, reason: *Error{Condition: amqp:link:detach-forced, Description: The link 'G2:omited' is force detached. Code: ServerError. Details: AmqpEventHubConsumer.IdleTimerExpired: Idle timeout: 00:30:00.}
I am considering doing something like the following draft, but a little afraid of losing messages, now if there is an error I see due to the container reinitialization and fix it as soon as possible to do not lose messages.
draft:
for {
err = iotHub.SubscribeEvents(parentCtx, HandleFuncHere)
if err != nil {
if err == context.DeadlineExceeded { // IdleTimerExpired?
log.Errorf("iothub idle timeout")
} else {
log.Fatal(err) // another error
}
}
continue
}
This is a reasonable solution? Did someone experience something similar?
I appreciate any help that someone provides to workaround or understand better this issue, thanks :)
Version:
Error:
I am getting this error message and restarting the pod Kubernetes container frequently. I had this code working for a long time and it did not happen so frequently. The first time, I thought that it was idle, but I checked the last message received was one minute before and not 30 minutes, maybe I misunderstand the Azure concept of idle in the Iothub bus and be observing the wrong parameters.
My contantainer log is:
My golang code is:
I am considering doing something like the following draft, but a little afraid of losing messages, now if there is an error I see due to the container reinitialization and fix it as soon as possible to do not lose messages.
draft:
This is a reasonable solution? Did someone experience something similar?
I appreciate any help that someone provides to workaround or understand better this issue, thanks :)