Configuration
Just like any other nestjs packages, we need to import the Mailman
module in your application.
The package support both static and dynamic imports for the module. To learn the difference between the two, check here.
Note
Since, you may want to dispatch jobs from several modules, hence the QueueModule is imported globally.
Static Import
To import the module statically, you can do
Dynamic Import (recommended)
To import the module dynamically, you can do
info
AWS_PROFILE
, AWS_SQS_PREFIX
, AWS_SQS_QUEUE
, AWS_REGION
are environment variables and live in .env(.local or .production) file.
Note that these attributes will change as per the driver.
note
Remember to load the configuration in ConfigModule
. Read more about it here.
Now that the configuration is loaded, you can import your module asynchronously.
List of Available Drivers
Driver | Constant |
---|---|
Sync (Runs your code syncronously) | SyncQueueDriver |
AWS SQS | SqsQueueDriver |
Redis | RedisQueueDriver |
To learn more about various drivers, head over to the drivers section.