
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
nestjs-azure-service-bus
Advanced tools
A dynamic module for NestJS that provides integration with Azure Service Bus.
A dynamic module for NestJS that provides integration with Azure Service Bus.
npm install nestjs-azure-service-bus
The NestJS Azure Service Bus package allows you to easily integrate Azure Service Bus into your NestJS applications. It provides decorators for injecting Azure Service Bus senders and receivers, as well as a dynamic module for configuring the Azure Service Bus client.
To use the Azure Service Bus module, import it into your NestJS application's root module:
import { Module } from '@nestjs/common';
import { AzureServiceBusModule } from 'nestjs-azure-service-bus';
@Module({
imports: [
AzureServiceBusModule.forRoot({
connectionString: '<your-connection-string>',
}),
],
})
export class AppModule {}
Replace <your-connection-string>
with your Azure Service Bus connection string.
You can use the Sender
and Receiver
decorators provided by the module to inject Azure Service Bus senders and receivers into your classes:
import { Injectable } from '@nestjs/common';
import { Sender, Receiver } from 'nestjs-azure-service-bus';
@Injectable()
export class MyService {
constructor(
@Sender('my-queue') private readonly sender: ServiceBusSender,
@Receiver('my-queue') private readonly receiver: ServiceBusReceiver,
) {}
// Use the sender and receiver in your methods
}
Replace 'my-queue'
with the name of your Azure Service Bus queue.
The forRoot
method of the AzureServiceBusModule
accepts a configuration object with two possible options:
connectionString
: The connection string for your Azure Service Bus namespace.fullyQualifiedNamespace
: The fully qualified namespace of your Azure Service Bus namespace.You can provide either the connectionString
or the fullyQualifiedNamespace
, but not both.
The forFeature
method of the AzureServiceBusModule
allows you to configure senders and receivers dynamically. It accepts an options object with two properties:
senders
: An array of sender names.receivers
: An array of receiver names.import { Module } from '@nestjs/common';
import { AzureServiceBusModule } from 'nestjs-azure-service-bus';
@Module({
imports: [
AzureServiceBusModule.forFeature({
senders: ['sender1', 'sender2'],
receivers: ['receiver1', 'receiver2'],
}),
],
})
export class MyModule {}
This will create senders and receivers for the specified queues.
This package is MIT licensed.
FAQs
A dynamic module for NestJS that provides integration with Azure Service Bus.
The npm package nestjs-azure-service-bus receives a total of 97 weekly downloads. As such, nestjs-azure-service-bus popularity was classified as not popular.
We found that nestjs-azure-service-bus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.