Initialize Module
🧩 Defining the Messaging Module
To use @nestjstools/messaging
in your application, you need to register the MessagingModule
in your root module (usually AppModule
). This will make the messaging functionality available across all other modules in your app.
🔧 Starter Setup
📌 Notes
MessagingModule.forRoot(...)
registers the messaging system globally, meaning you don't need to import it in feature modules.You must define at least one bus and one channel.
InMemoryChannelConfig
our app will works on in-memory message transport layer.Setting
debug: true
enables verbose logging to help with debugging message flow.
🚀 What’s Happening Here?
buses
Defines logical buses for message routing.
channels
Configures message channels (e.g., in-memory, Kafka, etc.).
debug
Enables or disables debug logging.
my-channel
A simple in-memory channel used by the message.bus
.
⚠️ Important: Make sure this is defined in your AppModule or the main/root module to ensure messaging is globally available.
Last updated