You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Kirill Byvshev (Jira)" <ji...@apache.org> on 2026/01/07 14:48:00 UTC

[jira] [Commented] (CAMEL-22816) camel-telegram - Messages that don't require chatId fail when chatId is not configured

    [ https://issues.apache.org/jira/browse/CAMEL-22816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18050400#comment-18050400 ] 

Kirill Byvshev commented on CAMEL-22816:
----------------------------------------

[~davsclaus]

Not yet. There is a solution for new TG requests, but not for those that are already part of the codebase. I think I will provide a fix later this week.

> camel-telegram - Messages that don't require chatId fail when chatId is not configured
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-22816
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22816
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-telegram
>            Reporter: Kirill Byvshev
>            Priority: Minor
>             Fix For: 4.18.0
>
>
> TelegramProducer.java requires chatId for ALL OutgoingMessage types, but these messages don't need it:
> - AnswerPreCheckoutQueryMessage (uses pre_checkout_query_id)
> - OutgoingAnswerInlineQuery (uses inline_query_id)
> - OutgoingCallbackQueryMessage (uses callback_query_id)
> Exception:
> {code:java}
> throw new IllegalStateException("Chat id is not set in message headers or route configuration"); {code}
> Straightforward fix in TelegramProducer.java:
>  
> {code:java}
> if (message.getChatId() == null) {
>     if (!(message instanceof AnswerPreCheckoutQueryMessage)
>             && !(message instanceof OutgoingAnswerInlineQuery)
>             && !(message instanceof OutgoingCallbackQueryMessage)) {
>         String chatId = resolveChatId(config, message, exchange);
>         message.setChatId(chatId);
>     }
> } {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)