diff --git a/notification-service/src/app.ts b/notification-service/src/app.ts index e51be6c58d..b46e27ab8f 100644 --- a/notification-service/src/app.ts +++ b/notification-service/src/app.ts @@ -1,4 +1,4 @@ -import { ApplicationState, COMMON_CONNECTION_CONFIG, DatabaseServer, GenerateTLSOptionsNats, MessageBrokerChannel, Migration, mongoForLoggingInitialization, PinoLogger, pinoLoggerInitialization } from '@guardian/common'; +import { ApplicationState, COMMON_CONNECTION_CONFIG, DatabaseServer, GenerateTLSOptionsNats, LargePayloadContainer, MessageBrokerChannel, Migration, mongoForLoggingInitialization, PinoLogger, pinoLoggerInitialization } from '@guardian/common'; import { ApplicationStates } from '@guardian/interfaces'; import { MikroORM } from '@mikro-orm/core'; import { MongoDriver } from '@mikro-orm/mongodb'; @@ -54,6 +54,12 @@ Promise.all([ state.updateState(ApplicationStates.STARTED); state.updateState(ApplicationStates.INITIALIZING); state.updateState(ApplicationStates.READY); + + const maxPayload = parseInt(process.env.MQ_MAX_PAYLOAD, 10); + if (Number.isInteger(maxPayload)) { + new LargePayloadContainer().runServer(); + } + await logger.info('notification service started', ['NOTIFICATION_SERVICE']); }, (reason) => {