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&lazyProducerShutdown Ordering: Tracked active in-flight exchanges inDirectConsumersoStop()waits for active deliveries to complete before stopping downstream processors and producers. ProtectedWireTapWaitGroupoperations under async.RWMutexwith astoppedflag andCompleteExchangecompletion, and preventedlazyProducerfrom recreating and leaking producers afterRoute.Stop().Seda,Chan& ConcurrentPollEnrich: Closed the race window betweenSend()andStop()so exchanges enqueued concurrently with shutdown are drained rather than stranded. Replaced the booleanpollingflag onSedaEndpointandChanEndpointwith a reference counter so concurrentPollEnrichcallers 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), andmap[string][]byte(Zip/TarGz). AddedExchange.deepCopyWithoutInBody()so parallelSplitteravoids $O(N^2)$ body cloning, and applied deep copying inMemoryClaimCheckRepositoryandSagaState.clone(). - Consumer & Management Lifecycle (
timer,net,http,management): Addedstoppinglifecycle guards under mutex to preventStart()/Stop()overlap duringWaitGroup.Wait(), replaced one-shotsync.Onceteardown inHTTPConsumerandManagementServerto support clean restarts, closed TCP/UDP listeners viacontext.AfterFuncon context cancellation, and stoppedManagementServerfirst duringCamelContext.GracefulStop(). - EIPs (
Aggregator,Resequencer,DeadLetterChannel,ContentEnricher,CircuitBreaker): PreventedAggregator.timeoutWGreuse races whenStop()runs without configured timeouts, tracked synchronous and asynchronousResequencer.deliver()executions intimeoutWG, invokedCompleteExchangeon timed-out, resequenced, and enriched exchanges, cleaned upDeadLetterChannel.synchronizedentries on retry exhaustion or cancellation, and scopedCircuitBreakerstate transitions to the state observed at call start.
Component & Observability Improvements
telegram: GuardedTelegramConsumer.Start/Stopwith a mutex and per-startsync.OnceonStopReceivingUpdates()(preventing double-Stop()panics), drained buffered updates on exit to preventtgbotapigoroutine leaks, and rejectedTelegramProducer.Send()afterStop().mail: Released mutex locks before blocking IMAP/POP3 network I/O, honoredctxduring connection establishment, enforced socket deadlines and forced connection close duringStop()to unblock stalledidle.Wait()/Logout().Wait()calls, and preventedrunWithIdlefrom falling back to polling during shutdown.cron: SynchronizedCronComponent.scheduleraccess acrossStart()/Stop(), waited for running jobs outsideCronComponent.mu, and ensuredCronConsumer.Stop()always cancels its startup context and waits onstartWGeven whenpauseJob=true.kafka: Delayedreader.Close()inKafkaConsumer.Stop()until afterwg.Wait()and committed in-flight processed offsets using a boundedcontext.WithoutCancel(ctx)timeout; added reference counting (writerUsers) toKafkaEndpoint.writerand closed the writer outside the endpoint mutex.redis: VerifiedPing(ctx)inRedisProducer.Start()before publishingp.connection, and replaced one-shotstopOnceonRedisConsumerwith mutex-protectedstarted/stoppingstate.grpc: BoundedGracefulStop()with the endpoint timeout (falling back toserver.Stop()), observedctx.Done()inGRPCConsumer.Start(), and synchronized access toserverandlistener.file,ftp,sftp&smb: Cancelled theWaitForStablecontext onFileConsumer.Stop(), checkedctx.Err()across directory walks and file loops indoPoll, synchronized consumerStart()/Stop(), preventedFTPProducer/SFTPProducer/SMBProducerfrom dialing and leaking persistent connections afterStop(), and enforced a deadline on SMB handshakes.nats&stomp: Held thestoppingstate acrosswg.Wait()andcloseConn()inStop(), usedMustDisconnect()in STOMP to avoid deadlocks on broken connections, bounded permanent STOMP ACK retry loops, and verifiedp.startedinProducer.Send().mongodb,ollama,openai,anthropic&jev: Synchronized producer lifecycle state undersync.RWMutex, returned an error instead of nil-pointer panicking whenMongoDBProducer.Send()is called beforeStart(), and reset producer state onStop().observability/otel: Preservedexchange.Contextwhennext(exchange)returnsErrStopRouting, preventing data races when exchanges are parked asynchronously by anAggregator.
See the CHANGELOG for the full list of changes.