Sathish
Sathish

Reputation: 319

Azure servicebus listener on nestjs

I have one service which handles business logic for my product.

I need to call that service as and when i receive a message through service bus on azure.

I am able to pick the message from azure service bus queue using azure npm package. Ref: https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-nodejs-how-to-use-queues

But when message reached in my app, i am unable to inject the business logic class to the above listener. We are using NestJS framework.

Tech Details: NestJS, NodeJs, Typescript, Azure service bus

Upvotes: 1

Views: 2030

Answers (1)

SaiSakethGuduru
SaiSakethGuduru

Reputation: 2440

Posting Suggestion provided by Jesse-Carter as an answer so that it will be helpful for other community members who face similar kind of issues.

NesBus (Nest / Service Bus) is a microservice extension for NestJS that adds support for Azure Service Bus within NestJS in a simple and intuitive way.

Message Handling

Handling incoming service bus message is now as easy as handling incoming REST requests.

@Controller()

export  class  ServiceBusController  {

 @Queue<MethodDecorator>(({

 name:  'nesbus-queue.demo'

 })

 async  myQueueEntity(@Ctx()  context: SbContext)  {

 }

}

for more information check the NesBus.

Upvotes: 1

Related Questions