UchihaIthachi opened a new issue, #6973:
URL: https://github.com/apache/camel-k/issues/6973

   ### Requirement
   
   The KEDA trait can discover triggers for Kafka, Pulsar, Artemis, ActiveMQ, 
AWS SQS and RabbitMQ consumers, but not for NATS. KEDA has a `nats-jetstream` 
scaler that scales on the pending messages of a JetStream consumer, and the 
Camel `nats` component can consume from JetStream, so a `nats` consumer could 
get its trigger automatically too.
   
   While checking how the Camel component (4.22.2, the version used by the 
default runtime) names things, I found one detail the mapping has to get right: 
with `durableName=keda`, the consumer creates the JetStream durable as 
`keda-durable`, not `keda` (`NatsConsumer`, `ccBuilder.durable(durableName + 
"-durable")`). KEDA looks the consumer up by name, so copying `durableName` 
as-is would point it at a consumer that doesn't exist.
   
   Proposed mapping, for 
`nats:<topic>?jetstreamEnabled=true&jetstreamName=<stream>&durableName=<name>` 
(options from the URI or `camel.component.nats.*`):
   - `stream` = `jetstreamName`
   - `consumer` = `<durableName>-durable`
   - `account` = `$G` (the default account of a NATS server without configured 
accounts)
   - `natsServerMonitoringEndpoint` = `<host>:8222` from the first entry of 
`servers`
   
   A core NATS subject keeps no backlog, and an ephemeral JetStream consumer is 
gone while the Integration is scaled to zero, so for those I'd rather produce 
no trigger than a broken one. That needs the mapper to be able to say "nothing 
to scale on": returning an empty scaler type, with `MapToKedaTrigger` returning 
nil for it. Happy to do it differently if you prefer.
   
   I have the mapping ready with unit tests and an e2e test in the KEDA 
workflow (a NATS server with JetStream in the test namespace, same flow as the 
Pulsar test), and will open the PR right after this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to