Skip to content

Commit 22dba41

Browse files
committed
Update SQS adapter usage examples
1 parent fd13739 commit 22dba41

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

packages/queue/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ const isProduction = process.env.NODE_ENV === "production";
108108
const outgoingQueue = new MQueue.Outgoing(
109109
isProduction
110110
? await AmqplibOutgoingQueue.connect("amqp://rabbitmq:5271", "queue-name")
111-
: await SQSOutgoingQueue.connect("amqp://rabbitmq:5271", "queue-name"),
111+
: await SQSOutgoingQueue.connect("/queue1", {
112+
credentials: { accessKeyId: "x", secretAccessKey: "x" },
113+
region: "elasticmq", // or applicable AWS region for SQS
114+
endpoint: "http://elasticmq:9324",
115+
}),
112116
);
113117

114118
outgoingQueue.sendMessage({
@@ -123,7 +127,11 @@ outgoingQueue.sendMessage({
123127
const incomingQueue = new MQueue.Incoming(
124128
isProduction
125129
? await AmqplibIncomingQueue.connect("amqp://rabbitmq:5271", "queue-name")
126-
: await SQSIncomingQueue.connect("amqp://rabbitmq:5271", "queue-name"),
130+
: await SQSIncomingQueue.connect("/queue1", {
131+
credentials: { accessKeyId: "x", secretAccessKey: "x" },
132+
region: "elasticmq", // or applicable AWS region for SQS
133+
endpoint: "http://elasticmq:9324",
134+
}),
127135
);
128136
```
129137

packages/sqs/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import MQueue from "@mqueue/queue"; // or require("@mqueue/queue")
1616
import { SQSQueue } from "@mqueue/fastq"; // or require("@mqueue/fastq");
1717

1818
const outgoingQueue = new MQueue.Outgoing(
19-
await SQSQueue.Outgoing.connect("amqp://rabbitmq:5271", "queue-name"),
19+
await SQSQueue.Outgoing.connect("/queue1", {
20+
credentials: { accessKeyId: "x", secretAccessKey: "x" },
21+
region: "elasticmq", // or applicable AWS region for SQS
22+
endpoint: "http://elasticmq:9324",
23+
}),
2024
);
2125

2226
outgoingQueue.sendMessage({
@@ -29,7 +33,11 @@ outgoingQueue.sendMessage({
2933
// ...
3034

3135
const incomingQueue = new MQueue.Incoming(
32-
await SQSQueue.Incoming.connect("amqp://rabbitmq:5271", "queue-name"),
36+
await SQSQueue.Incoming.connect("/queue1", {
37+
credentials: { accessKeyId: "x", secretAccessKey: "x" },
38+
region: "elasticmq", // or applicable AWS region for SQS
39+
endpoint: "http://elasticmq:9324",
40+
}),
3341
);
3442

3543
// Start listening to the queue

packages/sqs/tests/ElasticMQContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ export class StartedElasticMQContainer extends AbstractStartedContainer {
7777
}
7878

7979
public getSQSUrl(): string {
80-
return `http://${this.useAlias ? "activemq" : this.getHost()}:${this.getRestPort()}`;
80+
return `http://${this.useAlias ? "elasticmq" : this.getHost()}:${this.getRestPort()}`;
8181
}
8282
}

0 commit comments

Comments
 (0)