Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make event communication more reliable #39

Merged
merged 32 commits into from
Nov 23, 2023

Conversation

kamilbaczek
Copy link
Collaborator

@kamilbaczek kamilbaczek commented Nov 9, 2023

PR includes:

  • Eliminating the event bus abstraction, as MassTransit already serves as a comprehensive abstraction. The current IEventBus only hinders the utilization of MassTransit's full capabilities.
  • Implementation of the Inbox Pattern.
  • Implementation of the Outbox Pattern.
  • Introduction of Retries and Redelivery mechanisms.
  • Adoption of ADRs (Architectural Decision Records).

Not includes:

  • bump common infrastructure versions
  • retries and redelivery values from configuration instead static

@kamilbaczek kamilbaczek changed the title feat: make message communities more resilient feat: make event communication more reliable Nov 11, 2023
@kamilbaczek kamilbaczek added enhancement New feature or request chapter 3 labels Nov 17, 2023
Copy link
Collaborator

@meaboutsoftware meaboutsoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can think bout adding GlobalUsings.cs to each project - this way it will be more readable :)

Anyway - great job!

…cts Infrastructure insted use common infrastructure
The applicationUrl parameter in Fitnet.Contracts launchSettings.json file has been updated. The localhost port has been changed from 5013 to 5010 to reflect the new server configuration.
The baseUrl for localhost has been changed in the http-client.env.json file. It is now set to use port 5010 instead of the previous port 5013.
The connection string for the "Contracts" database has been removed from the appsettings.Development.json file. This reflects that the "Contracts" database is not needed anymore, and it keeps the configuration clean and relevant.
The removed classes, PassesConsumers and ContractSignedRegistration, were part of the event and consumer registration process. Their functions have been improved and integrated into other parts of the code to optimize our programming architecture.
Deprecated the EventBus as we have chosen to directly use MassTransit's `IPublishEndpoint` instead for event publishing. All dependency on the previously implemented EventBus, along with the EventBusOptions class, has been removed across the codebase. The handlers and consumers have been refactored accordingly.
Adjusted the MarkPassAsExpiredEndpoint to use the Common.EventBus dependency. This change involves binding IPassesBus and IPublishEndpoint to ensure correct event publication upon pass expiration. The publishEndpoint is now wrapped in a Bind object, improving its use in event publication.
Several unnecessary spaces and code lines have been removed in various files to improve the code's readability and maintainability. Also, the BloggingContextFactory class in PassesPersistence.cs, which was not being used, has been eliminated.
The MassTransit package, version 8.1.1, has been added to the IntegrationTestsToolbox project to facilitate the messaging framework for our tests. This addition will provide the necessary support for testing distributed systems.
Changes have been made in various configurations both on the application and development level. On the appsettings files, "Offers", "Passes", and "Reports" features and connection strings have been removed. Furthermore, the LogLevel has been changed from "Information" to "Debug". In the solution file, the "Fitnet.Common.Infrastructure" project has been removed.
The EventBusModule configuration in the Fitnet.Passes.Api project has been updated to include System.Reflection and to set the KebabCaseEndpointNameFormatter() function. Additionally, consumers from the currently executing assembly have been added to the configurator.
Changes in this commit include updating the access modifiers on ContractSignedEventConsumer and ContractSignedEventConsumerDefinition from 'internal' to 'public' for wider access. The configuration for the event bus and logging level was updated along with removal of redundant projects. The EndpointNameFormatter was also switched from using KebabCase to SnakeCase to better align with conventions.
The IPassesBus interface was removed as it wasn't necessary. The related code in the MarkPassAsExpiredEndpoint.cs was refactored to use the IPublishEndpoint directly. This makes the code cleaner and more efficient.
The launchSettings.json files for Fitnet and Fitnet.Contracts were altered to stop the automatic launch of the browser when the project starts. This change provides users with more control over when and how they want to interact with the projects.
@kamilbaczek kamilbaczek force-pushed the feature/make_queues_more_resillient branch from f0fc80c to 0d40c98 Compare November 19, 2023 10:10
@kamilbaczek kamilbaczek marked this pull request as ready for review November 19, 2023 17:40
Simplified the initialization of HttpContext in the ExceptionMiddlewareTests class. This refactor removes unnecessary lines and makes the code cleaner, moving the initialization of the _context field directly in its declaration.
@kamilbaczek kamilbaczek merged commit 3738b58 into main Nov 23, 2023
@kamilbaczek kamilbaczek deleted the feature/make_queues_more_resillient branch November 23, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chapter 3 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants