-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configurable queue/сonsumer + ack strategies for handler + DotNet8 (#26)
* Update lib and dotnet ver * Consumer configuration and ack strategies * QueueConfiguration + refactoring
- Loading branch information
Showing
8 changed files
with
96 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,40 @@ | ||
using EasyNetQ.Topology; | ||
using System; | ||
using EasyNetQ; | ||
using EasyNetQ.Topology; | ||
|
||
namespace ATI.Services.RabbitMQ; | ||
|
||
public class QueueExchangeBinding | ||
/// <param name="queueConfiguration">Configuration for queue declare. This configuration will be overriden by params in SubscribeAsync method</param> | ||
/// <param name="consumerConfiguration">Configuration for consumer</param> | ||
public class QueueExchangeBinding( | ||
ExchangeInfo exchange, | ||
Queue queue, | ||
string routingKey, | ||
string queueType = QueueType.Quorum, | ||
Action<IQueueDeclareConfiguration> queueConfiguration = null, | ||
Action<ISimpleConsumeConfiguration> consumerConfiguration = null) | ||
{ | ||
public QueueExchangeBinding(ExchangeInfo exchange, Queue queue, string routingKey, string queueType = EasyNetQ.QueueType.Quorum) | ||
//for back compatibility release | ||
[Obsolete("Use constructor with queueConfiguration and consumerConfiguration")] | ||
public QueueExchangeBinding(ExchangeInfo exchange, | ||
Queue queue, | ||
string routingKey, | ||
string queueType = EasyNetQ.QueueType.Quorum) | ||
:this(exchange, queue, routingKey, queueType, null, null) | ||
{ | ||
Queue = queue; | ||
RoutingKey = routingKey; | ||
Exchange = exchange; | ||
QueueType = queueType; | ||
} | ||
|
||
public Queue Queue { get; } | ||
public string RoutingKey { get; } | ||
public ExchangeInfo Exchange { get; } | ||
public string QueueType { get; set; } | ||
|
||
public Queue Queue { get; } = queue; | ||
public string RoutingKey { get; } = routingKey; | ||
public ExchangeInfo Exchange { get; } = exchange; | ||
public string QueueType { get; } = queueType; | ||
/// <summary> | ||
/// Configuration for queue declare | ||
/// This configuration will be overriden by params in SubscribeAsync method | ||
/// </summary> | ||
public Action<IQueueDeclareConfiguration> QueueConfiguration { get; } = queueConfiguration; | ||
/// <summary> | ||
/// Configuration for consumer | ||
/// </summary> | ||
public Action<ISimpleConsumeConfiguration> ConsumerConfiguration { get; } = consumerConfiguration; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters