Skip to content

Commit

Permalink
Added more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dannythunder committed Apr 27, 2023
1 parent ee8bb47 commit 077e06c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion Wolverine.Mediator.RabbitMq.ReceiverDual/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
var connectionString = builder.Configuration.GetConnectionString("MessageBroker");

opts.UseRabbitMq(new Uri(connectionString))

// These are essentially
//opts.DeclareExchange(exchangeName: type.Name).BindExchange(exchangeName: type.Name).ToQueue(queueName: queueName, bindingKey: type.Name);
.AddQueueBindingsForMessages(queueName, MessagebrokerMessagesHelper.SERVICE_COMMANDS_TYPES) // Messages for this service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static class ServiceMessagesRegisterHelper
// Events published from this service
public static WolverineOptions AddEventForPublishing(this WolverineOptions opts)
{

opts.PublishMessage<RemoteEvent>().ToRabbitExchange(typeof(RemoteEvent).Name); // Event

return opts;
Expand All @@ -18,7 +19,8 @@ public static WolverineOptions AddEventForPublishing(this WolverineOptions opts)
// Commands to other services published from this service
public static WolverineOptions AddCommandsForPublishing(this WolverineOptions opts)
{
opts.PublishMessage<RemoteCommand>().ToRabbitExchange(ReceiverDualQueueName.EXCHANGE_NAME, ex => ex.BindQueue(ReceiverDualQueueName.QUEUE_NAME));
// Send to specific exchange, can this be done in another more dynamic way?
opts.PublishMessage<RemoteCommand>().ToRabbitExchange(ReceiverDualQueueName.EXCHANGE_NAME);

return opts;
}
Expand Down
3 changes: 3 additions & 0 deletions Wolverine.Mediator.RabbitMq.Sender/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

// Bind outgoing messages, could this be magically done if there is a lot of events/commands?
// Hiding in extensions to not bloat the setup

// These are essatially:
// opts.PublishMessage<MyMessage>().ToRabbitExchange(exchangeName: typeof(MyMessage).Name);
opts.AddEventForPublishing();
opts.AddCommandsForPublishing();

Expand Down

0 comments on commit 077e06c

Please sign in to comment.