Skip to content

Commit 2416b28

Browse files
committed
[sqs][docs] Add docs for multi sqs client use
1 parent 4dbec68 commit 2416b28

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎docs/transport/sqs.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,23 @@ $queue = $context->createQueue('foo');
142142
$queue->setQueueOwnerAWSAccountId('awsAccountId');
143143
```
144144

145+
## Multi region examples
146+
147+
Enqueue SQS provides a generic multi-region support. This enables users to specify which AWS Region to send a command to by setting region on SqsDestination.
148+
You might need it to access SQS FIFO queue because they are not available for all regions.
149+
If not specified the default region is used.
150+
151+
```php
152+
<?php
153+
use Enqueue\Sqs\SqsConnectionFactory;
154+
155+
$context = (new SqsConnectionFactory('sqs:?region=eu-west-2'))->createContext();
156+
157+
$queue = $context->createQueue('foo');
158+
$queue->setRegion('us-west-2');
159+
160+
// the request goes to US West (Oregon) Region
161+
$context->declareQueue($queue);
162+
```
163+
145164
[back to index](../index.md)

0 commit comments

Comments
 (0)