Skip to content

Commit 62c0b76

Browse files
committed
[docs] add docs for sqs and stomp DSNs
1 parent c81b4ca commit 62c0b76

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

‎docs/transport/sqs.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ $ composer require enqueue/sqs
2222
```php
2323
<?php
2424
use Enqueue\Sqs\SqsConnectionFactory;
25-
26-
$connectionFactory = new SqsConnectionFactory([
25+
26+
$factory = new SqsConnectionFactory([
2727
'key' => 'aKey',
2828
'secret' => 'aSecret',
2929
'region' => 'aRegion',
3030
]);
3131

32-
$psrContext = $connectionFactory->createContext();
32+
// same as above but given as DSN string
33+
$factory = new SqsConnectionFactory('sqs:?key=aKey&secret=aSecret&region=aRegion');
34+
35+
$psrContext = $factory->createContext();
3336
```
3437

3538
## Declare queue.

‎docs/transport/stomp.md‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,26 @@ $ composer require enqueue/stomp
1818
<?php
1919
use Enqueue\Stomp\StompConnectionFactory;
2020

21-
$connectionFactory = new StompConnectionFactory([
22-
'host' => '127.0.0.1',
23-
'port' => 61613,
24-
'login' => 'guest',
25-
'password' => 'guest',
26-
'vhost' => '/',
21+
// connects to localhost
22+
$factory = new StompConnectionFactory();
23+
24+
// same as above
25+
$factory = new StompConnectionFactory('stomp:');
26+
27+
// same as above
28+
$factory = new StompConnectionFactory([]);
29+
30+
// connect to stomp broker at example.com port 1000 using
31+
$factory = new StompConnectionFactory([
32+
'host' => 'example.com',
33+
'port' => 1000,
34+
'login' => 'theLogin',
2735
]);
2836

29-
$psrContext = $connectionFactory->createContext();
37+
// same as above but given as DSN string
38+
$factory = new StompConnectionFactory('stomp://example.com:1000?login=theLogin');
39+
40+
$psrContext = $factory->createContext();
3041
```
3142

3243
## Send message to topic

0 commit comments

Comments
 (0)