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

[DEA-2009] Command Bus #60

Closed
wants to merge 13 commits into from
Closed

Conversation

tomasvts
Copy link
Contributor

🤔 Background

Command Bus implementation

💡 Goal

The goal of this PR.

🔖 Changes

List individual changes in more detail as you might consider them important.

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Attention: Patch coverage is 27.32919% with 117 lines in your changes are missing coverage. Please review.

Project coverage is 41.36%. Comparing base (0fb557b) to head (dc44f49).
Report is 6 commits behind head on master.

Files Patch % Lines
.../Infrastructure/SynchronousSendEventMiddleware.php 0.00% 37 Missing ⚠️
src/Infrastructure/AsyncSendEventMiddleware.php 0.00% 29 Missing ⚠️
src/Infrastructure/Rabbit.php 0.00% 25 Missing ⚠️
src/Infrastructure/AutoloaderEventMapGenerator.php 30.00% 14 Missing ⚠️
src/Domain/AsyncCommand.php 0.00% 4 Missing ⚠️
src/Interfaces/Consumer/GoAssistedConsumer.php 20.00% 4 Missing ⚠️
src/Infrastructure/AutoloadConfig.php 81.25% 3 Missing ⚠️
src/Infrastructure/ConsumerConfigGenerator.php 96.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #60      +/-   ##
============================================
- Coverage     46.42%   41.36%   -5.06%     
- Complexity      174      224      +50     
============================================
  Files            19       22       +3     
  Lines           545      689     +144     
============================================
+ Hits            253      285      +32     
- Misses          292      404     +112     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tomasvts added 12 commits March 5, 2024 09:40
…riable

feat(index.php): add support for environment secrets in RabbitMQ configuration
feat(index.php): add support for RabbitMQ singleton instance creation with environment secrets

docs(AutoloadConfig.php): add parameter descriptions to the constructor
feat(Dockerfile): add xdebug extension and configure it
refactor(SampleRepo/index.php): add check for action prefix in method name and add namespace exclusion to AutoloaderEventMapGenerator

feat(SampleRepo): add SampleVideoPermissionChangeCommand to SampleRepo

Add publisher.php file that publishes a SampleVideoPermissionChangeCommand to RabbitMQ using the CommandBus. Also, add SampleConsumerForCommands.php file that handles the SampleVideoPermissionChangeCommand and publishes a message to the queue specified in the command. Finally, add SampleController.php file that has a handleSampleCommand method that handles the SampleVideoPermissionChangeCommand.

refactor(SampleVideoPermissionChangeCommand.php): change commandName method to eventName
feat(SampleVideoPermissionChangeCommand.php): add support for queueToReply property
feat(to_temp.php): add script to publish message to RabbitMQ queue

chore(composer.json): add amphp/phpunit-util dependency
chore(docker-compose.yml): add PHP_IDE_CONFIG environment variable
feat(docker-compose.yml): add AMQP2FCGI_FCGI_XDEBUG and AMQP2FCGI_FCGI_FAKEIP environment variables
refactor(Command.php): change method name from commandName to eventName
refactor(EventMapGenerator.php): change return type to class-string<Event|Command>

refactor(AsyncSendEventMiddleware.php): simplify execute method and add validation for Command instance

feat(AutoloaderEventMapGenerator.php): add support for Command class in event map generator

refactor(ConsumerConfigGenerator.php): change method call from commandName() to eventName()
fix(Rabbit.php): add queueName parameter to queue_bind() method call
feat(Rabbit.php): add wait() method to Rabbit class to wait for messages to arrive

refactor(SimpleEventMapGenerator.php): add Command to the return type of get() method

feat(SyncSendEventMiddleware.php): add SyncSendEventMiddleware class to handle synchronous event sending and receiving

feat(GoAssistedConsumer.php): add Command type to the return of unserialize method

test(CommandBusIntegrationTest.php): add test for command bus with async event middleware and RabbitMQ instance.

test(AutoloaderEventMapGeneratorTest.php): add test for SampleVideoPermissionChangeCommand class to getAll() and generate_event_map_creates_file_with_correct_content() methods
feat(AutoloaderEventMapGenerator.php): add support for SampleVideoPermissionChangeCommand class to getAll() method

test(GoAssistedConsumerTest.php): add test for parsing SampleVideoPermissionChangeCommand request
…to SynchronousSendEventMiddleware

feat(SynchronousSendEventMiddleware.php): add SynchronousSendEventMiddleware class to send events synchronously via RabbitMQ

test(CommandBusIntegrationTest.php): rename test_command_bus to test_synchronous_command_bus and assert the result of the command execution
@tomasvts tomasvts force-pushed the fix_DEA2009_CommandbusGlobal branch from 1085d8c to ec3b18c Compare March 5, 2024 08:41
@tomasvts tomasvts closed this Jul 19, 2024
@tomasvts tomasvts deleted the fix_DEA2009_CommandbusGlobal branch July 19, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant