Skip to main content

Create Message Broker Service


Creates the 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 CreateMessageBrokerServiceParams extends EventParams {}


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

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

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