Open Closed

Using distributed event bus within a console application #6964


User avatar
0
utku.birkan created
  • ABP Framework version: v8.0.5

  • UI Type: None

  • Database System: None

  • Tiered (for MVC) or Auth Server Separated (for Angular): N/A

  • Steps to reproduce the issue:

Hi, I'm writing a microservice to connect our ABP application with a legacy windows API. I have a console application that should import the said windows DLLs, and receive instructions on what to execute through the distributed event bus. I added AbpAbpEventBusRabbitMqModule into the dependency list of my application's module class. I can connect to a rabbitmq instance and push events, however event handlers do not receive anything.

Here's how I bootstrap the application. For the monitor loop, task queue and worker implementations I followed this Microsoft tutorial to keep things simple. I use ABP interfaces to register dependencies but didn't change all that much else.

using Siemens.PSSX.Bridge.Worker;
using ZLogger;

var builder = Host.CreateApplicationBuilder(args);

builder.Logging.ClearProviders().AddZLoggerConsole().AddZLoggerFile("Logs/logs.txt");
builder.Services.AddHostedService<Worker>();

await builder.Services.AddApplicationAsync<ApplicationModule>();

var host = builder.Build();

MonitorLoop monitorLoop = host.Services.GetRequiredService<MonitorLoop>()!;
monitorLoop.StartMonitorLoop();

await host.InitializeAsync();
await host.RunAsync();
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can refer to this example: https://github.com/abpframework/abp-samples/tree/master/RabbitMqEventBus

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 23, 2026, 09:57
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.