Path: redb-route/UPGRADING.md Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/UPGRADING.md ---- # Upgrading redb.Route What to check and change when moving to a new version. Each section lists the changes that need action; [CHANGELOG.md](CHANGELOG.md) has the full list of what changed. ## 4.8.0 ### An agent without `AddRedbLlmStorage` deduplicates tool calls in the process `AddRedbRouteLlm()` now registers `InMemoryToolIdempotencyStore` as the default `IToolIdempotencyStore`, as it registers the other in-memory stores. Before, a setup without `AddRedbLlmStorage()` had no store, and a tool call the model repeated with the same tool-use id in a conversation ran the tool again; now the second call returns the stored output of the first. Only tools that are not `ReadOnly` are deduplicated, as with the redb store. - The store lives in the process: a restart forgets it, and each node of a cluster keeps its own. For deduplication that survives a restart or spans nodes, use `AddRedbLlmStorage()`. - A completed call is remembered for 24 hours after it completed, then forgotten on a later reservation (no timer); a call still in flight is never aged out, so a second run of it cannot start while the first is running. For another value, register the store yourself: `new InMemoryToolIdempotencyStore(new InMemoryIdempotentRepository(), ttl)`. - `AddRedbLlmStorage()` and a store you register yourself still replace it, before or after `AddRedbRouteLlm()`. - It does not roll back with a route's `.Transacted()`, nor does `InMemoryConversationStore`: after a rollback the conversation keeps the rolled-back run's tool calls and their results, so a redelivered message may not call the tool again. A run inside a transaction that uses either store logs a warning once per route and connection factory. Use `AddRedbLlmStorage()` for an `llm:` step inside `.Transacted()`, or move the step out of the block. ### An LLM store called without an exchange opens a redb scope of its own The stores of `AddRedbLlmStorage()` called without an exchange (a host calling a store directly, the eval runner) used the context's single `IRedbService`; they now open a redb scope of their own for each call, so concurrent calls no longer share one connection. A call with an exchange is unchanged: it works in the exchange's scope. What changes for you, only where your code calls a store without an exchange: - Inside a `TransactionScope` nothing changes: the call's own scope joins the ambient transaction, as every redb connection does, and rolls back with it. - Inside a transaction begun on the context's shared `IRedbService` (`ExecuteAtomicAsync`, `BeginTransaction`) the call is no longer part of it: it commits on its own and stays when that transaction rolls back. Pass the exchange, or put the work in a `TransactionScope`, where the store's writes must go with yours. - Outside any transaction each call commits at once, as before; your code undoes what it wrote when its own work fails. The list is in the README of redb.Route.Llm, "Calling the stores from your own code". ### `log:` `level=` takes the Camel names and refuses any other The `level` option of a `log:` endpoint takes the .NET names (Trace, Debug, Information, Warning, Error, Critical, None) and Apache Camel's (TRACE, DEBUG, INFO, WARN, ERROR, OFF), in any case. - `level=WARN` now logs at Warning and `level=OFF` logs nothing; both logged at Information before. - Any other value, a number included, is refused when the endpoint is created, so the route does not start; before it logged at Information without a word. Write one of the names above. ### The AMQP fluent entry point is `AmqpDsl` The static class `redb.Route.Amqp.Amqp` is renamed `AmqpDsl`, as the entry points `TimerDsl`, `GrpcDsl`, `TcpDsl` and `LdapDsl`. Under its old name the root namespace `Amqp` of AMQPNetLite shadowed it, so the short form `Amqp.Address("orders")` did not compile in a consumer's file; only the full name `redb.Route.Amqp.Amqp.Address(...)` reached it. Affected: code that writes `redb.Route.Amqp.Amqp.Address(...)`, or an alias of that class. Change it to ```csharp AmqpDsl.Address("orders") // with using redb.Route.Amqp; ``` The URIs it builds, the `amqp:` options and Route-XML are unchanged. ### A failed branch of a parallel ScatterGather or RecipientList rolls the transaction back A parallel `ScatterGather` or `RecipientList` inside `.Transacted()` (or `BeginTransaction()`) now runs each branch under a dependent clone of the route's transaction, as a parallel `Split` and `Multicast` already did. Until now its branches ran on the route's transaction itself, all at once, which System.Transactions does not allow across threads. What a route sees: - Before: in best-effort mode (`stopOnException=false`, the default) a failed branch was aggregated, the block committed, and the other branches' deferred sends went out. - Now: a failed branch rolls the whole block back, best-effort mode included. The fan-out still aggregates and returns, but the block cannot commit: the deferred sends are dropped, the database work rolls back, and the message comes back from the broker. To keep the old outcome, take the fan-out out of the transaction: - keep the parent **without** `.Transacted()` and open a transaction in each recipient route, so each branch commits on its own; or - make the fan-out sequential (`ParallelProcessing(false)`, `parallelProcessing: false`): sequential branches run on the route's transaction one after the other and are not isolated, so a failed branch in best-effort mode leaves the block able to commit. ### .NET 10 and .NET 11 only The redb.Route packages target `net10.0` and `net11.0`. The `net8.0` and `net9.0` builds are gone: .NET 8 and .NET 9 reached end of support on 10 November 2026. The `redb-route-xml` tool (`redb.Route.Xml.CodeGen`) runs on .NET 10, and the route project `redb-route-xml new` creates targets `net10.0`. Action: an application on .NET 8 or .NET 9 either stays on 4.7.x or moves its target framework to `net10.0` (or `net11.0`) before taking this version. A route project created by an earlier `redb-route-xml new` with `net9.0` changes it to `net10.0`. Nothing changes in the API. The `redb-route*` templates of redb.Templates create a `net10.0` module and no longer take `--framework`: a script that passes it drops the option. ### A consumer that failed to start is started again A consumer whose `Start` threw while its context started (a broker, a database or a server not up yet) used to leave its route `Errored` until someone started it by hand or restarted the process. The context now starts that consumer again in the background: first after 2 seconds, then with the pause doubling up to one minute, with no limit on attempts. The route stays `Errored` while it waits, so `RouteHealthCheck` reports it unhealthy, and becomes `Started` (with `OnRouteStarted` to the lifecycle listeners) once the consumer starts. Each failed retry logs a Warning with the next pause. The start-up line "started successfully: all N endpoints operational" is written only when every route started; otherwise a Warning names the `Errored` routes. What to check: - A route whose consumer is expected to fail at start and stay down (a test, a disabled connection) now retries. Give it `AutoStart(false)`, or set the retry options. - A listener or monitor that took `OnRouteErrored` after start-up as final now also sees `OnRouteStarted` later. - Routes with `AutoStart(false)` and routes a route policy starts (a clustered route waits for its lock) are not retried by the context; the policy keeps starting them as before. The options are `RouteEngineOptions.ConsumerStartRetry` (`RedbRoute:ConsumerStartRetry` for a host that binds `RouteEngineOptions` from the `RedbRoute` section; a Tsak worker binds it for every module context): | Option | Default | Meaning | |---|---|---| | `Enabled` | `true` | `false` keeps the old behaviour: the route stays `Errored`. | | `Delay` | `00:00:02` | Pause before the first retry. | | `Multiplier` | `2` | Factor the pause grows by after each failed retry (1 or more). | | `MaxDelay` | `00:01:00` | Longest pause between two retries. | | `MaxAttempts` | `0` | Number of retries; `0` retries until the context stops. | | `UnhealthyOnRestarting` | `true` | An `Errored` route waiting for a retry is Unhealthy; `false` reports it Degraded. | | `UnhealthyOnExhausted` | `true` | An `Errored` route no retry waits for is Unhealthy; `false` reports it Degraded. | ```csharp var context = new RouteContext(options: new RouteEngineOptions { ConsumerStartRetry = { Delay = TimeSpan.FromSeconds(5), MaxAttempts = 20 }, }); ``` ### A RabbitMQ send fails when the broker does not confirm it in 5 seconds A RabbitMQ send used to wait for the broker's confirm for as long as it took. A broker that blocks its publishers (a memory or disk alarm, often because a consumer stopped reading and a queue filled the disk) sends no confirm, so every send waited for as long as the alarm lasted, and the threads of the routes that sent piled up. A send now fails with `RabbitMQPublishTimeoutException` when the broker has not taken it within `confirmTimeout` milliseconds, 5000 by default as Apache Camel's. The timeout covers the wait for the channel, the publish and the confirm; in a transacted block, its publishes and the `tx.commit`; in a request-reply call, the request's publish (`timeout` still bounds the wait for the reply). What to check: - A route that sends large messages to a slow broker, or that is meant to wait out an alarm, gets a longer `confirmTimeout` (`Rabbit.Queue(..).ConfirmTimeout(30000)`, or `confirmTimeout=30000` on the URI). - A route that should survive a timed-out send handles it: `OnException()` takes it, and so does a handler for `TimeoutException`, its base type. Without one the send fails the exchange as any other failed send does. - A timed-out message may still reach the queue later, when the broker resumes. A route that sends again after a timeout can deliver it twice; the receiving side deduplicates, as for any at-least-once send. ### A Wire Tap runs on a bounded pool A `WireTap` used to start every copy as background work of its own, with no limit: a tap whose target slowed down (an audit store, a broker under an alarm) piled up copies and threads until the process ran out of them. Each tap now runs its copies on a pool of its own built from a thread pool profile, as Apache Camel does: at most 20 at a time and 1000 waiting by default; a copy that finds both full is run by the route's own thread before it goes on (`CallerRuns`). That copy still runs outside the caller's transaction and never fails the route. What to check: - A route whose tap target is slow now slows down itself once the pool is full, instead of growing without bound. Watch `redb.route.pool.caller_runs`. Give such a tap a profile of its own, larger or with `RejectedPolicy = Discard` when a lost copy is acceptable: `context.AddThreadPoolProfile("audit", new ThreadPoolProfile { MaxConcurrency = 50 })` and `.WireTap(uri, executorService: "audit")`. - The default profile for all taps is `RouteEngineOptions.DefaultThreadPoolProfile` (`RedbRoute:DefaultThreadPoolProfile`); named profiles are `RouteEngineOptions.ThreadPoolProfiles` (`RedbRoute:ThreadPoolProfiles:`) or `IRouteContext.AddThreadPoolProfile`. A name registered twice with other bounds throws; a tap that names an unknown profile fails when its route is built. - When the context stops, copies still running or waiting get the shutdown timeout; the number left is logged. - `IRouteContext` has two new members, `AddThreadPoolProfile` and `GetThreadPoolProfile`; a class of your own that implements it implements them too. ### An OnCompletion block runs in the caller, which waits for it A caller of a route with an `OnCompletion` block now waits for that block before it gets the exchange back; to keep the old behaviour, add `.ParallelProcessing()` to the block. This is Apache Camel's rule: a block runs in the caller unless `parallelProcessing` or an `executorService` gives it a pool. Before, every block after the consumer started as background work of its own, without limit. What to check: - A route whose consumer must answer fast (an HTTP request, a broker message acknowledged after the route) and whose block is slow: add `.ParallelProcessing()`, or `.ExecutorService("name")` with a profile of its own (see "A Wire Tap runs on a bounded pool"). The block then runs on a bounded pool, and the context waits for running blocks when it stops. - Nothing else changes for the block: it gets a copy, runs outside the caller's transaction and cancellation, and never changes the route's result; `ModeBeforeConsumer()` blocks run as before. ### An encrypted unsigned AS2 message has its MIC over the part with its headers The MIC of an AS2 message that is encrypted and not signed (compressed or not) is now computed over the decrypted, uncompressed part with its MIME headers, as RFC 4130 §7.3.1 and RFC 5402 §4.2 require and OpenAS2 computes it. Before, redb hashed the content alone, so such a message to OpenAS2 or another conforming partner came back with edbAs2.mdnMicStatus = mismatch and edbAs2.mdnConfirmed = false. Signed messages and unsigned unencrypted ones, compressed or plain, keep their MIC. What to check: - Two redb sides, one before and one after this change, on an agreement with Sign=false and Encrypt=true: every MDN reports mismatch, so mdnConfirmed is alse; the message itself is delivered. With RequireValidMdn the sending exchange fails and the route's error handling takes over; without it the MDN is logged and left to the route. Upgrade both sides, or agree Sign=true until both have. - A route that worked around the mismatch with such a partner (ignoring mdnMicMatch for unsigned encrypted agreements) can branch on mdnConfirmed again. ### An AS2 receiver refuses with 503 and Retry-After 30, and bounds its asynchronous MDNs An AS2 receive endpoint that refuses a request now answers `503 Service Unavailable` with `Retry-After: 30`, where it answered `429` with `Retry-After: 1`: the defaults of `rejectStatusCode` and `retryAfterSeconds` changed. A resend carries the whole message again, so the partner is told to wait for the load to pass. The same answer now also refuses a message that asks for an asynchronous MDN when every slot of the new pool is taken (`asyncMdnPoolSize`, 20 by default): the slot is taken before any work and kept until the receipt is posted. Before, every receipt was posted as background work of its own, without limit, and tried once; it is now tried up to `asyncMdnAttempts` (3) times. What to check: - A partner or a monitor that expects `429` from the receiver: set `rejectStatusCode=429` and `retryAfterSeconds=1` on the endpoint to keep the old answer. - A receiver that takes bursts of more than 20 messages asking for an asynchronous MDN at once: raise `asyncMdnPoolSize`; the refused ones are counted in `redb.route.as2.mdn.async_rejected` and in the endpoint's `Rejected`. - A partner MDN endpoint that answers `5xx` may now get the same receipt up to three times, with the same `Message-ID`; `asyncMdnAttempts=1` keeps one attempt. - The receiver is now bounded by default: 32 requests at once and 32 waiting (`maxConcurrentRequests=32`, `requestQueueLimit=32`), where it admitted every request. A burst past 64 is refused and resent by the partner. `maxConcurrentRequests=0` keeps the old unlimited admission; a receiver that set only `maxConcurrentRequests` now also queues 32, and `requestQueueLimit=0` keeps refusing at once. ### The SQL idempotent table has a `claim_id` column A claim now carries an id. `IIdempotentRepository.Lease` hands it out, and `Confirm(key, token)` and `Release(key, token)` act only while that claim still holds the key. The AS2 and AS4 receivers use them: a node whose claim was taken over after `inFlightClaimTimeout` no longer confirms or removes the new holder's claim. The SQL repository keeps the id in a new nullable `claim_id` column; the redb repository keeps it in a new field of its props class, which the scheme sync adds by itself. A repository of your own keeps compiling and behaves as before: the default `Lease` hands out no id, and the token methods then confirm or remove the key as before. What to do: - `SqlIdempotentRepository` with `CreateTable = true` (the default): nothing. The repository adds the column the first time it touches the table. - With `CreateTable = false`, add the column before any 4.8.0 node starts. Until then the first claim fails with a message that names this statement: ```sql -- PostgreSQL, MySQL, MariaDB, SQLite ALTER TABLE ADD COLUMN claim_id VARCHAR(36) NULL; -- SQL Server ALTER TABLE
ADD claim_id NVARCHAR(36) NULL; ``` `Add` (the idempotent consumer) does not need the column. - Order: run the ALTER first, then roll the nodes, with no downtime. A 4.7 node keeps working on the altered table because its insert names its columns. - Claims in flight during the upgrade have no claim id. They are answered as before: confirmed is a duplicate, and unconfirmed is in flight until `inFlightClaimTimeout`, after which it is taken over. Their 4.7 holders confirm or remove them unconditionally, as before. A token never matches a row without a claim id. ### A copy that goes on as an exchange of its own has a new id As in Apache Camel, the copy a `seda:` or `vm:` producer queues, and the copies of `Multicast`, `RecipientList`, `ScatterGather`, `Enrich` and `OnCompletion`, get a new `ExchangeId` and the `CamelCorrelationId` property set to the id of the exchange they were copied from (`Split` did so already). A `WireTap` copy and the exchange of a `PollEnrich` get a new id and no correlation id. `direct:`, `direct-vm:`, `Threads` and `Loop` keep the id. Until now every one of these copies kept the original's id. What changes for you: - A log search, an alert or a store that joins the two sides of one of these hops by `ExchangeId` joins on `CamelCorrelationId` of the copy (`exchange.GetProperty(ExchangePropertyKeys.CorrelationId)`, the `redb.correlation.id` span tag) instead. A wire tap's copy carries no link back: set a header or property in `onPrepare` if the tapped side needs one. - The in-flight list, the watchdog and the Tsak dashboard show each copy as its own entry, in the route it runs in. A message waiting in a `seda:` consumer used to be counted under the sending route's entry, with the sender's id. - After a `Multicast`, `ScatterGather` or `Split` that merges its results back, the original no longer takes a part's `CamelCorrelationId`: it keeps its own. - An `IExchange` of your own (a test double) that is used with these steps implements `CorrelatedCopy()` and `CorrelatedCopyLinked()`; the default members throw `NotSupportedException`. ### Split metadata are exchange properties, and a message part keeps its own headers As in Apache Camel, `Split` now publishes `CamelSplitIndex`, `CamelSplitSize` and `CamelSplitComplete` as exchange properties of each part, no longer as message headers, in both the ordinary and the streaming split. A part also carries `CamelCorrelationId`, the parent's exchange id. A part that is an `IMessage` (a record of a batch consumer, for example) becomes the part's message: a copy with its own body, headers and content type, without the parent's headers. Any other part becomes the body under a copy of the parent's headers, as before. What to change: - A route that reads the metadata as a header reads the property: `${header.CamelSplitIndex}` becomes `${property.CamelSplitIndex}`, `exchange.In.Headers["CamelSplitIndex"]` becomes `exchange.GetProperty(ExchangePropertyKeys.SplitIndex)`; the same for `CamelSplitSize` and `CamelSplitComplete`. - The metadata no longer reach a broker or a file with the part. A route that relied on that sets a header of its own from the property. - A streaming split now reads one part ahead, to know whether the current part is the last one: the last part has `CamelSplitComplete` set to `true` and carries `CamelSplitSize`; the parent carries `CamelSplitSize` after the split, as before. The source is therefore pulled one element earlier: the next element is fetched before the current part runs, not after it. A source that waits for its next element (a live stream, a channel) holds the current part back until that element or the end arrives; a source with side effects per element (a cursor, a queue read) has done them for one element more when a part stops the split (stopOnException). A splitter of your own must yield parts that stay valid after the next one is read. - A route that splits a list of `IMessage` and expected the parent's headers on each part sets them itself. ### The intercepted target is the `CamelToEndpoint` property `InterceptSendToEndpoint` publishes the target URI in the exchange property `CamelToEndpoint`, as Apache Camel does. The headers `redb.toEndpoint` and `CamelToEndpoint` are no longer set. What to change: - `${header.redb.toEndpoint}` and `${header.CamelToEndpoint}` become `${property.CamelToEndpoint}`; in C# `exchange.GetProperty(ExchangePropertyKeys.ToEndpoint)`. The value is the URI without its secrets, as before. - The target no longer travels with the message to the endpoint the intercept sends to. A route that needs it there sets a header of its own from the property. ### A forwarded reply-to is not carried on RabbitMQ, IBM MQ and AMQP producers used to copy a reply-to header into the outgoing message on every send. A message consumed with its sender's reply-to and forwarded to another queue therefore asked the next service to answer into the first sender's reply queue, a queue of another system that was not waiting for that answer. As in Apache Camel's JMS, an ordinary (not request-reply) send now leaves the reply-to out: the `ReplyTo` header on RabbitMQ, the `redbIbmMq.ReplyToQueue` and `redbIbmMq.ReplyToQueueManager` headers on IBM MQ, the `ReplyTo` and `ReplyToGroupId` headers on AMQP. The correlation id, the message id and the expiration are carried as before, and a request-reply send (`replyTo=true`) sets its own reply-to as before. What to change: - A bridge that must hand the sender's reply address on to the next service sets `preserveMessageQos=true` on the producer endpoint (`.PreserveMessageQos()` in the fluent builders). - A route that names a reply address on an ordinary send by setting the reply-to header does the same: the header is used only with `preserveMessageQos=true`. ### Kafka batch mode is `batching=true` with `maxBatchMessages` The Kafka consumer's batch mode follows the batch contract every broker of redb.Route shares, with Apache Camel's option names. `maxPollRecords` used to switch batch mode on and size it, and `pollTimeoutMs` was a fixed window from the start of collection. What to change: - `maxPollRecords=N` becomes `batching=true&maxBatchMessages=N` (`.MaxPollRecords(N)` becomes `.Batching().MaxBatchMessages(N)`). `maxPollRecords` is refused as an unknown option, naming its replacement. `maxBatchMessages` defaults to 500; `maxBatchMessages` without `batching=true` fails the start. - `pollTimeoutMs` in batch mode is now the idle timeout: the batch is sent on once no record came for that long, and every record restarts it. A steady stream therefore fills a batch to `maxBatchMessages`. To keep the old upper bound on how long a batch waits, set `batchingIntervalMs` to the old `pollTimeoutMs`. - The header `redbKafka.BatchSize` is gone: the size is `body.Count`, `${body.size}` in the expression language. - The batch message now carries `redbKafka.Topic` and `redbKafka.Partition` when every record of the batch agrees. ### A failed RabbitMQ message is tried 5 times, then rejected to the dead letter exchange The RabbitMQ consumer used to nack a delivery the route failed on with requeue, every time and at once: a message that always fails (a poison message) went round between the queue and the route forever, and never reached a dead letter exchange. As in Apache Camel's spring-rabbitmq, the consumer now tries the delivery again itself, `maximumRetryAttempts` times in all (default 5, the first included), `retryDelay` milliseconds apart (default 1000), and then rejects it without requeue (`rejectAndDontRequeue=true`, the default). A route error handler that handles the failure still ends it at once with an acknowledgement, and a delivery interrupted by the consumer's stop is requeued. What to do: - Declare a dead letter exchange for the queues whose failed messages must be kept: `deadLetterExchange` (and `deadLetterRoutingKey`) on the endpoint with `declare=true`, or `x-dead-letter-exchange` on a queue declared elsewhere. Without one, the broker drops a message that failed every attempt. - A failing delivery now holds its consumer slot for up to `(maximumRetryAttempts - 1) * retryDelay` milliseconds (4 s by default) before it is settled. With `concurrentConsumers=1` the queue behind it waits that long: a burst of 100 failing messages holds the messages after them for about 7 minutes (100 x 4 s). Camel's spring-rabbitmq does the same (its retries block the listener thread). Raise `concurrentConsumers`, or lower `retryDelay` or `maximumRetryAttempts`, where that matters. - The old behaviour, requeue at once on every failure: `maximumRetryAttempts=1&rejectAndDontRequeue=false`. ### IBM MQ `batchSize` is gone, batch mode is `batching=true` The IBM MQ option `batchSize` was declared and validated but read by nothing: a consumer with it received one message at a time. It is gone; an endpoint that names it fails to start, naming the replacement. Batch mode is now real: `batching=true` with `maxBatchMessages` (default 100), `pollTimeoutMs` and `batchingIntervalMs`, read with MQGET under syncpoint and committed once after the route (poll receive mode, and `backoutQueue` required). What to change: - Remove `batchSize` from IBM MQ URIs. Where a batch was wanted, write `batching=true&maxBatchMessages=N&backoutQueue=Q`, and change the route to take a `List` body (or `Split` it). ### An SQS list of IMessage goes out by SendMessageBatch, enableBatch is gone The SQS producer had a second way to send many messages: `enableBatch=true` sent any list body as `SendMessageBatch` entries, each element turned into text (a list of `IMessage` became the JSON of the message objects) with the parent's headers as attributes of every entry. Every producer of redb.Route now reads a list of `IMessage` the same way, one message per element with its own body and headers, so the option has nothing left to switch: `enableBatch` and `batchMaxMessages` are gone, and an endpoint that names them fails to start as with any unknown option. What to change: - Remove `enableBatch` and `batchMaxMessages` from SQS URIs (`.EnableBatch()` from the builder). - To send many messages, make the body a `List`: each element goes out with its own body and attributes, 10 per `SendMessageBatch` call; on a FIFO queue each element takes its own `redbSqs.messageGroupId` and `redbSqs.messageDeduplicationId` headers, else the endpoint's options. The parent's headers are not copied to the elements: set them on each element. - A list of strings or other values, with or without `enableBatch` before, is now one message, its JSON. To send its elements as separate messages, make them `IMessage` (`new Message(value)`). - Entries SQS refuses do not throw. Read `redbSqs.batchSuccessful`, `redbSqs.batchFailed` and `redbSqs.batchFailedEntries` after the send where a refused entry matters. ### An S3 or Firebase Storage object is kept when the route rolls back The S3 and Firebase Storage consumers deleted or moved an object only when its exchange succeeded, but they read success as "no unhandled exception": a route that marked the exchange rollback-only with `.RollbackAll()` (Camel's `markRollbackOnly()`) returns without an exception, and its object was deleted or moved as if it had been processed. Such an exchange now counts as failed, as it already did for the file, FTP and SFTP consumers and the message brokers: the object stays where it is and is offered again on the next poll, the idempotent mark is not written, and on Firebase Storage `moveFailed`, when set, moves it to the quarantine prefix. This follows Apache Camel's aws2-s3, which deletes or moves an object only when the exchange commits. S3 has no `moveFailed`, as in Camel. What to check: - A route that calls `.RollbackAll()` to skip an object it does not want, and relied on the delete to get rid of it: that object now comes back on every poll. Filter it out with `include`/`exclude`, or end the route normally (`.Stop()`) so the object is deleted, or set it aside on Firebase Storage with `moveFailed`. ### An MQTT message the route fails on is settled by one rule The MQTT consumer settled a failed message in two ways. Serial mode (the default) left the acknowledgement to MQTTnet, which acknowledged on return from the handler, so a failure was acknowledged like a success. Concurrent mode (`concurrentConsumers` above 1) left a failure unacknowledged and did nothing more; MQTT has no negative acknowledgement, the broker sends such a message again only when the client connects again to a session it kept, and it sends no more unacknowledged messages than the receive window (20 on Mosquitto by default), so after enough failures the consumer got no more messages. Both modes now follow Apache Camel's paho-mqtt5 consumer as corrected by CAMEL-25793 (merged in October 2026, not yet in a Camel release): - Every QoS 1 and QoS 2 message is acknowledged by the consumer after the route. - A failed message (an exception the route did not handle, or `.RollbackAll()`) of QoS 0, or on a session that ends with the connection, is acknowledged and logged as an error. The broker does not send it again. - A failed QoS 1 or QoS 2 message on a kept session stays unacknowledged; the consumer disconnects and connects again after a pause (1 s, doubling per failure in a row up to `maxReconnectDelay`, default 128000 ms; a success resets it), and the broker sends it again. The client speaks MQTT 5.0, where a session without a Session Expiry Interval ends with the connection, so `cleanSession=false` alone kept nothing before and keeps nothing now: the new option `sessionExpiryInterval` (seconds) keeps it. What to do: - A route that relies on the broker to send a failed message again: set `cleanSession=false`, a fixed `clientId` and `sessionExpiryInterval` (for example 3600), and make the route tolerate a message that comes twice (an idempotent consumer): after the reconnect the broker also sends again the messages not yet acknowledged at the disconnect. - A route on the default `cleanSession=true`: a failed message is acknowledged and lost to MQTT, as serial mode did before. Keep it with the route's error handling: an error handler with redelivery and a dead letter channel. - A kept session keeps its subscription when the consumer stops (it no longer unsubscribes), so the messages waiting in it reach the next start. ### The mail consumer selects mails by Camel's searchTerm, searchQuery is gone The IMAP option `searchQuery` was documented as not applied: the consumer never read it. It is gone, and an endpoint that names it fails to start, naming the replacement. The IMAP and POP3 consumers now take Apache Camel's `searchTerm`, in Camel's names, so a Camel URI carries over: - `searchTerm.unseen` (default `true`), `searchTerm.subjectOrBody`, `searchTerm.subject`, `searchTerm.body`, `searchTerm.from`, `searchTerm.to`, `searchTerm.fromSentDate`, `searchTerm.toSentDate`, `searchTerm.fromReceivedDate`, `searchTerm.toReceivedDate`. The terms are ANDed; a date is `yyyy-MM-dd HH:mm:ss` or `now` with an offset (`now-24h`). - `searchTerm=#name`: a MailKit `SearchQuery` registered under that name, sent to the IMAP server as it is; the `searchTerm.*` options are not read beside it. - A set search term replaces `fetchFilter`; setting both is refused at start. What to change: - Remove `searchQuery` from mail URIs (`.SearchQuery(...)` from the builder). Where it held a search, write the `searchTerm.*` options (`.SearchTerm(t => t.Subject("invoice"))`), or register a MailKit `SearchQuery` and name it with `searchTerm=#name`. - An endpoint with both `fetchFilter` and `searchTerm`: drop `fetchFilter`. `fetchFilter=All` is `searchTerm.unseen=false`; the other filters (Flagged, Answered, Recent) are a registry `SearchQuery`. - POP3 checks the terms on the client; `searchTerm=#name` and the received dates stop a POP3 route at start, since POP3 has no search and no arrival time. ### A Service Bus list body goes out as one batch, enableBatch is gone The Service Bus producer sent a list body as one message (its JSON), and as a batch only with `enableBatch=true`, where each item became a message under the parent's properties, a list of `IMessage` included. As Apache Camel's azure-servicebus sends an `Iterable` body, and as every producer of redb.Route now reads a list of `IMessage`, any list body is sent as one Service Bus batch, one message per element, which the entity takes whole or not at all: `enableBatch` and `batchMaxMessages` are gone, and an endpoint that names them fails to start, naming the rule. What to change: - Remove `enableBatch` and `batchMaxMessages` from Service Bus URIs (`.EnableBatch()`, `.BatchMaxMessages()` from the builder). `batchMaxSizeBytes` still bounds the batch. - A list of `IMessage` now sends each element with its own body and its own headers as application properties; the parent's headers are not copied to the elements. Set what each message needs on the element. - A list that was sent as one message (its JSON) before, without `enableBatch`, is now sent element by element. To keep one message, serialize the list in the route (`.Marshal("application/json")`). ### Kafka headers take Apache Camel's names, and a record's partition is chosen as in Camel The Kafka component's headers now have camel-kafka's names and types (`KafkaConstants`), so a route written for Camel reads and sets them unchanged. The old names are not read: a route that still uses one finds no header. | Before | Now | |---|---| | `redbKafka.Topic` | `CamelKafkaTopic` (`string`) | | `redbKafka.Partition` | `CamelKafkaPartition` (`int`) | | `redbKafka.Offset` | `CamelKafkaOffset` (`long`) | | `redbKafka.Timestamp` (a `DateTime`) | `CamelKafkaTimestamp` (`long`, milliseconds since the Unix epoch) | | `redbKafka.Key` | `CamelKafkaKey` | | `redbKafka.Sent.Topic`, `.Sent.Partition`, `.Sent.Offset`, `.Sent.Timestamp` | `CamelKafkaRecordMeta`: a `List`, one entry per sent record (`Topic`, `Partition`, `Offset`, `Timestamp` as the broker stored it) | | (none) | `CamelKafkaPartitionKey`: the partition of a sent record, per message | | (none) | `CamelKafkaHeaders`: the consumed record's `Confluent.Kafka.Headers` | The `KafkaHeaders` constants keep their member names (`KafkaHeaders.Key` and so on), so code that uses them only needs a rebuild; `KafkaHeaders.Sent*`, `KafkaHeaders.Prefix` and `KafkaHeaders.IsRedbHeader` are gone. Three behaviour changes come with it: - **The partition.** A producer sends to the endpoint's `partitionKey` (Camel's name), which takes precedence over the `CamelKafkaPartitionKey` header; without either, Kafka's partitioner places the record by its key. `partitionNumber` is the consumer's alone: a producer that names it fails to start, naming `partitionKey`. - **The key is kept with an explicit partition.** It used to be dropped when a partition was set. - **The metadata header.** `recordMetadata=true` (default `false`, as in Camel) puts one list in `CamelKafkaRecordMeta` instead of the four `Sent.*` headers; a list body gives one entry per element. The default `KafkaHeaderFilterStrategy` is Camel's: headers whose names start with `Camel`, `camel`, `org.apache.camel.` or `kafka.` neither go on a sent record nor come in from a consumed one. `keyFromHeader` is gone, as Camel has no such option: the `key` option wins, else `CamelKafkaKey` is the key. What to change: - Replace the old header names in routes, expressions and XML: `${header.redbKafka.Partition}` becomes `${header.CamelKafkaPartition}`, `` becomes ``. - Read `CamelKafkaTimestamp` as a `long` (`DateTimeOffset.FromUnixTimeMilliseconds`), not a `DateTime`. - Read the sent metadata from `CamelKafkaRecordMeta` (`((List)header)[0].Offset`). - A producer with `partitionNumber=n`: write `partitionKey=n` (`.Partition(n)` in the builder is now `.PartitionKey(n)`; a consumer's `.PartitionNumber(n)`). - `keyFromHeader=false`: remove the `CamelKafkaKey` header before the send instead (`.RemoveHeader(KafkaHeaders.Key)`). - A route that set a header beginning with `Camel` or `kafka.` to carry it to the next hop: rename it; such headers stay off the record, as in Camel. ### The tool idempotency reservation of an agent is kept in the agent's redb `AddRedbLlmStorage()` keeps the reservation of a tool's idempotency key next to the tool's stored output, by one rule: in the instance an `llm:` endpoint's `?redb=` names, else the one `AddRedbLlmStorage("")` names, else the context's default redb. It is an entry of redb.Route's idempotent repository (the `Route Idempotent Entry` scheme, processor name `llm-tool-idempotency`); the repository creates the scheme on first use. Before, a reservation without a name went through an `IIdempotentRepository` the host registered in DI, so it could sit in another database than the output, or only in memory: after a restart such a reservation was gone and a tool with side effects ran again. What changes for you: - `AddRedbLlmStorage()` alone is enough. The `IIdempotentRepository` you registered in DI for it is no longer used by the LLM storage; remove it unless something else needs it. - `RedbToolIdempotencyStore` is constructed as `new RedbToolIdempotencyStore(context, defaultRedbName)`; the `IIdempotentRepository` parameter is gone. Code that builds the store itself drops that argument. - A context with no redb it can open (no `IRedbService` registered on it or in its container, and no name) fails at the first reserved tool call with a message naming `AddRedbLlmStorage` and what is missing. - Reservations made before the upgrade are not found afterwards where they are not kept by this rule: those without a name (they sat in the host's repository), and, for an agent with a name, those made before the name was followed. A run that crosses the upgrade and retries a tool call it had reserved, or had completed, before finds no reservation and runs the tool again, so a tool with side effects can act twice for such a run. Let the agent runs finish before the upgrade (stop the `llm:` consumers and wait for the open runs), then roll the nodes. The old entries in the host's repository are not read again; its TTL, if one is set, removes them. ## 4.7.5 ### An IBM MQ consumer with a backout threshold needs somewhere to put a poison message A transacted IBM MQ consumer with a backout threshold (the `backoutThreshold` option, or the input queue's BOTHRESH) and neither a backout queue (`backoutQueue`, or the queue's BOQNAME) nor a dead letter queue on the queue manager (DEADQ) no longer starts. It fails with: ```text IBM MQ consumer on '': a backout threshold of is in force, but there is neither a backout queue (backoutQueue, or the queue's BOQNAME) nor a dead letter queue on the queue manager (DEADQ): a poison message would have nowhere to go. ``` Before, such a consumer started, and a message over the threshold was redelivered through the route without end. What to configure, one of: - `backoutQueue=` on the endpoint, or BOQNAME on the input queue (`ALTER QLOCAL() BOQNAME()`); - a dead letter queue on the queue manager (`ALTER QMGR DEADQ()`): a poison message then goes there behind a dead letter header; - or no threshold at all (BOTHRESH 0 and no `backoutThreshold`), with an error handler in the route that decides what happens to a message that keeps failing. A consumer that already had `backoutQueue` set behaves as before, and now also honours the queue's own BOTHRESH and BOQNAME when the endpoint sets neither. ## 4.7.0 ### An unclosed `${` is an error A `${` that no `}` closes used to be read as plain text, or as an empty value when a later `}` closed it by accident (`${a ${b}` gave nothing). It now fails where the template is compiled: ``` unclosed '${' at position 6 of "text ${body": the placeholder has no closing '}'. ``` A route file fails to load with that message at the element's position, and `check` / `pack` report it as an error at the attribute. In C#, the `StringExpression`, `SetBody`, `SetHeader` or endpoint option that holds the template throws when the route is built. To find offenders before upgrading, run `check` over the route files and search code for `${` without a closing `}`. A literal `${` is written `\${`. `ExpressionResolver.IsTemplate` now returns `true` for a string with an unclosed `${` (it returned `false`), so a caller that branches on it sends such a string to the compiler and gets the error. ### An unended string literal is an error A quoted literal that never closes (`header.kind == 'order`) used to be read cut short by one character, silently. It now fails where the expression is compiled, at load for a route file: ``` unterminated string literal starting at position 13 within the expression "header.kind == 'order". ``` Close the quote. A literal that needs a quote character inside writes it escaped: `'it\'s'`. ### `AND` and `OR` short-circuit The right side of `AND` / `&&` and `OR` / `||` used to be evaluated even when the left side already decided. It now runs only when it matters, as in C#. The results are the same; what stops is a side effect on that right side (`header.n++`, a `bean:` call) and an error it would raise. A route that relied on such a side effect running moves it out of the condition. `XOR` still evaluates both sides. `??` follows the same rule: its right side runs only when the left side is `null` (it used to run always in a compiled expression). The value is unchanged. ### A payload template's `expr(...)` evaluates its text `expr(x)` in a payload template, and `ExpressionResolver.ResolveExpression`, now read `x` exactly as the inside of a `${x}` hole. They used to evaluate it only when it held an operator written with spaces, a function call or an index, and passed any other text through as it was. So `expr('1>0')` gave the text `1>0`, `expr('42')` the text `42`, and a `bean:` call came back unevaluated. Now the text is an expression: a quoted literal gives its content (`expr("'yes'")` gives `yes`), a number or a boolean keeps its type, and a comparison is evaluated with or without spaces. A bare word or a path with `/` or `.` is a lookup, as in a `${}` hole, and gives empty when nothing answers (`expr('application/json')`); an unquoted `jpath`/`xpath` path is allowed, as in a hole. A constant belongs in the template text, not in `expr(...)`. ### Incrementing a value that is not a number is an error An increment or decrement of a header or property that holds something other than a number (`'abc'`) used to treat it as 0 and overwrite it with 1 or -1, silently. It now fails with `header.x++: the value 'abc' (String) is not a number.` and leaves the value as it was. A missing value still starts at 0, and a numeric text (`'7'`) still counts. ### Comparing numbers of different types A comparison of two numbers of different types, or of a number with a numeric text, used to be true whenever the left value was the smaller one: with `header.qty` = 3 (an `int`), `header.qty == 5.0` and `header.qty == '5'` were true. Such pairs are now equal only when their values are equal. This applies to `==`, `!=`, `in`, `not in` and `.contains(...)` on a collection. What to look for: filters, `when` branches and validations that compare an `int` or `long` header with a decimal literal (`5.0`), with a quoted number (`'5'`) or with a number read from text (a JSON, XML or form field). Their outcome may change, and the new one is the correct one. Same-type pairs (`int` with `int`, text with text) are unchanged. ### A method call on a value fails loudly Every expression is compiled and run by one engine now, so a method called on a value (`${header.s.toUpper()}`, `Expr("header.o.Check()")`, `header.o.Check(header.x)` in a condition) reads the same everywhere. These readings change: - A method that throws used to read as `null`; it is now an error naming the call, its position and the exception: `header.o.Boom() at position 1 threw InvalidOperationException: boom`. - A method the value's type does not have used to read as `null`; it is now an error naming it: `'nosuch' is not a method of String at position 1 (in header.s.nosuch())`. - A method call inside a comparison (`header.s.length() > 10`) used to fail to compile; it now works. - A bare `exception.Message` used to be the text itself; it now reads the exception's message, as `${exception.Message}` always did (`null` when there is no exception). A value that is `null` still gives `null` (`header.missing.toUpper()`), and text that is not an expression is still the text itself (`hello`, `plain text`, `key=value`). What to look for: expressions, templates and conditions that call methods of headers, properties or the body and silently relied on a `null` when the call failed. To keep a text that looks like a call, quote it (`'header.o.Check()'`) or set it as a constant. ### A format suffix in a placeholder formats A placeholder that ends in a colon and a standard .NET format, `${header.total.CostUsd:F4}`, used to drop the suffix silently and write the plain value (`0.125`). It now formats the value as `format(value, 'F4')` does, with the invariant culture (`0.1250`). The suffix is one letter and up to two digits (`F2`, `N0`, `D8`) after a path or a call. What to look for: templates with `:F`, `:N` or `:D` before the closing brace, such as log lines and messages that show amounts. Their text now carries the decimals the author asked for. To keep the old output, drop the suffix. ### `ExpressionSandboxViolationException.TargetType` can be null A `ref:name` or `env:NAME` refused in a template's sandbox calls no method, so the exception's `TargetType` is `null` for it (the type is now `Type?`) and `Written` holds the spelling. Code that catches the exception and reads `TargetType` checks it before use; a build with nullable warnings as errors points at such a read. ### Text after a complete expression is an error The engine used to stop where an expression was complete and drop the rest: `header.b == 3 garbage` compared `header.b == 3`, and `${exception.type|message}` rendered empty. Now the rest fails the route when it is built, naming it: `unexpected '|' at position 15 within the expression: the expression ends before it.` `check` and `pack` report it as an error at the attribute, where they used to warn. What moves: - trailing text after an expression, in `${...}`, in an expression attribute and in a condition: remove it, or quote it as text (`'garbage'`); - a file key in capitals in a template, `${FILE:NAME}`: the message says `file keys are lowercase: ${file:name}` (in the file components' own options, such as `moveTo`, capitals still work); - an Apache Camel spelling the language does not know, such as `${exception.type|message}` or `${a ${b}}`: write it in this language (`${exception.Message}`); - `${header.x y}` with a space in the name part: it is an expression now, and one that does not compile is the error. A one-word name (`${header.Content-Type}`, `${header.user.name}`) still reads the header; - `expr(...)` of a payload template with plain text (`expr('plain text')`): quote the text, `expr("'plain text'")`. Text with no operator in a value position is unchanged: `plain text` and `header.b 3` still read as the text itself, and `check` warns about the second, since in a condition it is always true. ### File keys in consumer options resolve or fail The file consumers' options `moveTo`, `preMove`, `moveFailed`, `doneFileName` and `idempotentKey` (File, FTP, SFTP) and S3's `doneFileName` used to know only `${file:name}` and `${file:name.noext}`. Any other key stayed as written: `moveTo=done/${file:ext}` moved files into a directory literally named `${file:ext}`. Now every key of the file language resolves (`${file:ext}` gives `csv`, `${file:parent}`, `${file:size}`, `${file:modified}` and the rest), and a key that is not one of them fails when the endpoint is created, listing the keys. Keys still match ignoring case in these options. What to look for: a directory under the polled one whose name starts with `${file:`. Rename or move its files where the option now puts them, or fix the key the error names. The file producers' `tempFileName` (File, FTP, SFTP) takes the same keys, read from the file being written: `tempFileName=${file:name}.part` writes `order.xml.part` and renames it to `order.xml`. Before, every key stayed as written, so all writes shared one temp file literally named `${file:name}.part`. A value without keys is unchanged; an unknown key fails when the endpoint is created. What to look for: a leftover file whose name starts with `${file:` in a target directory, left by a write that stopped halfway. Delete it. Firebase Storage's `moveAfterRead` and `moveFailed` take the same keys, read from the object, and stay prefixes: the object name follows them. A prefix with a `${file:...}` in it used to be written as is. What to look for: objects whose name starts with `${file:`; move them where the prefix now puts them. A subclass of `GenericFileConsumer` that moves files itself: override `PostProcessAsync(GenericFileInfo, string, CancellationToken)` and `OnProcessingFailedAsync(GenericFileInfo, string, CancellationToken)` to see the size and the time of the file. The forms with `(filePath, fileName, basePath)` still work: the consumer calls them for a subclass that overrides them. ### Bare text that breaks off as arithmetic is an error In an expression (`expr=`, `Expr(...)`, a condition), a text with `+`, `-`, `*` or `/` outside quotes is arithmetic. It used to be computed from whatever pieces could be read: `1 +` gave `1`, `header.a+b` gave `2b`, and a text such as `application/json` gave `null`, silently. Now such a text must be whole arithmetic, or it fails where the route is built, naming the place: - `1 +`: `the expression ends after '+' at position 3, where a value is expected` - `header.a+b`: `'b' at position 10 is not a value: write header.b, property.b or the text 'b' in quotes` - `header.Content-Type`: `'header.Content-Type' at position 1 reads as a subtraction: a name with a dash is written ${header.Content-Type}` What to look for: an expression attribute or `Expr(...)` holding text that looks like a MIME type (`application/json`), a path (`some/path/file.txt`) or a parameter list (`text/plain; charset=utf-8`). Write such a text in quotes (`expr="'application/json'"`), or as a constant (`value="application/json"`, `.SetHeader("k", "application/json")`). A dashed name goes inside `${...}`. Text without an arithmetic operator is unchanged: `hello` and `key=value` still read as the text itself. ### `AstNode.Evaluate` runs the compiled expression Code that parses an expression itself (`new Parser(new Tokenizer(text).GetAllTokens()).Parse()`) and calls `Evaluate` on the tree now gets what the engine gives for that text: the tree is compiled once and the compiled delegate runs. It used to be a separate evaluator, in which `++` / `--` did not write back and method calls on values were not supported; an expression that does not compile now throws `ExpressionCompilationException` on the first `Evaluate`. ### IBM MQ `connectionFactory` connects through the registered factory `wmq:` endpoints with `connectionFactory=name` used to ignore the registered `IbmMqConnectionFactory`: the name only split the connection pool, and the connection was built from the inline options on the URI or their defaults (`localhost:1414`, `DEV.APP.SVRCONN`, `QM1`, no credentials). Now the registered factory is the connection, and it takes priority over the inline options; a name nothing is registered under stops the route when it starts. What to look for: `wmq:` URIs (and `IbmMqDsl` builders) with `connectionFactory=`. What to do: make the registered factory hold the host, channel, queue manager and credentials the endpoint should use (the inline values on the same URI no longer count), or remove `connectionFactory` and keep the inline options. ### An XSD file reads its imports `` and `validator:schema.xsd` used to read the file as text, so its `xs:import` and `xs:include` had no location: each one was skipped without a word, and a schema that used an imported type failed with "Type … is not declared". Now the schema is read from its file and its imports and includes resolve relative to it, from under `schemaRoot` (the schema's directory unless set). Inline content and `ValidateXsd(string)` read one schema as before. Three things change for a file schema that loaded before: - **An import that does not load is an error.** One that is not found, lies outside `schemaRoot` (an absolute `file:` path included) or points to the network (`http://www.w3.org/2001/xml.xsd`) used to be skipped when the schema did not use it; now the route fails to start, naming the reference. What to look for: `schemaLocation=` in the schema and in the files it imports. What to do: copy the referenced files into the package, point `schemaLocation` at them, and set `schemaRoot` when they sit above the schema's directory (`..` for UBL's `maindoc/`). - **Lax wildcards are validated.** An `xs:any processContents="lax"` over a namespace whose schema is now imported checks the elements there against their declarations; before, no declaration was known and anything passed. What to look for: `processContents="lax"` in the schema. What to do: fix the documents the validator now rejects, or narrow the wildcard's `namespace=`. - **Generated code keeps the file.** `redb-route-xml` writes `` as `ValidateXsdFile("…", …)` instead of `ValidateXsd(…)` with the file's text inlined, so the generated project needs the schema files at runtime, found through the context's resource resolver as for `xslt`. What to do: ship the schema directory with the project, or regenerate after moving it. ### A mail whose exchange fails is left as it is `imap://` and `pop3://` used to apply `postProcess` to every message whose exchange returned, also when it carried an unhandled exception or was marked rollback-only with `.RollbackAll()`: under `postProcess=Delete` a failed mail was deleted, under the default `MarkRead` it was marked read. Now they follow Apache Camel's mail consumer. Only a successful exchange is committed (`postProcess`, `moveTo`, the headers `redbMail.Delete`, `redbMail.MoveTo` and `redbMail.CopyTo`); a failed one leaves the message as it is. A handled exception (`OnException(...).Handled(true)`, a dead letter channel) is a success, as before. `peek` now does what Camel's does, and its default is `true`. - **IMAP: a failed mail stays unseen and is fetched again.** With `fetchFilter=Unseen` (the default) it is routed again on every poll until its exchange succeeds. What to look for: `imap://` routes that leave failures unhandled and relied on `postProcess` to mark failed mails read or delete them. What to do: handle the failure; the exchange then commits like any success. Under the default `MarkRead` that is all: the mail is marked read and not fetched again. Under `postProcess=Delete` it would be deleted, so set `redbMail.Delete=false` in the handler to keep it, marked read. Or set `peek=false`, which marks each mail read when it is fetched, so a failed one stays read without a handler. - **POP3: a failed mail stays on the server and is routed again on every poll.** POP3 has no read flag, so `peek` does not apply. The mails after it are still routed and deleted. What to look for: `pop3://` routes that leave failures unhandled. What to do: handle the failure (under `postProcess=Delete` the mail is then deleted; with `redbMail.Delete=false` it is kept and fetched again). To route a kept mail only once, set `idempotentRepository` to a persistent repository with `idempotentRepositoryRemoveOnCommit=false`: its key is confirmed when the exchange commits and the mail is skipped whenever it is fetched again. A failed exchange releases the key, so the failed mail is still routed again. - **An explicit `peek=false` now marks mails read at fetch.** It used to have no effect. What to look for: `peek=false` on `imap://` URIs. What to do: remove it to keep mails unseen until their exchange is committed. ### A step on the side its component lacks fails when the route is built Some components have one side only (Apache Camel's `producerOnly` / `consumerOnly`): bean, cache, embed, fcm, knowledge, log, mcp, smtp, sns, stt, validator and xslt only send; imap, pop3, timer, cron and qtimer only receive. A route that started from a send-only component failed when the context started; a step that sent to a receive-only one failed only when the first exchange reached it, so a route with such a step in a branch never taken ran without a word. Now the mistake fails when the route is built or loaded, in one message: "timer has no producer side: a route cannot send to it (timer is consumer-only). Use it as a From() source." - **XML:** the loader refuses the route with the position of the step, in both the `uri=` and the structured form, and `check` reports it (the core components always, the connectors with `--bin`). - **C#:** a static target (`To`, `WireTap`, `Enrich`, `PollEnrich`, the endpoints of a load balancer or a scatter-gather) fails the route build, so `Start()` throws (`ThrowOnCompilationError`, the default) or the route is skipped and logged. A `From` on a send-only component throws at `Start()` as before. - **Dynamic targets** (`ToD`, `RecipientList`, `RoutingSlip`, `DynamicRouter` with a computed URI) still fail on the exchange, with the new message. - The exception is `NotSupportedException`, as before; its text is the new one. What to look for: one of the send-only schemes in `` or `From(...)`, or one of the receive-only schemes as a target, in particular in a branch that is rarely or never taken; and code that matches the old exception texts. What to do: remove the step, or use the scheme the message's hint names. ### A mail option the other side reads is refused `imap://`, `pop3://` and `smtp://` share one set of options. An option only the other side reads used to bind and do nothing: `subject` on an `imap://` URI, `postProcess` on an `smtp://` one. Now the endpoint refuses it when it is created, naming the parameters and never their values: "smtp producer 'smtp://mail.example.com' sets postProcess: only an imap or pop3 consumer reads it." A consumer option on `smtp://` is no longer validated either: `delay=-1`, `maxMessages=-1` or `postProcess=Move` without `moveTo` used to fail an smtp endpoint with a consumer's reason, and now the refusal names the option. What to look for: - `smtp://` URIs (and `Smtp.Send(...)` builders) that carry `folder`, `additionalFolders`, `delay`, `initialDelay`, `fetchFilter`, `maxMessages`, `postProcess`, `moveTo`, `sortBy`, `idle`, `idleTimeout`, `fetchBody`, `fetchAttachments`, `maxAttachmentSize`, `peek`, `idempotent`, `searchQuery`, `minAge`, `maxAge`, `subjectFilter`, `fromFilter`, `mapMimeHeaders` or `keepRawMessage` (and the 4.7 additions `delete`, `copyTo`, `idempotentRepository`, `idempotentRepositoryRemoveOnCommit`); - `imap://` and `pop3://` URIs (and `Imap.Read(...)` / `Pop3.Read(...)` builders) that carry `from`, `to`, `cc`, `bcc`, `replyTo`, `subject`, `contentType`, `alternativeBody` or `attachments`. What to do: remove the option; it had no effect on that side. ## 4.5.0 ### A Redis consumer starts only when it receives A `redis:` consumer (SUBSCRIBE, PSUBSCRIBE, XREAD, XGROUP, BLPOP, BRPOP) now subscribes, creates its consumer group and pins its XREAD position before `Start()` returns. Before, it did that in the background after the route had started: a message published or an entry added in between was lost, and a Redis that was down at start left a consumer that looked started and never received anything, with an error in the log only. What the operator sees now: when Redis does not answer at start, the route, and with it the context, fails to start with `InvalidOperationException: Redis consumer redis:: cannot start, Redis did not answer: ...`. In a Tsak worker the context shows as failed instead of running. Check that Redis is reachable from the worker before the context starts. Once a consumer has started, a later outage is handled as before: StackExchange.Redis reconnects and subscribes again. Start waits up to the connect and command timeouts of the connection (5 s each by default) before it gives up. ### An AMQP consumer starts only when the broker accepted its link An `amqp:` consumer now waits in `Start()` until the broker has answered every receiver link it attaches, as it did for `dynamic=true` only. Before, a link the broker refused (an address it does not serve, a routing type the address does not have, no permission to read it) was logged by the receive loop, and the consumer looked started and never received anything. On a MULTICAST address the subscription is the link itself, so it is now in place when `Start()` returns. What the operator sees now: the route, and with it the context, fails to start with `InvalidOperationException: AMQP consumer amqp:
cannot start: the broker refused the receiver link (: ).`, or `... the broker did not answer the receiver link within s.` after the endpoint's `timeout` (30 s by default). In a Tsak worker the context shows as failed instead of running. Fix the address, the routing type or the permissions the message names. ### An MQTT publish goes to its endpoint topic An `mqtt:` publish no longer reads `redbMqtt.topic` as its target. The connector writes that header itself, with the topic a message was received on and the topic of every publish, so a second publish in a route went to the first topic, and a received message republished to `mqtt://alerts/...` went back to the topic it came from. A route that set `redbMqtt.topic` to choose where a publish goes sets `redbMqtt.overrideTopic` (`MqttHeaders.OverrideTopic`) instead; `redbMqtt.topic` stays readable as the topic of the last receive or publish. ### An MQTT publish takes its endpoint QoS and retain flag An `mqtt:` publish no longer reads `redbMqtt.qos` and `redbMqtt.retain`. The consumer writes them with the QoS and retain flag of the received message, so a republished message kept the QoS it arrived with, and a retained message was retained again on the new topic. A publish now uses the endpoint's `qos`, `qosExpression` and `retain`. A route that set `redbMqtt.qos` or `redbMqtt.retain` to choose them sets `redbMqtt.overrideQos` (`MqttHeaders.OverrideQos`: 0, 1 or 2) or `redbMqtt.overrideRetain` (`MqttHeaders.OverrideRetain`: true or false) instead, as a number or bool from C# or as text from markup (``). Another value fails the publish. A route that wants a republish to keep the incoming flags copies them over: `exchange.In.Headers[MqttHeaders.OverrideRetain] = exchange.In.Headers[MqttHeaders.Retain];`. The MQTT 5 properties (`redbMqtt.contentType`, `redbMqtt.responseTopic`, `redbMqtt.correlationData`, `redbMqtt.messageExpiryInterval`, `redbMqtt.userProperties`) still pass through to a publish. ### XML structure limits XML that redb.Route reads from outside goes through `SafeXml`, and `SafeXml` now checks the structure of a document while it reads it. A document over a limit is refused with `XmlLimitException`, an `XmlException`, before it is built. The limits every caller gets: | Limit | Default | |---|---| | Nesting depth, the root counting as 1 | 256 | | Attributes on one element, namespace declarations included | 1024 | | Namespace declarations on one element | 256 | Size, element count and namespace declarations in the whole document are not bounded by default. These limits apply to XPath over a message body, the SOAP receiver and sender, Route-XML markup and templates. A document deeper than 256 levels used to be read and is refused now; search for such documents (generated XML, recursive structures) before upgrading. Code that reads XML through `SafeXml` itself can pass its own `XmlLimits`: `SafeXml.Parse(xml, XmlLimits.Default with { MaxDepth = 1024 })`. **SOAP receiver.** A request is checked once against these limits before anything parses it, and again after the body is decrypted; a request over a limit is a `Client` / `Sender` fault naming the limit. The request body is now bounded by `maxRequestBodySize`, 100 MB by default; it was not bounded before. `maxRequestBodySize=0` restores no bound. **AS4 receiver and sender.** The envelope has tighter limits, the shape of an eDelivery envelope: depth 32, 32 attributes and 16 namespace declarations on an element, 4096 namespace declarations in the envelope, and `maxEnvelopeCharacters` as before. A received envelope over them is a SOAP `Sender` fault; a partner's answer over them is an invalid receipt. A message must carry exactly one `xenc:EncryptedKey`, and each payload is decrypted once; anything else is `EBMS:0102`. Domibus, Holodeck B2B and this connector send messages well within all of this. ### AS4 refusals in their own counter An AS4 receiver used to count every message it refused (a malformed envelope, a failed signature or decryption, a message the agreement does not allow) in `Errors`, so a partner with a broken configuration turned the route red. These are now counted in `IEndpointStatistics.Refused`, with the reason of the last one in `LastRefusalMessage`, and no longer in `Errors`, the last error or health. `EBMS:0004` (a failure on our side) and route failures stay errors. An alert that watches `Errors` of an AS4 receive endpoint for refused messages should watch `Refused` instead; in a route, `stats('current', 'refused')`. ### `attachments` in an expression A bare `attachments` in an expression (`${attachments}`, `attachments.size`) now reads the attachments of the In message, as `${attachments}` does in Camel Simple. It used to fall back to an exchange property of that name, for example the list an `smtp:` route put in `exchange.Properties["Attachments"]`. An expression that meant the property writes `property.attachments`. ### Mail and SOAP attachments are message attachments `smtp:`, `imap:`, `pop3:` and `soap:` now work with the message attachments, `exchange.In.Attachments` (see the README, "Attachments"). The old conventions are removed with no transition period. **Nothing warns you.** `smtp:` no longer reads the exchange property `Attachments`. That property is an ordinary property now, so a route still setting it gets no error, and its mail goes out **without the files**. Search the code for `Properties["Attachments"]`, `MailAttachment` set on an exchange property, `SoapHeaders.Attachments`, `redbSoap.attachments`, `SoapHeaders.HasAttachments`, `redbSoap.hasAttachments` and `SoapAttachment`, and migrate each one as shown below. **Mail: files from code, before `smtp:`.** ```csharp // before exchange.Properties["Attachments"] = new List { new("orders.zip", zip, "application/zip") }; // after exchange.In.Attachments.Add(new Attachment { Name = "orders.zip", FileName = "orders.zip", ContentType = "application/zip", Content = AttachmentContent.FromBytes(zip) }); ``` **Mail: file paths, before `smtp:`.** ```csharp // before exchange.Properties["Attachments"] = new List { @"C:\out\report.pdf" }; // after: the file is read when the mail is sent exchange.In.Attachments.Add(new Attachment { Name = "report.pdf", FileName = "report.pdf", ContentType = "application/pdf", Content = AttachmentContent.FromFile(@"C:\out\report.pdf") }); // or a route step: .AddAttachmentFromFile(@"C:\out\report.pdf", contentType: "application/pdf") ``` The `attachments=` endpoint option (comma separated paths) stays as it was. **Mail: received mail.** `imap:` and `pop3:` also put the attachments of a mail on the message attachments. `MailMessageBody`, its `Attachments` and the `redbMail.*` attachment headers stay as they were, so routes reading them need no change. Two behaviors are new: a received mail sent on to `smtp:` carries its attachments (before, they were dropped), and its text (`MailMessageBody` converts to its text; before, the type name was sent as the text). **SOAP: sending attachments (producer, or a consumer reply).** ```csharp // before msg.Headers[SoapHeaders.Attachments] = new List { new("doc-1", "application/pdf", pdfBytes) }; // after msg.Attachments.Add(new Attachment { Name = "doc-1", ContentId = "doc-1", ContentType = "application/pdf", Content = AttachmentContent.FromBytes(pdfBytes) }); ``` A consumer route that replies with attachments replaces the request ones: `e.In.Attachments.Clear()`, then `Add`. As before, a reply that still holds exactly the request attachments is sent without them. **SOAP: reading attachments.** ```csharp // before var parts = e.In.GetHeader>(SoapHeaders.Attachments); byte[] bytes = parts![0].Content; bool any = e.In.GetHeader(SoapHeaders.HasAttachments); // after var part = e.In.Attachments.Find("doc-1"); // named by the Content-ID byte[] bytes = part!.Content.ReadAllBytes(); bool any = e.In.Attachments.Count > 0; // in an expression: attachments.size > 0 ``` `SoapAttachment.ContentId`, `ContentType` and `Content` map to `Attachment.ContentId` (also its `Name`), `ContentType` and `Content.ReadAllBytes()`. A producer reply's attachments are on `exchange.Out.Attachments`, and on `In` after the pipeline moves on. ## 4.4 ### Unknown URI options stop the context `direct-vm:` now reads its URI parameters, and it reads them strictly, like every connector that is not lenient. Before 4.4 it ignored every parameter, so a URI such as `direct-vm://orders?inOut=true` started without a word. In 4.4 the endpoint refuses such a parameter, and the context fails to start: ``` System.ArgumentException: 'inOut' is not an option of the DirectVm endpoint. ``` `direct-vm:` has one option, `headerFilterStrategy=#name`, and it applies to the caller side only. Drop anything else from its URIs. A direct-vm call always returns the reply to the caller, so `inOut=true` was never needed. Options taken from Apache Camel's direct-vm (`block`, `timeout`, `failIfNoConsumers`, `propagateProperties`) are refused the same way. This is the rule that every strict connector has followed since 4.2.0. An application that comes from a version before 4.2.0 meets it on every connector except `http:`, `sql:` and `bean:`, which take extra parameters on purpose: - **An unknown name** is refused with `'' is not an option of the endpoint.`, followed by the nearest option (`Did you mean 'period'?`) or by the connector's note on what replaced it. - **A value that does not convert** is refused with `'