Skip to content

microservice-job-broker


Class: ExecutableService

Defined in: packages/microservice/job-broker/src/executable/services/executable.service.ts:18

Produces executable task messages to RabbitMQ and updates task status.

Sets up queues/exchanges and sends validated ExecutionTask payloads for workers to execute.

Implements

  • OnApplicationBootstrap

Constructors

Constructor

new ExecutableService(executableJobModel, configSvc): ExecutableService

Defined in: packages/microservice/job-broker/src/executable/services/executable.service.ts:28

Construct the service with persistence and configuration dependencies.

Parameters

executableJobModel

Model<ExecutableJobReport>

Mongoose model to update task status records

configSvc

ConfigService

Nest ConfigService for RabbitMQ connectivity and queue names

Returns

ExecutableService

Methods

createAndQueueTask()

createAndQueueTask(task): Promise<void>

Defined in: packages/microservice/job-broker/src/executable/services/executable.service.ts:105

Validate and enqueue an executable task to the configured RabbitMQ queue.

Parameters

task

ExecutionTask

The executable task payload including executable, arguments, env and identifier.

Returns

Promise<void>


onApplicationBootstrap()

onApplicationBootstrap(): Promise<void>

Defined in: packages/microservice/job-broker/src/executable/services/executable.service.ts:58

Initialize the RabbitMQ channel and declare queues/exchanges on app startup.

Returns

Promise<void>

Implementation of

OnApplicationBootstrap.onApplicationBootstrap