Skip to content

Conversation

EtherZa
Copy link

@EtherZa EtherZa commented Aug 25, 2025

#281

Adds an overload to MessageBusBuilder.AddAdditionalService to expose underlying IMessageConfiguration and IServiceCollection for finer control of service manipulation.

Sample usage:

public static IMessageBusBuilder WithOutbox(this IMessageBusBuilder builder)
{
   builder.AddAdditionalService((_, services) => 
   {
      ... // other services related to the outbox
      services.AddHostedService<OutboxPublishBackgroundService>();
      services.Replace(new ServiceDescriptor(typeof(IMessagePublisher), typeof(OutboxMessageRoutingPublisher), ServiceLifetime.Scoped));
  });

   return builder;
}

Although not included in the sample message, I suspect that there would be other times where having the message configuration may be useful but I am happy to remove it if there is an objection.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@EtherZa EtherZa force-pushed the feature/extended-additional-service branch from 0132493 to 22b1434 Compare August 25, 2025 07:51
@EtherZa EtherZa changed the base branch from main to dev August 25, 2025 07:52
@dscpinheiro dscpinheiro requested a review from normj August 28, 2025 16:21
@eddiemcs3 eddiemcs3 requested a review from philasmar August 28, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant