Michael Weiss created CAMEL-23419:
-------------------------------------
Summary: camel-nats - Consumer does not work in pull mode
Key: CAMEL-23419
URL: https://issues.apache.org/jira/browse/CAMEL-23419
Project: Camel
Issue Type: Bug
Components: camel-nats
Affects Versions: 4.18.1
Reporter: Michael Weiss
The nats consumer does not seem to work in pull mode (which is the default).
Example:
{noformat}
- route:
from:
uri: nats
parameters:
jetstreamEnabled: true
jetstreamName: test
durableName: camel
servers: nats:4222
topic: "456"
steps:
- log:
message: ${body}{noformat}
--> Default is pull mode, but Camel does not pull any messages from nats
although messages are available in the nats consumer:
{noformat}
╭───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Consumers
│
├───────────────┬─────────────┬─────────────────────┬─────────────┬─────────────┬───────────────┤
│ Name │ Description │ Created │ Ack Pending │ Unprocessed
│ Last Delivery │
├───────────────┼─────────────┼─────────────────────┼─────────────┼─────────────┼───────────────┤
│ camel-durable │ │ 2026-05-05 13:39:45 │ 0 │ 46
│ never │
╰───────────────┴─────────────┴─────────────────────┴─────────────┴─────────────┴───────────────╯
{noformat}
When enabling push mode explicitly with parameter `pullSubscription: false` it
consumes the messages.
The problem: the push mode doesn't scale. The consumer (Camel) cannot utilize
backpressure mechanisms in push mode. The nats project recommends pull over
push mode
[here|https://docs.nats.io/nats-concepts/jetstream/consumers#dispatch-type-pull-push]
Tested with nats jetstream server 2.12.4
--
This message was sent by Atlassian Jira
(v8.20.10#820010)