Skip to main content

Create Message Broker NestJS Module


Creates the NestJS of the message broker.

This event does NOTHING by default. All of the logic is handled by the broker-kafka plugin

Event Name


Event Params

There are no additional params to this event

export interface CreateMessageBrokerNestJSModuleParams extends EventParams {}


  async afterCreateMessageBrokerNestJSModule(
context: DsgContext,
eventParams: CreateMessageBrokerNestJSModuleParams,
modules: ModuleMap
) {
const filePath = resolve(staticDirectory, "kafka.module.ts");

const { serverDirectories } = context;
const { messageBrokerDirectory } = serverDirectories;
const file = await readFile(filePath, "utf8");
const generateFileName = "kafka.module.ts";

this.moduleFile = {
code: file,
path: join(messageBrokerDirectory, generateFileName),

return modules.set(this.moduleFile);