Skip to content

Commit

Permalink
use ToLower in ExchangeDeclare
Browse files Browse the repository at this point in the history
  • Loading branch information
Fr-Soltanzadeh committed Mar 29, 2024
1 parent 28e5e06 commit 61d0911
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ public enum BrokerType
/// <summary>
/// Direct exchange type routes messages based on exact matching of routing keys.
/// </summary>
direct,
Direct,

/// <summary>
/// Topic exchange type routes messages based on wildcard patterns in routing keys.
/// </summary>
topic,
Topic,

/// <summary>
/// Headers exchange type routes messages based on message headers.
/// </summary>
headers,
Headers,

/// <summary>
/// Fan-out exchange type routes messages to all bound queues without considering routing keys.
/// </summary>
fanOut,
FanOut,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ExchangeOptions
/// <summary>
/// Gets or sets the type of RabbitMQ exchange, such as direct, topic, headers, or fanout.
/// </summary>
public BrokerType ExchangeType { get; set; } = BrokerType.direct;
public BrokerType ExchangeType { get; set; } = BrokerType.Direct;

/// <summary>
/// Gets or sets whether the exchange is durable, meaning it survives server restarts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void Publish<TModel>(IEvent<TModel> @event) where TModel : IEventDataMode
{
ExchangeOptions exchangeOptions = _options.Value.ExchangeOptions;

channel.ExchangeDeclare(exchangeOptions.BrokerName, exchangeOptions.ExchangeType.ToString(), exchangeOptions.Durable,
channel.ExchangeDeclare(exchangeOptions.BrokerName, exchangeOptions.ExchangeType.ToString().ToLower(), exchangeOptions.Durable,
exchangeOptions.AutoDelete, exchangeOptions.Arguments);

string message = JsonConvert.SerializeObject(@event);
Expand Down

0 comments on commit 61d0911

Please sign in to comment.