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

Claus Ibsen commented on CAMEL-22816:
-------------------------------------

Have you fixed this ?

> 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)

Reply via email to