v0.19.0

Version v0.19.0, dated October 31, 2026, delivers a comprehensive concurrency, goroutine lifecycle, and shutdown resilience overhaul across the core routing engine, optional components, and the OpenTelemetry interceptor. Every component and observability module at v0.19.0 requires core v0.19.0.

Core Concurrency & Lifecycle Hardening

  • DirectConsumer, WireTap & lazyProducer Shutdown Ordering: Tracked active in-flight exchanges in DirectConsumer so Stop() waits for active deliveries to complete before stopping downstream processors and producers. Protected WireTap WaitGroup operations under a sync.RWMutex with a stopped flag and CompleteExchange completion, and prevented lazyProducer from recreating and leaking producers after Route.Stop().
  • Seda, Chan & Concurrent PollEnrich: Closed the race window between Send() and Stop() so exchanges enqueued concurrently with shutdown are drained rather than stranded. Replaced the boolean polling flag on SedaEndpoint and ChanEndpoint with a reference counter so concurrent PollEnrich callers can poll the same endpoint simultaneously.
  • Extended Deep Copying & $O(N)$ Parallel Split: Extended deepCopyValue (Exchange.Copy / Message.DeepCopy) to clone []map[string]any (SQL), map[string]string, []map[string]string, [][]string (CSV), and map[string][]byte (Zip/TarGz). Added Exchange.deepCopyWithoutInBody() so parallel Splitter avoids $O(N^2)$ body cloning, and applied deep copying in MemoryClaimCheckRepository and SagaState.clone().
  • Consumer & Management Lifecycle (timer, net, http, management): Added stopping lifecycle guards under mutex to prevent Start()/Stop() overlap during WaitGroup.Wait(), replaced one-shot sync.Once teardown in HTTPConsumer and ManagementServer to support clean restarts, closed TCP/UDP listeners via context.AfterFunc on context cancellation, and stopped ManagementServer first during CamelContext.GracefulStop().
  • EIPs (Aggregator, Resequencer, DeadLetterChannel, ContentEnricher, CircuitBreaker): Prevented Aggregator.timeoutWG reuse races when Stop() runs without configured timeouts, tracked synchronous and asynchronous Resequencer.deliver() executions in timeoutWG, invoked CompleteExchange on timed-out, resequenced, and enriched exchanges, cleaned up DeadLetterChannel.synchronized entries on retry exhaustion or cancellation, and scoped CircuitBreaker state transitions to the state observed at call start.

Component & Observability Improvements

  • telegram: Guarded TelegramConsumer.Start/Stop with a mutex and per-start sync.Once on StopReceivingUpdates() (preventing double-Stop() panics), drained buffered updates on exit to prevent tgbotapi goroutine leaks, and rejected TelegramProducer.Send() after Stop().
  • mail: Released mutex locks before blocking IMAP/POP3 network I/O, honored ctx during connection establishment, enforced socket deadlines and forced connection close during Stop() to unblock stalled idle.Wait() / Logout().Wait() calls, and prevented runWithIdle from falling back to polling during shutdown.
  • cron: Synchronized CronComponent.scheduler access across Start()/Stop(), waited for running jobs outside CronComponent.mu, and ensured CronConsumer.Stop() always cancels its startup context and waits on startWG even when pauseJob=true.
  • kafka: Delayed reader.Close() in KafkaConsumer.Stop() until after wg.Wait() and committed in-flight processed offsets using a bounded context.WithoutCancel(ctx) timeout; added reference counting (writerUsers) to KafkaEndpoint.writer and closed the writer outside the endpoint mutex.
  • redis: Verified Ping(ctx) in RedisProducer.Start() before publishing p.connection, and replaced one-shot stopOnce on RedisConsumer with mutex-protected started/stopping state.
  • grpc: Bounded GracefulStop() with the endpoint timeout (falling back to server.Stop()), observed ctx.Done() in GRPCConsumer.Start(), and synchronized access to server and listener.
  • file, ftp, sftp & smb: Cancelled the WaitForStable context on FileConsumer.Stop(), checked ctx.Err() across directory walks and file loops in doPoll, synchronized consumer Start()/Stop(), prevented FTPProducer/SFTPProducer/SMBProducer from dialing and leaking persistent connections after Stop(), and enforced a deadline on SMB handshakes.
  • nats & stomp: Held the stopping state across wg.Wait() and closeConn() in Stop(), used MustDisconnect() in STOMP to avoid deadlocks on broken connections, bounded permanent STOMP ACK retry loops, and verified p.started in Producer.Send().
  • mongodb, ollama, openai, anthropic & jev: Synchronized producer lifecycle state under sync.RWMutex, returned an error instead of nil-pointer panicking when MongoDBProducer.Send() is called before Start(), and reset producer state on Stop().
  • observability/otel: Preserved exchange.Context when next(exchange) returns ErrStopRouting, preventing data races when exchanges are parked asynchronously by an Aggregator.

See the CHANGELOG for the full list of changes.