Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9236823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:23:26+00:00 2026-06-18T07:23:26+00:00

Does Autofac support an easy to use message broker for doing many-to-many publish/subscribe event

  • 0

Does Autofac support an easy to use message broker for doing many-to-many publish/subscribe event messaging?

Edit:

public class Service1
{
    [Publish("message://an-event")]
    public event Event<EventParams> AnEvent;

    public void DoSomething()
    {
        // do something
        // [...]

        // publish message
        if (AnEvent != null)
            AnEvent(this, new EventParams(something))
    }
}

public class Service2
{
    [Subscribe("message://an-event")]
    public OnAnEvent(object sender, EventParams eventParams)
    {
        Console.WriteLine("Hello World from Service2")
    }
}

public class Service3
{
    [Subscribe("message://an-event")]
    public OnAnEvent(object sender, EventParams eventParams)
    {
        Console.WriteLine("Hello World from Service3")
    }
}

The cool thing about Ninjects message broaker extension is its simplicity. You only have to add annotations to events that publish something and methods that subscribe to this event. The container handles automatically the connection. You only have to bind the services.

Has autofac something similar? If not, whats the best way to do something like this with autofac?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:23:27+00:00Added an answer on June 18, 2026 at 7:23 am

    Autofac does not currently ship out of the box with any specific message broker support. Autofac being an IoC container, not a message broker, if anything were to be added, it would be extensions supporting an external system the way Ninject’s bbeventbroker works – possible assistance in wiring up event handling but not management of the actual brokering proper. (Just like Autofac doesn’t do its own MVC or WCF implementations – just helpers to interface with existing systems.)

    You could roll your own integration with a system like the bbvcommon Event Broker or NServiceBus using things like Autofac’s lifetime events and/or custom registration sources but exactly how that would need to be done and what that would look like would depend on the system with which you’re integrating. You could look at the source for other integration components to get ideas and patterns.

    If you do get something working, you might consider contributing it for inclusion as an Autofac.Extras project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does Autofac support implicit lifetime scopes for the use of a factory? For example,
Does anyone have any tips or best practices regarding how Autofac can help manage
Does anyone know a good resource that I can use in the browser that
Does anyone know of a comprehensive guide to setting up Automapper with Autofac. I'm
I have started to use Autofac following this tutorials: http://flexamusements.blogspot.com/2010/09/dependency-injection-part-3-making-our.html Simple class with no
I am trying to use Autofac.WebApi with an ASP.NET MVC4 WebApi project. I installed
Does jquery support both function pageload() and $().ready() ? Or is pageload() for ajax.net
Does autofac provide me with a way to get all active instances of a
Does anyone have any experience integrating autofac and Quartz.Net ? If so, where is
Using Autofac, I have the following scenario: public class MainClass { public delegate MainClass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.