File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,14 +22,17 @@ $ composer require enqueue/sqs
2222``` php
2323<?php
2424use 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®ion=aRegion');
34+
35+ $psrContext = $factory->createContext();
3336```
3437
3538## Declare queue.
Original file line number Diff line number Diff line change @@ -18,15 +18,26 @@ $ composer require enqueue/stomp
1818<?php
1919use 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
You can’t perform that action at this time.
0 commit comments