Skip to content
CAI
Software that uses CAICheck a score

Gerfey/messenger

65.0

Adequate · 21 September 2026

3.8k

lines of production code

Go

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Go-based messaging library that provides a unified API for building and managing message buses. It supports asynchronous and synchronous message routing across multiple transport backends, including AMQP, Redis, Kafka, and in-memory queues. The framework handles message serialization, middleware chaining, and automatic retry strategies for failed deliveries.

Features

Add Go-based messenger example with AMQP transport and logging middleware

A new Go example demonstrates the messenger framework by defining a handler for a 'Hello' message, configuring an AMQP transport with a connection pool and retry strategy, and registering a logging middleware. The example includes the necessary message and handler implementations, a YAML configuration file specifying the transport and routing, and a main entry point that builds the messenger, dispatches a message, and handles graceful shutdown.

examples/messenger · medium confidence

Add Kafka transport example with handler and configuration

An example demonstrating the use of Kafka as a message transport is added to the codebase. This includes a new handler (ExampleHelloHandler) that processes messages, a message definition (ExampleHelloMessage) with a specific routing key, and a YAML configuration file that defines the Kafka transport settings, including producer and consumer options. The main entry point wires these components together using the core builder, showcasing how to register a handler and dispatch a message through the Kafka transport.

_examples/kafka\transport · high confidence

Add Redis transport example with message handling

A new example demonstrates using Redis as a message transport. The example includes a handler that processes a 'Hello' message, a message struct defining routing, a YAML configuration specifying the Redis transport with retry and stream options, and a main program that builds the messenger, registers the handler, dispatches a message, and waits for processing.

_examples/redis\transport · medium confidence

Add example config for AMQP transport with retry strategy

Added an example configuration for the AMQP transport, including a YAML file (messenger.yaml) that defines the default bus, transport options (such as exchange and queue settings), and a routing rule. The Go example (config.go) demonstrates loading this configuration and printing transport details, including a new retry strategy with configurable max retries, delay, multiplier, and max delay.

examples/config · high confidence

Add in-memory transport for local message handling

Users can now use an in-memory transport for local message handling, allowing messages to be sent and received within the same process without external dependencies. This includes a factory for creating transports, configuration options, and a queue-based implementation that supports sending, receiving, and closing transports, along with comprehensive tests for these operations.

transport/inmemory · high confidence

Added AMQP and Redis transport implementations with benchmark tests

Introduced new transport implementations for AMQP (RabbitMQ) and Redis, each providing full producer, consumer, and connection management capabilities. The AMQP transport supports configurable exchanges, queues, and channel pooling, while the Redis transport utilizes streams for message delivery. Both transports include comprehensive benchmark tests to measure send performance under various conditions, including concurrent dispatches and varying message sizes.

transport/amqp · high confidence

Added Kafka transport with configurable producer/consumer settings

Users can now use Kafka as a message transport. The transport supports configurable topics, consumer groups, and producer options (such as async sending, batch size, and balancer strategy). It also allows configuring consumer behavior including offset strategies, commit strategies, and pool sizes. A benchmark test is included to measure performance.

transport/kafka · high confidence

Added example applications for sync and retry-based message transport

Added two new example applications, 'sync\_transport' and 'retry\_messenger', demonstrating the messenger framework's capabilities. The 'sync\_transport' example shows a basic synchronous message handling setup, while the 'retry\_messenger' example demonstrates asynchronous processing with automatic retry logic (up to 3 retries with exponential backoff) and failure event listening. Both examples use the core builder pattern and include YAML configuration files for transport and routing.

_examples/retry\messenger · high confidence

Added example code for envelope and stamp usage

Added new example files (envelope.go, stamp.go) demonstrating how to create envelopes, attach stamps, and retrieve stamp data using the generic API.

examples/envelope · high confidence

Added handler locator for message routing

Introduced a new \Locator\ component in \core/handler\ that manages message handlers by type. The \Locator\ registers handlers, validates their signatures (ensuring they accept a \context.Context\, a message, and return an error), and provides methods to retrieve handlers for specific message types. This includes support for multiple handlers per message type and bus name association.

core/handler · high confidence

Added message envelope implementation with stamp support

Introduced a new \Envelope\ struct in \core/envelope\ that wraps a message and an ordered list of stamps, providing an immutable API for building envelopes via \WithStamp\ and accessing contents via \Message()\ and \Stamps()\. The \stamps.go\ file adds generic helper functions (\StampsOf\, \FirstStampOf\, \LastStampOf\, \HasStampOf\) to filter and retrieve stamps by type. A comprehensive test suite in \envelope\_test.go\ validates the envelope's behavior, including immutability, stamp ordering, and generic filtering.

core/envelope · high confidence

Added message handling and sending middleware implementations

The core/middleware/implementation directory now contains the concrete middleware components for the messaging system. This includes \HandleMessageMiddleware\ to locate and execute registered handlers for incoming messages, \SendMessageMiddleware\ to route outgoing messages to configured senders/transports, and supporting middlewares like \AddBusNameMiddleware\ and \AddMessageIDMiddleware\ to enrich envelopes with metadata. Comprehensive unit tests have been added for these components to verify correct message processing, error handling, and logging behavior.

core/middleware/implementation · high confidence

Added message stamp types for tracking message lifecycle and metadata

The core/stamps package now includes new structs to track message metadata and lifecycle events. These include BusNameStamp, DelayStamp, ErrorDetailsStamp, HandledStamp, MessageIDStamp, ReceivedStamp, RedeliveryStamp, RoutingKeyStamp, SentStamp, and TransportNameStamp. These additions support the redesigned message routing system and error handling by providing structured data for tracking message properties such as transport names, routing keys, delivery attempts, and error details.

core/stamps · high confidence

Added retry mechanism for failed message delivery

The system now automatically retries failed message deliveries using a configurable backoff strategy. When a message fails to send, the new \SendFailedMessageForRetryListener\ evaluates the failure and, if the retry limit has not been reached, schedules the message for redelivery after a calculated delay. If the maximum number of retries is exceeded, the message is forwarded to a dedicated failure transport. This behavior is supported by a new \MultiplierRetryStrategy\ that calculates exponential backoff delays, allowing for more robust handling of transient transport errors.

core/listener · high confidence

Added sync transport for in-memory message routing

A new sync transport has been introduced, enabling synchronous, in-memory message dispatching within the application. This feature allows for direct, blocking message routing without external dependencies, with full support for serialization and configuration. The implementation includes the core transport logic, a factory for instantiation, and comprehensive unit and benchmark tests to ensure reliability and performance.

transport/sync · high confidence

Initial release of the Go Messenger library

The repository now includes the core \Messenger\ implementation, providing a unified API to manage message buses, transport lifecycle (start/stop), and bus lookup by name. This is accompanied by comprehensive unit tests for the \Messenger\ struct, alongside configuration files for the Go linter (\.golangci.yaml\), code coverage thresholds (\codecov.yml\), and updated English and Russian \README\ documentation.

(repo-wide) · high confidence

Introduce JSON-based serialization for message envelopes and stamps

Added a new JSON serializer in core/serializer that converts message envelopes into a JSON payload with a 'type' header and optional 'stamps' header. The serializer also provides a Locator to register and retrieve serializers by name, enabling transport-level configuration of serialization strategies.

core/serializer · high confidence

Introduce core/builder for unified transport and message registration

The core/builder package has been introduced, providing a central builder that manages message, handler, middleware, serializer, and stamp registration, and assembles the application's buses, routing, and transport managers. This new builder consolidates the setup of transport interfaces and related components, enabling users to configure and initialize the messaging system through a single entry point.

core/builder · high confidence

Introduce structured configuration loading with environment variable support

Added a new configuration loading system in core/config that reads YAML files and applies a chain of processors to transform the content before parsing. This includes an EnvVarProcessor that replaces placeholders like %env(VARIABLE)% with actual environment variable values, and a YAMLParser that deserializes the processed content into a structured MessengerConfig. The implementation includes comprehensive tests for the file reader, environment variable substitution, and YAML parsing, ensuring that configuration files can be dynamically adjusted via environment variables.

core/config · high confidence

Introduce the core message bus and middleware locator for message routing

The core/bus package now provides a new message bus implementation that supports a middleware chain for processing messages. The bus wraps incoming messages in an envelope, applies registered middleware in order, and supports adding stamps (metadata) to messages. Additionally, a BusLocator has been introduced to register and retrieve named message bus instances, while a separate MiddlewareLocator manages named middleware components. These components form the foundation for the redesigned message routing system, enabling modular processing of messages through a chain of middleware.

core/bus · high confidence

Introduces a new message bus API with unified transport and routing interfaces

The api package now provides a comprehensive set of interfaces to define the message bus architecture. This includes a Builder for assembling the system, a Messenger for execution, and a MessageBus for dispatching messages with stamps. New interfaces standardize transport capabilities (Sender, Receiver, Closer), introduce a Router for message routing, and define a Serializer interface for message encoding. Additionally, the API exposes locators for handlers, middleware, and serializers, enabling users to configure and extend the messaging infrastructure.

api · high confidence

New event-driven message routing system

The core/event package now introduces a new event system that replaces the previous message routing logic. This includes a Dispatcher that manages event listeners and dispatches messages to transports, along with specific event types for worker lifecycle stages (received, handled, failed) and failed message handling. The implementation supports both function and struct-based listeners, allowing for more flexible message processing and error handling within the messenger.

core/event · high confidence

New message routing system with transport mapping

A new \Router\ implementation has been added to \core/routing\, enabling the application to map message types to specific transport mechanisms (such as AMQP, in-memory, or Redis). The \Router\ struct maintains a mapping of message types to a list of target transports, allowing the system to determine which transports should handle a given message. This change introduces the core logic for routing messages to multiple destinations, supported by comprehensive unit tests covering routing, type-based mapping, and edge cases like nil messages.

core/routing · high confidence

New transport infrastructure: FactoryChain, SenderLocator, and Manager

The transport package now includes three new core components to manage message routing and transport lifecycle. The FactoryChain enables dynamic transport creation by iterating through registered factories based on DSN matching. The SenderLocator provides a centralized registry for mapping message types to specific transport senders, supporting exact type matching, assignable type fallbacks, and explicit fallback transports. The Manager component orchestrates transport lifecycle, handling start/stop operations, concurrent message processing via goroutines, and integration with the event system for message handling and failure scenarios.

transport · high confidence

Test coverage

Added end-to-end tests for the messenger core; Added mock implementations for core interfaces; Added test fixtures for configuration and handler scenarios; Added test helper utilities for middleware, handlers, and logging.

Dependencies

Added Go module dependencies for messaging transports

The project's Go module file (go.mod) and its checksum file (go.sum) were added, establishing the project's dependency graph. This introduces libraries for interacting with RabbitMQ (github.com/rabbitmq/amqp091-go v1.10.0), Redis (github.com/redis/go-redis/v9 v9.11.0), and Apache Kafka (github.com/segmentio/kafka-go v0.4.48), alongside configuration and testing utilities such as creasty/defaults, google/uuid, and stretchr/testify.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 61 → 65 (+3.8)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (+0.1)
  • Architecture 100 → 94 (-6.4)
  • Maturity 55 → 55 (+0.0)
  • Readiness 68 → 66 (-1.9)
  • Security 51 → 65 (+14.4)
  • Event-Driven 100 → 100 (+0.0)

Resolved (28)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (13 lines × 3) (transport/amqp/transport.go)
  • Duplicated block (14 lines × 3) (transport/amqp/factory.go)
  • Duplicated block (16 lines × 3) (examples/kafka_transport/kafka_transport.go)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 8 more

New (43)

  • Critical CVE: [GHSA redacted] (go.mod)
  • Documentation: no contributor guidance (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (12 lines × 4) (examples/kafka_transport/kafka_transport.go)
  • Duplicated block (12 lines × 4) (examples/kafka_transport/kafka_transport.go)
  • Duplicated block (17 lines × 3) (transport/amqp/factory.go)
  • Duplicated block (21 lines × 3) (transport/amqp/transport.go)
  • Duplicated block (23 lines × 5) (examples/kafka_transport/kafka_transport.go)
  • Duplicated block (33 lines × 4) (examples/kafka_transport/kafka_transport.go)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 23 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

Gerfey/messenger was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit c92835ce6ab0e86c78b9421f6bfaf3a777fffd8d — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.