Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"require": {
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"illuminate/contracts": "^10.0 || ^11.0 || ^12.0",
"patchlevel/event-sourcing": "^3.5"
"patchlevel/event-sourcing": "^3.13.0"
},
"require-dev": {
"ext-pdo_sqlite": "*",
Expand Down Expand Up @@ -72,4 +72,4 @@
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi"
}
}
}
244 changes: 125 additions & 119 deletions composer.lock

Large diffs are not rendered by default.

134 changes: 126 additions & 8 deletions config/event-sourcing.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Patchlevel\EventSourcing\Repository\AggregateOutdated;

return [
/*
|--------------------------------------------------------------------------
Expand All @@ -17,6 +19,7 @@
'EVENT_SOURCING_DB_CONNECTION',
env('DB_CONNECTION', 'sqlite')
),
'provide_dedicated_connection' => true,
],

/*
Expand All @@ -27,7 +30,7 @@
| Here you can configure the event store.
| You can choose between different types of stores.
| dbal_aggregate (default): Store events in a single table with the aggregate and aggregate id.
| dbal_stream (experimental): Store events in a single table with a stream id.
| dbal_stream (new default in 4.x): Store events in a single table with a stream id.
| in_memory: Store events in memory.
| custom: Use a custom store, you need to provide a service.
|
Expand All @@ -37,7 +40,36 @@
'service' => null,
'options' => [
'table_name' => 'eventstore',
]
],
'readonly' => false,
'migrate_to_new_store' => [
'enabled' => false,
],
],

/*
|--------------------------------------------------------------------------
| Migrate Store
|--------------------------------------------------------------------------
|
| Here you can configure the migration options for the event store.
| If you enable this option you can use our migration services for a smooth migration.
| You can specify which translators should be used for the migratiop process and also
| to which store you want to migrate.
|
| You can choose between different types of stores:
| dbal_aggregate (default): Store events in a single table with the aggregate and aggregate id.
| dbal_stream (new default in 4.x): Store events in a single table with a stream id.
| in_memory: Store events in memory.
| custom: Use a custom store, you need to provide a service.
|
*/
'migrate_to_new_store' => [
'enabled' => false,
'type' => '',
'service' => null,
'options' => [],
'translators' => [],
],

/*
Expand Down Expand Up @@ -69,11 +101,30 @@
*/
'subscription' => [
'throw_on_error' => true,
'catch_up' => true,
'retry_strategy' => [
'base_delay' => 5,
'delay_factor' => 2,
'max_attempts' => 5,
'catch_up' => [
'enabled' => true,
'limit' => null,
],
'retry_strategies' => [
'default' => [
'type' => 'clock_based',
'options' => [
'base_delay' => 5,
'delay_factor' => 2,
'max_attempts' => 5,
],
],
'no_retry' => [
'type' => 'no_retry',
],
],
'default_retry_strategy' => 'default',
'store' => [
'type' => 'dbal',
'service' => null,
'options' => [
'table_name' => 'subscriptions',
],
],
'run_after_aggregate_save' => [
'enabled' => true,
Expand All @@ -89,6 +140,11 @@
'ids' => null,
'groups' => null,
],
'gap_detection' => [
'enabled' => true,
'retries_in_ms' => [0, 5, 50, 500],
'detection_window' => 'PT5M',
],
],

/*
Expand All @@ -98,11 +154,73 @@
|
| Here you can enable or disable the cryptography.
| You can also define the algorithm for the cryptography.
| It is disabled by default, because it requires the openssl extension
| and has a performance impact due to registered listeners.
|
*/
'cryptography' => [
'enabled' => false,
'algorithm' => 'aes256',
'use_encrypted_field_name' => true,
'fallback_to_field_name' => false,
],

/*
|--------------------------------------------------------------------------
| CommandBus
|--------------------------------------------------------------------------
|
| Here you can enable or disable the command bus.
| You can also configure the command bus regarding the retries and the handlers.
|
*/
'command_bus' => [
'enabled' => true,
'instant_retry' => [
'max_retries' => 3,
'exceptions' => [
AggregateOutdated::class,
],
],
],

/*
|--------------------------------------------------------------------------
| QueryBus
|--------------------------------------------------------------------------
|
| Here you can enable or disable the query bus.
|
*/
'query_bus' => [
'enabled' => true,
'algorithm' => 'aes256'
],

/*
|--------------------------------------------------------------------------
| EventBus
|--------------------------------------------------------------------------
|
| Here you can enable or disable the event bus.
| The subscription engine is highly recommended to use instead of the event bus.
|
*/
'event_bus' => [
'enabled' => false,
],

/*
|--------------------------------------------------------------------------
| Clock
|--------------------------------------------------------------------------
|
| Here you can enable or disable the freeze clock or set a custom clock.
| This is useful for testing purposes.
|
*/
'clock' => [
'freeze' => null,
'service' => null,
],

/*
Expand Down
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ nav:
- Installation: installation.md
- Getting Started: getting_started.md
- Facades: facades.md
- Configuration: configuration.md
- Links:
- Blog: https://patchlevel.de/blog
- Library Documentation: https://event-sourcing.patchlevel.io/latest/
Expand Down
Loading
Loading