How sarang10/dropwizard-rabbitmq-actors works
Main Components
• Actor Abstraction Layer: This is the core of the library and is organized under the “actors” packages. It includes:
• Actor and Actor Configurations (BaseActor, ActorConfig, and associated classes in the “actor” package).
• Managed and unmanaged actors for different use cases.
• Connectivity and Configuration:
• Classes in the “connectivity” package manage RabbitMQ connections, including configuration (ConnectionConfig, RMQConnection) and connection isolation strategies (DefaultConnectionStrategy, SharedConnectionStrategy).
• The “config” package holds configuration classes, including broker, RMQ, and metric configurations.
• Exception Handling:
• The “exceptionhandler” package handles errors via multiple handlers (e.g., MessageDropHandler, MessageSidelineHandler) and associates configuration classes.
• Retry Strategies:
• The “retry” package offers various retry strategies (count-limited vs. time-limited, exponential, fixed, or incremental waits) along with configuration and implementation classes.
• Metrics and Observation:
• The “metrics” package, along with “observers”, provides metric data capture and observation mechanisms for actor interactions.
• Utilities:
• Utility classes under “utils” and “common” to support naming, constants, and common operations.
Relationships and Interactions
• The Dropwizard bundle (RabbitmqActorBundle) serves as the integration point that injects actor functionality into a Dropwizard application.
• The Actor Abstraction Layer (with its various actor types) interacts with the RabbitMQ infrastructure through the Connectivity and Configuration modules.
• Configuration components feed settings into actors, connectivity components, and retry mechanisms.
• Exception handlers intercept failures during actor message processing and use the configurations from the exceptionhandler package.
• Metrics and observers monitor both the actor behavior and RabbitMQ connectivity; data is funneled into the metrics module.
• Retry strategies are plugged into scenarios where message processing or connectivity issues demand additional handling.
Architectural Patterns and Design Choices
• Modularity: The source structure clearly separates concerns into packages (actors, connectivity, configuration, exception handling, metrics, retry).
• Abstraction: The actor and connection strategies use abstraction and visitor patterns (evidenced by “Visitor” classes) to handle different actor behaviors and connection management flows.
• Extensibility: Configurations and modular retry strategies indicate that the design supports extension points for further customization.
• Integration with Dropwizard: The bundle structure makes it easy to integrate with Dropwizard-powered applications.