Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 1x 1x 1x 1x 1x 1x 1x 1x 1x | import ACommonNode from '@orchesty/nodejs-sdk/dist/lib/Commons/ACommonNode';
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
import RabbitMqApplication, { IQueueArguments } from '../RabbitMqApplication';
export const NAME = 'rabbitmq-send-message-custom-node';
export default class RabbitMqSendMessageCustomNode extends ACommonNode {
public getName(): string {
return NAME;
}
public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto> {
const appInstall = await this.getApplicationInstallFromProcess(dto);
const { queue, queueParams, ...res } = dto.getJsonData();
const q = await this.getApplication<RabbitMqApplication>().getQueue(appInstall, queue, queueParams);
await q.publish(JSON.stringify(res));
return dto;
}
}
export interface IInput {
queue: string;
queueParams?: IQueueArguments;
}
|