Skip to main content
Version: Next

Introduction to Open Contract

The Open Contract library serves as a shared utility and abstraction layer across multiple microservices within the Navida Pro ecosystem. Its main goal is to standardize common functionalities such as logging, error handling, Kafka utilities, and context propagation — reducing code duplication and improving observability, traceability, and developer efficiency.


What Does Open Contract Handle?

Below are the core components currently provided by Open Contract:

Business Logger

A centralized logging mechanism used to track and monitor exceptions or business-level errors in Navida Pro. These logs are persisted and visualized via Grafana for real-time analysis and auditability.

ContextAwareComputableFuture

Enables seamless propagation of TraceId and AokID across asynchronous threads during background or non-blocking execution, maintaining observability in distributed tracing.

GlobalExceptionHandler

A unified exception handler that:

  • Captures all common and framework-related exceptions
  • Standardizes the error response structure and response messages
  • Ensures consistency across all services that adopt Open Contract

Kafka Utilities

Includes reusable Kafka components such as:

  • Kafka consumer and producer helpers
  • Common serializers and deserializers
  • Property binding and error management code

These utilities promote reusability and eliminate redundancy when working with Kafka within backend services.


Summary

Open Contract helps reduce boilerplate, promote standardization, and improve maintainability across services by offering:

  • Shared business logic utilities
  • Unified logging and error handling
  • Consistent trace propagation
  • Reusable Kafka support

As Open Contract evolves, more capabilities can be introduced for metrics, observability, security, and auditing.