Skip to main content

Create Message Broker Service Base


Creates the base service of the Kafka 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 CreateMessageBrokerServiceBaseParams extends EventParams {}


  async afterCreateMessageBrokerServiceBase(
context: DsgContext,
eventParams: CreateMessageBrokerServiceBaseParams,
modules: ModuleMap
): Promise<ModuleMap> {
const { serverDirectories } = context;
const { messageBrokerDirectory } = serverDirectories;
const filePath = resolve(staticDirectory, `kafka.service.base.ts`);

const file = await readFile(filePath, "utf8");
const generateFileName = `kafka.service.base.ts`;

const path = join(messageBrokerDirectory, "base", generateFileName);
modules.set({ code: file, path });
return modules;