## TL;DR

Raising idle_timeout doesn't fix it, it just delays the failure. The reporter's workaround was to switch back to uamqp for the consumer client (add uamqp to dependencies and use it as the transport) until the pyamqp-side fix lands.

## Steps

1. With azure-eventhub on pyamqp, long idle periods (over an hour) can end with the link detached ('connection was inactive for more than the allowed 300000 milliseconds') and the consumer silently stops receiving events, which also floods the metrics blade with User Errors. Raising idle_timeout doesn't fix it, it just delays the failure. The reporter's workaround was to switch back to uamqp for the consumer client (add uamqp to dependencies and use it as the transport) until the pyamqp-side fix lands. If your async EventHub consumers go quiet after idle periods on pyamqp, try uamqp as the transport.

2. _Source: https://github.com/Azure/azure-sdk-for-python/issues/28996 (Azure Key Vault)_

## When to use

You are seeing this: With azure-eventhub on pyamqp, long idle periods (over an hour) can end with the link detached ('connection was inactive for more than the allowed 300000 milliseconds') and the consumer silently stops receiving events, which also floods the metrics blade... Use this skill when you run into "Async Eventhub Consumer with Pyamqp: Link Detached after long idle period Results in High "User Errors" volume".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/Azure/azure-sdk-for-python/issues/28996
