UNPKG

@micro.ts/core

Version:

Microservice framework with Typescript

43 lines (42 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TopicBasedAmqpBroker = void 0; const AmqpBroker_1 = require("./AmqpBroker"); class TopicBasedAmqpBroker extends AmqpBroker_1.AmqpBroker { constructor() { super(...arguments); this.name = "TopicBasedAmqpBroker"; } /** * Get the base topic exchange name */ get baseTopic() { return this.config.topic; } /** * Override of getter for default exchange, return configured topic instead */ get defaultExchange() { return { type: 'topic', name: this.baseTopic }; } /** * Use only the name of the given value to set the topic exchange name * @param value */ set defaultExchange(value) { this.config.topic = value.name; } /** * Init default topic exchange */ construct() { this.defaultExchange = { type: "topic", name: this.baseTopic }; } /** * Get only connection configuration */ get connectionConfig() { return this.config.connection; } } exports.TopicBasedAmqpBroker = TopicBasedAmqpBroker;