-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-183: change request with no subject merged in GitBook
- Loading branch information
1 parent
0379dd9
commit c87354a
Showing
6 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
description: >- | ||
For BullMQ you are going to need a proper Redis™ hosting solution. In this | ||
section we provide instructions on how to use some of the most popular ones. | ||
--- | ||
|
||
# Redis™ hosting | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# AWS Elasticache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# AWS MemoryDB | ||
|
||
AWS provides a Redis™ 7 compatible managed database that is easy to use and is fully compatible with BullMQ. | ||
|
||
There are some considerations to take care when using MemoryDB though. | ||
|
||
* MemoryDB only works in Cluster mode. So you need to use "hash tags" so that the queues get attached to a given cluster node ([read more here](../../bull/patterns/redis-cluster.md)). | ||
* MemoryDB can only be accessed within an AWS VPC, so you cannot access the Redis™ cluster outside of AWS. | ||
|
||
The easiest way to use MemoryDB with BullMQ is to first instantiate a IORedis Cluster instance, and then use that connection as an option to your workers or queue instances, for example: | ||
|
||
```typescript | ||
import { Cluster } from "ioredis" | ||
import { Worker } from "bullmq" | ||
|
||
const connection = new Cluster( | ||
[ | ||
{ | ||
host: "clustercfg.xxx.amazonaws.com", | ||
port: 6379, | ||
}, | ||
], | ||
{ | ||
tls: {}, | ||
} | ||
); | ||
|
||
const worker = new Worker("myqueue", async (job: Job) => { | ||
// Do some usefull stuff | ||
}, { connection }); | ||
|
||
// ... | ||
|
||
// Do not forget to close the connection as well as the worker when shutting down | ||
await worker.close(); | ||
await connection.quit(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Redis Cluster | ||
|