[
https://issues.apache.org/jira/browse/CAMEL-24673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18115387#comment-18115387
]
Karol Krawczyk commented on CAMEL-24673:
----------------------------------------
[~fmariani], [~davsclaus], one more option for that choice, from a newer
component: camel-a2a has its own consumer that registers its HTTP endpoints
through {{RestConsumerFactory}} (platform-http by default, another server with
{{httpServerComponent}}), see {{A2AConsumer}}. camel-openai could do the same:
{code:java}
from("openai:webhook?webhookSecret={{openai.webhook.secret}}")
.choice()
.when(header("CamelOpenAIWebhookEventType").isEqualTo("response.completed"))
.to("direct:response-completed")
.end();
{code}
It keeps what I liked about the webhook component (the signature is checked on
the raw body before the route runs, and an invalid request gets a 400 without
route code), with no dependency on camel-webhook. A DIY platform-http route
with an operation after it works too, but then the route author has to keep the
body untouched until the check and map the exception to a 400.
https://github.com/apache/camel/pull/26264 is merged, so {{responses-retrieve}}
is there for the {{response.completed}} case. I will wait for your call on the
shape before writing code.
_Reported by Claude Code on behalf of Karol Krawczyk_
> camel-openai: verify and parse OpenAI webhook events
> ----------------------------------------------------
>
> Key: CAMEL-24673
> URL: https://issues.apache.org/jira/browse/CAMEL-24673
> Project: Camel
> Issue Type: New Feature
> Components: camel-openai
> Reporter: Federico Mariani
> Priority: Major
>
> OpenAI notifies webhook endpoints of events such as {{response.completed}},
> {{response.failed}}, {{batch.completed}}, fine-tuning and eval runs, and
> safety alerts. openai-java 4.55 verifies the signature and parses the event
> with {{webhooks().unwrap()}} and {{verifySignature()}}.
> camel-openai is producer only. A helper usable from a {{platform-http}}
> route, such as a processor or a data format configured with the webhook
> secret, would let routes react when background responses (CAMEL-24670) and
> batches finish instead of polling them.
> Split from CAMEL-24671.
> _Claude Code on behalf of Federico Mariani (Croway)_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)