forked from MassTransit/MassTransit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecead15
commit ad8c9fd
Showing
21 changed files
with
168 additions
and
360 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/Transports/MassTransit.RabbitMqTransport/Configuration/IRabbitMqBindingConfigurator.cs
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace MassTransit | ||
{ | ||
/// <summary> | ||
/// Used to configure the binding | ||
/// </summary> | ||
public interface IRabbitMqBindingConfigurator | ||
{ | ||
/// <summary> | ||
/// A routing key for the exchange binding | ||
/// </summary> | ||
string RoutingKey { set; } | ||
|
||
/// <summary> | ||
/// Sets the binding argument, or removes it if value is null | ||
/// </summary> | ||
/// <param name="key"></param> | ||
/// <param name="value"></param> | ||
void SetBindingArgument(string key, object value); | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
.../MassTransit.RabbitMqTransport/Configuration/IRabbitMqExchangeQueueBindingConfigurator.cs
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace MassTransit | ||
{ | ||
public interface IRabbitMqExchangeQueueBindingConfigurator: | ||
IRabbitMqQueueConfigurator, | ||
IRabbitMqExchangeConfigurator, | ||
IRabbitMqBindingConfigurator | ||
{ | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
...ansports/MassTransit.RabbitMqTransport/Configuration/IRabbitMqQueueBindingConfigurator.cs
This file was deleted.
Oops, something went wrong.
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
42 changes: 0 additions & 42 deletions
42
src/Transports/MassTransit.RabbitMqTransport/RabbitMqTransport/BaseEntitySettings.cs
This file was deleted.
Oops, something went wrong.
77 changes: 0 additions & 77 deletions
77
src/Transports/MassTransit.RabbitMqTransport/RabbitMqTransport/BaseReceiveSettings.cs
This file was deleted.
Oops, something went wrong.
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
38 changes: 20 additions & 18 deletions
38
.../MassTransit.RabbitMqTransport/RabbitMqTransport/Configuration/RabbitMqReceiveSettings.cs
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,50 +1,52 @@ | ||
namespace MassTransit.RabbitMqTransport.Configuration | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using RabbitMQ.Client; | ||
|
||
|
||
public class RabbitMqReceiveSettings : BaseReceiveSettings | ||
public class RabbitMqReceiveSettings : ExchangeQueueBindingConfigurator, | ||
ReceiveSettings | ||
{ | ||
internal ExchangeQueueBindingConfigurator BindingConfigurator { get; } | ||
|
||
readonly IRabbitMqEndpointConfiguration _configuration; | ||
|
||
public RabbitMqReceiveSettings(IRabbitMqEndpointConfiguration configuration, string name, string type, bool durable, bool autoDelete) | ||
: this(configuration, new ExchangeQueueBindingConfigurator(name, name, type, durable, autoDelete)) | ||
: base(name, name, type, durable, autoDelete) | ||
{ | ||
_configuration = configuration; | ||
ConsumeArguments = new Dictionary<string, object>(); | ||
} | ||
|
||
public RabbitMqReceiveSettings(IRabbitMqEndpointConfiguration configuration, ExchangeQueueBindingConfigurator configurator) | ||
: base(configurator) | ||
public string QueueName | ||
{ | ||
_configuration = configuration; | ||
BindingConfigurator = configurator; | ||
ConsumeArguments = new Dictionary<string, object>(); | ||
get => QueueConfigurator.QueueName; | ||
set => QueueConfigurator.QueueName = value; | ||
} | ||
|
||
internal RabbitMqQueueConfigurator QueueConfigurator => BindingConfigurator.QueueConfigurator; | ||
internal RabbitMqExchangeConfigurator ExchangeConfigurator => BindingConfigurator.ExchangeConfigurator; | ||
public IDictionary<string, object> QueueArguments => QueueConfigurator.QueueArguments; | ||
|
||
|
||
public int ConsumerPriority | ||
{ | ||
set => ConsumeArguments[Headers.XPriority] = value; | ||
} | ||
|
||
public override ushort PrefetchCount | ||
public ushort PrefetchCount | ||
{ | ||
get => (ushort)_configuration.Transport.PrefetchCount; | ||
set => _configuration.Transport.Configurator.PrefetchCount = value; | ||
} | ||
|
||
public override bool PurgeOnStartup { get; set; } | ||
public override bool ExclusiveConsumer { get; set; } | ||
public override bool NoAck { get; set; } | ||
public bool PurgeOnStartup { get; set; } | ||
public bool ExclusiveConsumer { get; set; } | ||
public bool NoAck { get; set; } | ||
|
||
public bool BindQueue { get; set; } = true; | ||
|
||
public override bool BindQueue { get; set; } = true; | ||
public IDictionary<string, object> ConsumeArguments { get; } | ||
|
||
public override IDictionary<string, object> ConsumeArguments { get; } | ||
public string ConsumerTag { get; set; } | ||
|
||
public override string ConsumerTag { get; set; } | ||
public virtual Uri GetInputAddress(Uri hostAddress) => ExchangeConfigurator.GetEndpointAddress(hostAddress); | ||
} | ||
} |
Oops, something went wrong.