Class TelegramComponent
Telegram Bot transport component for redb.Route.
Scheme: telegram.
URI format:
Consumer: telegram://receive?token=TOKEN&timeoutSeconds=30
Producer: telegram://send?token=TOKEN&chatId=123456&parseMode=HTML
Document: telegram://document?token=TOKEN&chatId=123456&fileName=report.pdf
Owns a per-token registry of instances with a
dedicated per token. All consumers and producers
targeting the same token share the same client — required by Telegram Bot API
which allows only one getUpdates stream per token (HTTP 409 otherwise).
The component disposes all owned instances on
.
public sealed class TelegramComponent : ComponentBase, IComponent, IAsyncDisposable
Inheritance
Implements
Inherited Members
Properties
Scheme
The URI scheme this component handles (e.g., "kafka", "rabbitmq").
public override string Scheme { get; }
Methods
CreateEndpoint(EndpointUri)
Creates an endpoint from a parsed URI.
public override IEndpoint CreateEndpoint(EndpointUri uri)
DisposeAsync()
Releases component-owned long-lived resources. Default implementation is a no-op.
public override ValueTask DisposeAsync()
GetOrCreateClient(string)
Returns the shared for rawToken,
public TelegramBotClient GetOrCreateClient(string rawToken)
RegisterConsumer(string)
Reserves consumer ownership for rawToken within this
public void RegisterConsumer(string rawToken)
UnregisterConsumer(string)
Releases the consumer slot reserved by .
public void UnregisterConsumer(string rawToken)