@dbc-tech/nest-dapr
Advanced tools
Comparing version
export interface DaprPubSubMetadata { | ||
name: string; | ||
topicName: string; | ||
route?: string; | ||
} | ||
export declare const DaprPubSub: (name: string, topicName: string) => MethodDecorator; | ||
export declare const DaprPubSub: (name: string, topicName: string, route?: string) => MethodDecorator; |
@@ -6,3 +6,7 @@ "use strict"; | ||
const constants_1 = require("./constants"); | ||
const DaprPubSub = (name, topicName) => (0, common_1.SetMetadata)(constants_1.DAPR_PUBSUB_METADATA, { name, topicName }); | ||
const DaprPubSub = (name, topicName, route) => (0, common_1.SetMetadata)(constants_1.DAPR_PUBSUB_METADATA, { | ||
name, | ||
topicName, | ||
route, | ||
}); | ||
exports.DaprPubSub = DaprPubSub; |
@@ -71,7 +71,7 @@ "use strict"; | ||
} | ||
const { name, topicName } = daprPubSubMetadata; | ||
this.logger.log(`Subscribing to Dapr: ${name}, Topic: ${topicName}`); | ||
const { name, topicName, route } = daprPubSubMetadata; | ||
this.logger.log(`Subscribing to Dapr: ${name}, Topic: ${topicName}${route ? ' on route ' + route : ''}`); | ||
yield this.daprServer.pubsub.subscribe(name, topicName, (data) => __awaiter(this, void 0, void 0, function* () { | ||
instance[methodKey].call(instance, data); | ||
})); | ||
}), route); | ||
}); | ||
@@ -78,0 +78,0 @@ } |
{ | ||
"name": "@dbc-tech/nest-dapr", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Develop NestJs microservices using Dapr pubsub and bindings", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
35444
0.32%346
1.47%