v0.18.0

Version v0.18.0, dated October 16, 2026, introduces the TypeSafe Jev decision component and comprehensive security, concurrency, and reliability remediations across the core routing engine, components, and observability modules. Every component and observability module at v0.18.0 requires core v0.18.0.

Jev Decision Component

The new Jev component (components/jev, jev:decisions) integrates the TypeSafe Jev decision model through the OpenRouter Decisions API (/api/alpha/decisions). It operates as a producer-only component with zero third-party dependencies:

  • The exchange body contains the state to evaluate.
  • Questions are specified via the questions URI parameter (JSON, with question types noul, choice, or score).
  • Structured answers are returned as map[string]jev.Answer in the message body.
  • Supported options: apiKey (falls back to OPENROUTER_API_KEY, masked in URI()), model (defaults to typesafe/jev-1.13), baseURL, timeout, and allowHeaderOverride (for JevQuestions and JevModel header overrides).
  • Payload and error responses are bounded to protect against memory exhaustion.
import (
    "github.com/tranchida/gocamel"
    jev "github.com/tranchida/gocamel/components/jev"
)

ctx := gocamel.NewCamelContext()
ctx.AddComponent("jev", jev.NewJevComponent())

_, err := ctx.CreateRouteBuilder().
    From("direct:decide").
    To("jev:decisions?questions=[{\"id\":\"approve\",\"type\":\"noul\",\"question\":\"Should this transaction be approved?\"}]").
    ProcessFunc(func(e *gocamel.Exchange) error {
        answers := e.GetIn().GetBody().(map[string]jev.Answer)
        log.Printf("Approved: %v", answers["approve"].Bool)
        return nil
    }).
    Build()

Security & Hardening Remediations

  • WinZip AES Deflate HMAC Verification: Enforced strict HMAC-SHA1 verification and premature EOF validation on deflate and store streams (aesDeflateReadCloser and aesStoreReadCloser) in ZipDataFormat, closing authentication bypass risks on truncated archives.
  • Path Traversal Protection: Enforced ValidatePath and ValidateRemotePath checks on move and moveFailed post-processing parameters in file, ftp, sftp, and smb. SFTP directory consumer now skips symbolic links during recursive scans.
  • Dynamic Routing Injection Protection: Eliminated second-pass interpolation in RecipientList, RoutingSlip, and DynamicRouter, ensuring dynamic recipient expressions evaluate safely in a single pass.
  • Resource Protection & Bounded Reads: Replaced unbounded readers in bodyToBytes, normalizeJSONSource, CSVDataFormat, and remote file producers (FTPProducer, SFTPProducer, SMBProducer) with ReadLimited bounded by DefaultMaxBodySize.
  • Simple Language Hardening: Bounded padstart, padend, and regex evaluation input lengths by MaxSimpleInputBytes, and hoisted package-level compiled regular expressions.
  • Credential Redaction: Added passcode to default sensitive URI keys for automatic masking in STOMP endpoints.

Concurrency & Lifecycle Improvements

  • Connection Leasing: Added exclusive connection leasing (connCh) to SFTPProducer and SMBProducer to eliminate data races during concurrent message processing and endpoint shutdown.
  • Connection Reference Counting: Added connUsers reference counting to shared connections in grpc, nats, and stomp endpoints, preventing premature connection teardown while active producers or consumers are using them.
  • Redis Consumer Cleanup: Properly closed pubSub and released Redis clients on consumer start subscription errors.
  • Mail Hardening: Safe quoted-printable encoding with mime/quotedprintable.Writer, bounded MIME parts, and dial timeouts on IMAP/POP3 connections.
  • EIP Concurrency Safety: Adopted DeepCopy() in MemoryAggregationRepository and Resequencer to prevent exchange state mutations across concurrent aggregation branches.
  • Route Builder Error Preservation: Preserved the first build error in RouteBuilder and ChoiceBuilder.

Observability

  • OpenTelemetry Interceptor: Added TracingWith(tp) to configure custom TracerProvider instances, restored previous Exchange.Context on route exit, and set span status codes.Error on unhandled route errors.

See the CHANGELOG for the full list of changes.