|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +use Patchlevel\EventSourcing\Repository\AggregateOutdated; |
| 4 | + |
3 | 5 | return [ |
4 | 6 | /* |
5 | 7 | |-------------------------------------------------------------------------- |
|
17 | 19 | 'EVENT_SOURCING_DB_CONNECTION', |
18 | 20 | env('DB_CONNECTION', 'sqlite') |
19 | 21 | ), |
| 22 | + 'provide_dedicated_connection' => true, |
20 | 23 | ], |
21 | 24 |
|
22 | 25 | /* |
|
27 | 30 | | Here you can configure the event store. |
28 | 31 | | You can choose between different types of stores. |
29 | 32 | | dbal_aggregate (default): Store events in a single table with the aggregate and aggregate id. |
30 | | - | dbal_stream (experimental): Store events in a single table with a stream id. |
| 33 | + | dbal_stream (new default in 4.x): Store events in a single table with a stream id. |
31 | 34 | | in_memory: Store events in memory. |
32 | 35 | | custom: Use a custom store, you need to provide a service. |
33 | 36 | | |
|
37 | 40 | 'service' => null, |
38 | 41 | 'options' => [ |
39 | 42 | 'table_name' => 'eventstore', |
40 | | - ] |
| 43 | + ], |
| 44 | + 'readonly' => false, |
| 45 | + 'migrate_to_new_store' => [ |
| 46 | + 'enabled' => false, |
| 47 | + ], |
| 48 | + ], |
| 49 | + |
| 50 | + /* |
| 51 | + |-------------------------------------------------------------------------- |
| 52 | + | Migrate Store |
| 53 | + |-------------------------------------------------------------------------- |
| 54 | + | |
| 55 | + | Here you can configure the migration options for the event store. |
| 56 | + | If you enable this option you can use our migration services for a smooth migration. |
| 57 | + | You can specify which translators should be used for the migratiop process and also |
| 58 | + | to which store you want to migrate. |
| 59 | + | |
| 60 | + | You can choose between different types of stores: |
| 61 | + | dbal_aggregate (default): Store events in a single table with the aggregate and aggregate id. |
| 62 | + | dbal_stream (new default in 4.x): Store events in a single table with a stream id. |
| 63 | + | in_memory: Store events in memory. |
| 64 | + | custom: Use a custom store, you need to provide a service. |
| 65 | + | |
| 66 | + */ |
| 67 | + 'migrate_to_new_store' => [ |
| 68 | + 'enabled' => false, |
| 69 | + 'type' => '', |
| 70 | + 'service' => null, |
| 71 | + 'options' => [], |
| 72 | + 'translators' => [], |
41 | 73 | ], |
42 | 74 |
|
43 | 75 | /* |
|
69 | 101 | */ |
70 | 102 | 'subscription' => [ |
71 | 103 | 'throw_on_error' => true, |
72 | | - 'catch_up' => true, |
73 | | - 'retry_strategy' => [ |
74 | | - 'base_delay' => 5, |
75 | | - 'delay_factor' => 2, |
76 | | - 'max_attempts' => 5, |
| 104 | + 'catch_up' => [ |
| 105 | + 'enabled' => true, |
| 106 | + 'limit' => null, |
| 107 | + ], |
| 108 | + 'retry_strategies' => [ |
| 109 | + 'default' => [ |
| 110 | + 'type' => 'clock_based', |
| 111 | + 'options' => [ |
| 112 | + 'base_delay' => 5, |
| 113 | + 'delay_factor' => 2, |
| 114 | + 'max_attempts' => 5, |
| 115 | + ], |
| 116 | + ], |
| 117 | + 'no_retry' => [ |
| 118 | + 'type' => 'no_retry', |
| 119 | + ], |
| 120 | + ], |
| 121 | + 'default_retry_strategy' => 'default', |
| 122 | + 'store' => [ |
| 123 | + 'type' => 'dbal', |
| 124 | + 'service' => null, |
| 125 | + 'options' => [ |
| 126 | + 'table_name' => 'subscriptions', |
| 127 | + ], |
77 | 128 | ], |
78 | 129 | 'run_after_aggregate_save' => [ |
79 | 130 | 'enabled' => true, |
|
89 | 140 | 'ids' => null, |
90 | 141 | 'groups' => null, |
91 | 142 | ], |
| 143 | + 'gap_detection' => [ |
| 144 | + 'enabled' => false, |
| 145 | + 'retries_in_ms' => [0, 5, 50, 500], |
| 146 | + 'detection_window' => 'PT5M', |
| 147 | + ], |
92 | 148 | ], |
93 | 149 |
|
94 | 150 | /* |
|
102 | 158 | */ |
103 | 159 | 'cryptography' => [ |
104 | 160 | 'enabled' => true, |
105 | | - 'algorithm' => 'aes256' |
| 161 | + 'algorithm' => 'aes256', |
| 162 | + 'use_encrypted_field_name' => false, |
| 163 | + 'fallback_to_field_name' => false, |
| 164 | + ], |
| 165 | + |
| 166 | + /* |
| 167 | + |-------------------------------------------------------------------------- |
| 168 | + | CommandBus |
| 169 | + |-------------------------------------------------------------------------- |
| 170 | + | |
| 171 | + | Here you can enable or disable the command bus. |
| 172 | + | You can also configure the command bus regarding the retries and the handlers. |
| 173 | + | |
| 174 | + */ |
| 175 | + 'command_bus' => [ |
| 176 | + 'enabled' => true, |
| 177 | + 'instant_retry' => [ |
| 178 | + 'max_retries' => 3, |
| 179 | + 'exceptions' => [ |
| 180 | + AggregateOutdated::class, |
| 181 | + ], |
| 182 | + ], |
| 183 | + ], |
| 184 | + |
| 185 | + /* |
| 186 | + |-------------------------------------------------------------------------- |
| 187 | + | QueryBus |
| 188 | + |-------------------------------------------------------------------------- |
| 189 | + | |
| 190 | + | Here you can enable or disable the query bus. |
| 191 | + | |
| 192 | + */ |
| 193 | + 'query_bus' => [ |
| 194 | + 'enabled' => true, |
| 195 | + ], |
| 196 | + |
| 197 | + /* |
| 198 | + |-------------------------------------------------------------------------- |
| 199 | + | EventBus |
| 200 | + |-------------------------------------------------------------------------- |
| 201 | + | |
| 202 | + | Here you can enable or disable the event bus. |
| 203 | + | The subscription engine is highly recommended to use instead of the event bus. |
| 204 | + | |
| 205 | + */ |
| 206 | + 'event_bus' => [ |
| 207 | + 'enabled' => false, |
| 208 | + ], |
| 209 | + |
| 210 | + /* |
| 211 | + |-------------------------------------------------------------------------- |
| 212 | + | Clock |
| 213 | + |-------------------------------------------------------------------------- |
| 214 | + | |
| 215 | + | Here you can enable or disable the freeze clock or set a custom clock. |
| 216 | + | This is useful for testing purposes. |
| 217 | + | |
| 218 | + */ |
| 219 | + 'clock' => [ |
| 220 | + 'freeze' => null, |
| 221 | + 'service' => null, |
106 | 222 | ], |
107 | 223 |
|
108 | 224 | /* |
|
0 commit comments