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

Feature/rabbitmq adapters #87

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

HERCH
Copy link

@HERCH HERCH commented Feb 23, 2025

Implement specific technology adapters for RabbitMQ in a new assembly.

@jezzsantos jezzsantos self-requested a review March 1, 2025 23:39
@jezzsantos
Copy link
Owner

jezzsantos commented Mar 1, 2025

I can see more than 18 code warnings in this PR, can you do what it takes to remove the warnings?

We see those in Rider, but you may not see them in VS which is a problem I need to solve. To get VS to use the same formatting rules.

Perhaps I need to format your code (In Rider) once it is all in shape, but then I would need permission to edit the PR, which I dont think I have right now in your repo?


<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Copy link
Owner

Choose a reason for hiding this comment

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

You should not define nor here, as they are controlled centrally in Directory.Build.props at the root of the repo

<value>Message cannot be empty</value>
</data>
<data name="ValidationExtensions_InvalidStorageAccountResourceName" xml:space="preserve">
<value>The Azure Storage Table/Blob/Queue name: '{0}' contains illegal characters or is not the correct length</value>
Copy link
Owner

Choose a reason for hiding this comment

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

Should this message be reworded? and are you sure the name is correct? Is StorageAccount a thing in the RabbitMq world?


public const string RabbitMqExchangeNameValidationExpression = @"^[a-z0-9_\.\-\/]{1,255}$";

public const string StorageAccountResourceNameValidationExpression = @"^[a-z0-9\-]{3,63}$";
Copy link
Owner

Choose a reason for hiding this comment

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

Is this named correctly?

useAsyncDispatcher);
return options.ToConnectionString();
}

Copy link
Owner

Choose a reason for hiding this comment

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

Is all this dead code? can we remove it all?

internal const string PasswordSettingName = "ApplicationServices:Persistence:RabbitMQ:Password";
internal const string VirtualHostSettingName = "ApplicationServices:Persistence:RabbitMQ:VirtualHost";

public RabbitMqStoreOptions(
Copy link
Owner

Choose a reason for hiding this comment

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

Can this be private, to stop consumers using it directly, and force them to use the From* methods below?

using RabbitMQ.Client;

namespace Infrastructure.Persistence.RabbitMq.ApplicationServices
{
Copy link
Owner

Choose a reason for hiding this comment

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

We prefer using namespaces without blocks


public override bool Equals(object? obj)
{
if (obj is not TopicExistence other)
Copy link
Owner

Choose a reason for hiding this comment

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

Code formatting rules should wrap the if statement in braces.

@@ -0,0 +1,12 @@
namespace Infrastructure.Persistence.Shared.IntegrationTests.RabbitMq;

public static class RabbitMqBase
Copy link
Owner

Choose a reason for hiding this comment

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

Dead code? can remove?

_emulator.StartAsync().GetAwaiter().GetResult();

var connectionString = _emulator.GetConnectionString();
var managementUri = _emulator.GetManagementUri();
Copy link
Owner

Choose a reason for hiding this comment

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

dead code?

.WithPortBinding(15672, assignRandomHostPort: true)
.WithEnvironment("RABBITMQ_DEFAULT_USER", "guest")
.WithEnvironment("RABBITMQ_DEFAULT_PASS", "guest")
.WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(5672))
Copy link
Owner

Choose a reason for hiding this comment

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

can this port be moved to a constant at top of this file?

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.

2 participants