Claus Ibsen created CAMEL-26027:
-----------------------------------

             Summary: camel-telegram - concurrent sends through one endpoint 
mix up the parts of their requests
                 Key: CAMEL-26027
                 URL: https://issues.apache.org/jira/browse/CAMEL-26027
             Project: Camel
          Issue Type: Bug
          Components: camel-telegram
    Affects Versions: 4.18.0, 4.22.0, 4.23.0
            Reporter: Claus Ibsen
             Fix For: 4.24.0, 4.22.3, 4.18.6


Each message handler of the telegram producer keeps one 
{{TelegramBodyPublisher}} ({{TelegramMessageHandler}}, main 07d2e7a987bc, lines 
34 and 47), which every send of that message type fills ({{addBody}}) and 
empties when it serializes the request ({{TelegramBodyPublisher}}, line 152). 
The producer is called from several threads at once when a route has concurrent 
consumers or a parallel split, and then the sends share the parts of their 
requests: a request carries the messages of several sends, to the chat of one 
of them, and another request goes out empty.

Checked on 4.24.0-SNAPSHOT with {{camel run}} against a fake Bot API: 300 text 
messages with their own chat ids, sent through one endpoint by a seda consumer 
with {{concurrentConsumers=20}}. 10 requests carried the messages of several 
chats (one of them those of chat-3, chat-4 and chat-9), 46 requests were empty, 
and 6 sends failed.

*Proposed change*: build the body of each request in its own 
{{TelegramBodyPublisher}}.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to