|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | return [ |
| 4 | + /* |
| 5 | + |-------------------------------------------------------------------------- |
| 6 | + | Connection |
| 7 | + |-------------------------------------------------------------------------- |
| 8 | + | |
| 9 | + | The dbal connection configuration for the event store. |
| 10 | + | Default is the default database connection, |
| 11 | + | that is configured in the laravel database configuration. |
| 12 | + | |
| 13 | + */ |
| 14 | + |
4 | 15 | 'connection' => [ |
5 | 16 | 'url' => env('EVENT_SOURCING_DB_URL'), |
6 | 17 | 'connection' => env( |
7 | 18 | 'EVENT_SOURCING_DB_CONNECTION', |
8 | 19 | env('DB_CONNECTION', 'sqlite') |
9 | 20 | ), |
10 | 21 | ], |
| 22 | + |
| 23 | + /* |
| 24 | + |-------------------------------------------------------------------------- |
| 25 | + | Store |
| 26 | + |-------------------------------------------------------------------------- |
| 27 | + | |
| 28 | + | Here you can configure the event store. |
| 29 | + | You can choose between different types of stores. |
| 30 | + | |
| 31 | + | dbal_stream (default): Store events in a single table with a stream id. |
| 32 | + | dbal_aggregate: Store events in a single table with the aggregate and aggregate id. |
| 33 | + | in_memory: Store events in memory. |
| 34 | + | custom: Use a custom store, you need to provide a service. |
| 35 | + | |
| 36 | + */ |
| 37 | + |
11 | 38 | 'store' => [ |
12 | | - 'type' => 'dbal_aggregate', |
| 39 | + 'type' => 'dbal_stream', |
13 | 40 | 'service' => null, |
14 | | - 'options' => [] |
| 41 | + 'options' => [ |
| 42 | + 'table_name' => 'eventstore', |
| 43 | + ] |
15 | 44 | ], |
| 45 | + |
| 46 | + /* |
| 47 | + |-------------------------------------------------------------------------- |
| 48 | + | Events, Aggregates, Headers |
| 49 | + |-------------------------------------------------------------------------- |
| 50 | + | |
| 51 | + | Here you can define the paths where the package should look for |
| 52 | + | events, aggregates and headers. |
| 53 | + | |
| 54 | + */ |
| 55 | + |
16 | 56 | 'events' => [app_path()], |
17 | 57 | 'aggregates' => [app_path()], |
18 | 58 | 'headers' => [app_path()], |
| 59 | + |
| 60 | + /* |
| 61 | + |-------------------------------------------------------------------------- |
| 62 | + | Subscription |
| 63 | + |-------------------------------------------------------------------------- |
| 64 | + | |
| 65 | + | Here you can configure the subscription. |
| 66 | + | The subscription engine is default in pseudo sync mode. |
| 67 | + | You can change it to full async mode, |
| 68 | + | by setting 'subscription.run_after_aggregate_save.enabled' to false. |
| 69 | + | In this case you need to use the `event-sourcing:subscription:run` command. |
| 70 | + | You should also set the 'subscription.catch_up' |
| 71 | + | and 'subscription.throw_on_error' to false. |
| 72 | + | |
| 73 | + */ |
| 74 | + |
19 | 75 | 'subscription' => [ |
20 | 76 | 'throw_on_error' => true, |
21 | 77 | 'catch_up' => true, |
|
25 | 81 | 'max_attempts' => 5, |
26 | 82 | ], |
27 | 83 | 'run_after_aggregate_save' => [ |
| 84 | + 'enabled' => true, |
28 | 85 | 'ids' => null, |
29 | 86 | 'groups' => null, |
30 | 87 | 'limit' => null |
31 | 88 | ], |
32 | 89 | ], |
| 90 | + |
| 91 | + /* |
| 92 | + |-------------------------------------------------------------------------- |
| 93 | + | Cryptography |
| 94 | + |-------------------------------------------------------------------------- |
| 95 | + | |
| 96 | + | Here you can enable or disable the cryptography. |
| 97 | + | You can also define the algorithm for the cryptography. |
| 98 | + | |
| 99 | + */ |
| 100 | + |
33 | 101 | 'cryptography' => [ |
34 | 102 | 'enabled' => true, |
35 | 103 | 'algorithm' => 'aes256' |
36 | 104 | ], |
| 105 | + |
| 106 | + /* |
| 107 | + |-------------------------------------------------------------------------- |
| 108 | + | Services |
| 109 | + |-------------------------------------------------------------------------- |
| 110 | + | |
| 111 | + | Here you can define your own services. |
| 112 | + | |
| 113 | + | Upcaster: Upcasters are used to convert old events to new events. |
| 114 | + | Message Decorator: Message Decorators are used to decorate messages. |
| 115 | + | Listener: Listeners are used to listen to events in the event bus. |
| 116 | + | Subscriber: Subscribers are used to subscribe to events for subscription engine. |
| 117 | + | Argument Resolver: Argument Resolvers are used to resolve arguments for subscribers. |
| 118 | + | |
| 119 | + */ |
| 120 | + |
37 | 121 | 'upcaster' => [ |
38 | 122 | // App\Upcaster\YourUpcaster::class |
39 | 123 | ], |
|
0 commit comments