Skip to content

Commit 4ee6c37

Browse files
committed
updated examples
1 parent f0ea08e commit 4ee6c37

File tree

2 files changed

+99
-23
lines changed

2 files changed

+99
-23
lines changed

src/examples/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
return [
44

5-
'providers' => [
5+
'providers' => append_config([
66
'FintechFab\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider',
7-
],
7+
]),
88

99
];

src/examples/queue.php

Lines changed: 97 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,120 @@
11
<?php
2-
/**
3-
* This is an example configuration of queue.php for RabbitMQ driver
4-
*
5-
* you can add as many connections as you want
6-
*/
72

83
return [
94

10-
'default' => 'rabbitmq',
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Default Queue Driver
8+
|--------------------------------------------------------------------------
9+
|
10+
| The Laravel queue API supports a variety of back-ends via an unified
11+
| API, giving you convenient access to each back-end using the same
12+
| syntax for each one. Here you may set the default queue driver.
13+
|
14+
| Supported: "null", "sync", "database", "beanstalkd",
15+
| "sqs", "iron", "redis"
16+
|
17+
*/
18+
19+
'default' => env('QUEUE_DRIVER', 'sync'),
20+
21+
/*
22+
|--------------------------------------------------------------------------
23+
| Queue Connections
24+
|--------------------------------------------------------------------------
25+
|
26+
| Here you may configure the connection information for each server that
27+
| is used by your application. A default configuration has been added
28+
| for each back-end shipped with Laravel. You are free to add more.
29+
|
30+
*/
1131

1232
'connections' => [
1333

34+
'sync' => [
35+
'driver' => 'sync',
36+
],
37+
38+
'database' => [
39+
'driver' => 'database',
40+
'table' => 'jobs',
41+
'queue' => 'default',
42+
'expire' => 60,
43+
],
44+
45+
'beanstalkd' => [
46+
'driver' => 'beanstalkd',
47+
'host' => 'localhost',
48+
'queue' => 'default',
49+
'ttr' => 60,
50+
],
51+
52+
'sqs' => [
53+
'driver' => 'sqs',
54+
'key' => 'your-public-key',
55+
'secret' => 'your-secret-key',
56+
'queue' => 'your-queue-url',
57+
'region' => 'us-east-1',
58+
],
59+
60+
'iron' => [
61+
'driver' => 'iron',
62+
'host' => 'mq-aws-us-east-1.iron.io',
63+
'token' => 'your-token',
64+
'project' => 'your-project-id',
65+
'queue' => 'your-queue-name',
66+
'encrypt' => true,
67+
],
68+
69+
'redis' => [
70+
'driver' => 'redis',
71+
'queue' => 'default',
72+
'expire' => 60,
73+
],
74+
1475
'rabbitmq' => [
15-
'driver' => 'rabbitmq',
76+
'driver' => 'rabbitmq',
1677

17-
'host' => '',
18-
'port' => 5672,
78+
'host' => env('RABBITMQ_HOST', '127.0.0.1'),
79+
'port' => env('RABBITMQ_PORT', 5672),
1980

20-
'vhost' => '/',
21-
'login' => '',
22-
'password' => '',
81+
'vhost' => env('RABBITMQ_VHOST', '/'),
82+
'login' => env('RABBITMQ_LOGIN', 'guest'),
83+
'password' => env('RABBITMQ_PASSWORD', 'guest'),
2384

24-
'queue' => '', // name of the default queue,
85+
'queue' => env('RABBITMQ_QUEUE'), // name of the default queue,
2586

2687
'queue_params' => [
27-
'passive' => false,
28-
'durable' => true,
29-
'exclusive' => false,
30-
'auto_delete' => false,
88+
'passive' => env('RABBITMQ_QUEUE_PASSIVE', false),
89+
'durable' => env('RABBITMQ_QUEUE_DURABLE', true),
90+
'exclusive' => env('RABBITMQ_QUEUE_EXCLUSIVE', false),
91+
'auto_delete' => env('RABBITMQ_QUEUE_AUTODELETE', false),
3192
],
3293

3394
'exchange_params' => [
34-
'type' => 'direct', // more info at http://www.rabbitmq.com/tutorials/amqp-concepts.html
35-
'passive' => false,
36-
'durable' => true, // the exchange will survive server restarts
37-
'auto_delete' => false, // the exchange won't be deleted once the channel is closed.
95+
'type' => env('RABBITMQ_EXCHANGE_TYPE', 'direct'), // more info at http://www.rabbitmq.com/tutorials/amqp-concepts.html
96+
'passive' => env('RABBITMQ_EXCHANGE_PASSIVE', false),
97+
'durable' => env('RABBITMQ_EXCHANGE_DURABLE', true), // the exchange will survive server restarts
98+
'auto_delete' => env('RABBITMQ_EXCHANGE_AUTODELETE', false),
3899
],
39100

40101
],
41102

42103
],
43104

105+
/*
106+
|--------------------------------------------------------------------------
107+
| Failed Queue Jobs
108+
|--------------------------------------------------------------------------
109+
|
110+
| These options configure the behavior of failed queue job logging so you
111+
| can control which database and table are used to store the jobs that
112+
| have failed. You may change them to any database / table you wish.
113+
|
114+
*/
115+
116+
'failed' => [
117+
'database' => 'mysql', 'table' => 'failed_jobs',
118+
],
119+
44120
];

0 commit comments

Comments
 (0)