From 414595727d611ff774c4f404a4eeea509cf03a71 Mon Sep 17 00:00:00 2001 From: Alexander Shenshin <93187809+AlexanderShenshin@users.noreply.github.com> Date: Wed, 3 May 2023 09:55:34 +0300 Subject: [PATCH] fix: Emit RoutingCreated event for mediator routing record (#1445) --- .../src/modules/routing/services/MediatorService.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/core/src/modules/routing/services/MediatorService.ts b/packages/core/src/modules/routing/services/MediatorService.ts index 8bd916e9a3..751f928a60 100644 --- a/packages/core/src/modules/routing/services/MediatorService.ts +++ b/packages/core/src/modules/routing/services/MediatorService.ts @@ -212,6 +212,17 @@ export class MediatorService { await this.mediatorRoutingRepository.save(agentContext, routingRecord) + this.eventEmitter.emit(agentContext, { + type: RoutingEventTypes.RoutingCreatedEvent, + payload: { + routing: { + endpoints: agentContext.config.endpoints, + routingKeys: [], + recipientKey: routingKey, + }, + }, + }) + return routingRecord }