Skip to content

Conversation

@bebelz
Copy link
Contributor

@bebelz bebelz commented Jun 17, 2025

Tout passe asyc, nécessaire pour les projets utilisant aussi Lucca.Core.Events et qui veulent passer en version 8+ (https://github.com/LuccaSA/Lucca.Core.Events/releases/tag/v8.0.0)

rabbitmq/rabbitmq-dotnet-client#1720
https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/v7-MIGRATION.md

⚠️ Cette lib étant proche d'être dépréciée j'ai fait le choix de faire baver RabbitMQ.Client dans le projet MerQure "agnostique" de l'outil. En cause, l'utilisation de AsyncEventHandler en signature de UnregisteredAsync qui est une implémentation de RabbitMqClient.

Poltuu
Poltuu previously approved these changes Jun 18, 2025
Copy link

@Poltuu Poltuu left a comment

Choose a reason for hiding this comment

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

🤷‍♂️

BriceFrancois
BriceFrancois previously approved these changes Jun 19, 2025
}
}
Task SendAsync(Sample sample);
Task ConsumeAsync(EventHandler<Sample> onSampleReceived);
Copy link
Contributor

Choose a reason for hiding this comment

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

on garde un EventHandler standard en fin de compte,
on arrive à se passer de l'implem de RabbitMQ.Client ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sur le Consume ils ont gardé l'EventHandler côté lib, c'est pour le Stop que ça a changé

}

public void StopConsuming(EventHandler onConsumerStopped)
public async Task StopConsuming(AsyncEventHandler<ConsumerEventArgs> onConsumerStopped)
Copy link
Contributor

Choose a reason for hiding this comment

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

ah ici 😞
le StopConsuming est sur l'interface IConsumer j'imagine

{
var basicProperties = CreateBasicProperties(message);
var addr = new PublicationAddress("", ExchangeName, message.GetRoutingKey());
using var cts = new CancellationTokenSource(new TimeSpan(TimeoutInMilliseconds * TimeSpan.TicksPerMillisecond));
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

}
public async Task DeclareExchangeAsync(string exchangeName, string exchangeType)
{
if (string.IsNullOrWhiteSpace(exchangeName)) throw new ArgumentNullException(nameof(exchangeName));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (string.IsNullOrWhiteSpace(exchangeName)) throw new ArgumentNullException(nameof(exchangeName));
ArgumentNullException.ThrowIfNullOrWhiteSpace(exchangeName);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pas dispo ici apparement :(

return DeclareQueue(queueName, queueArgs, isQuorum);
public Task<string> DeclareQueueWithDeadLetterPolicyAsync(string queueName, string deadLetterExchange, int messageTimeToLive, string deadLetterRoutingKey, bool isQuorum)
{
if (string.IsNullOrWhiteSpace(deadLetterExchange)) throw new ArgumentNullException(nameof(deadLetterExchange));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (string.IsNullOrWhiteSpace(deadLetterExchange)) throw new ArgumentNullException(nameof(deadLetterExchange));
ArgumentNullException.ThrowIfNullOrWhiteSpace(deadLetterExchange);

if (queueArgs == null) throw new ArgumentNullException(nameof(queueArgs));
public async Task<string> DeclareQueueAsync(string queueName, Dictionary<string, object> queueArgs, bool isQuorum)
{
if (string.IsNullOrWhiteSpace(queueName)) throw new ArgumentNullException(nameof(queueName));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (string.IsNullOrWhiteSpace(queueName)) throw new ArgumentNullException(nameof(queueName));
ArgumentNullException.ThrowIfNullOrWhiteSpace(queueName);

public async Task DeclareBindingAsync(string exchangeName, string queueName, string routingKey, Dictionary<string, object> headerBindings)
{
if (string.IsNullOrWhiteSpace(exchangeName)) throw new ArgumentNullException(nameof(exchangeName));
if (string.IsNullOrWhiteSpace(queueName)) throw new ArgumentNullException(nameof(queueName));
Copy link
Contributor

Choose a reason for hiding this comment

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

idem partout :)

@bebelz bebelz dismissed stale reviews from BriceFrancois and Poltuu via 1aace47 June 19, 2025 13:59
@bebelz bebelz force-pushed the bump.rabbitmq.client branch from aa7b730 to 1aace47 Compare June 19, 2025 13:59
@bebelz bebelz requested review from BriceFrancois and Poltuu June 19, 2025 14:04
@bebelz bebelz merged commit da2b77d into master Jun 19, 2025
3 checks passed
@bebelz bebelz deleted the bump.rabbitmq.client branch June 19, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants