-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added recipe for the Prooph pack #320
Merged
Merged
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ff73795
Added recipe for prooph/service-bus-symfony-bundle
gquemener 1d6cb4b
Fixed invalid versionning
gquemener 1d495c0
Register ProophServiceBusBundle
gquemener a3e37cc
Autowired default command bus
gquemener 41dca24
Auto-register command handlers
gquemener 9e9d069
Revert "Auto-register command handlers"
gquemener 2fde35c
Defined recipe for the prooph pack
gquemener 17a7249
Defined prooph service bus bundle default config
gquemener 26ec16d
Autowired command handlers
gquemener b5711fb
Added empty command directory
gquemener 31b7ce8
Added initial configuration of the prooph pack
gquemener f418071
Fixed malformed bundle FQCN
gquemener fb0e9e5
Moved config in the correct directory
gquemener 2013913
No need to copy the content of the src/ directory
gquemener 053b5d8
Created Prooph package recipes
gquemener d218ca1
Renamed pdo event store config file
gquemener 1054024
Copied database init scripts into config directory
gquemener ee6ef3a
Eased default stream creation
gquemener 1db9529
Dispatched persisted events on app event bus
gquemener 02c6ded
Added configuration to setup TransactionManager
gquemener c48c336
Used comand bus lib interface for service id
gquemener 403a1fa
Increased explicitness of service definitions
gquemener 2385bdc
Added a default query bus
gquemener e167532
Added hint to auto register command handlers
gquemener 6232196
Added post installation hints
gquemener f45406f
Fixed PDO event store SQL scripts copy
gquemener 00ba2ea
Fixed multi-package travis build
gquemener 3bf651b
Reverted style change
gquemener 838f441
Reverted travis multi packages support
gquemener 47394ca
Removed comments from config files
gquemener 245e200
Reduced number of env vars
gquemener File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
prooph/event-store-bus-bridge/3.1/config/packages/prooph_event_store_bus_bridge.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
services: | ||
_defaults: | ||
public: false | ||
|
||
Prooph\EventStoreBusBridge\EventPublisher: | ||
arguments: | ||
- '@prooph_service_bus.default_event_bus' | ||
tags: | ||
- { name: 'prooph_event_store.default.plugin' } | ||
|
||
Prooph\EventStoreBusBridge\TransactionManager: | ||
arguments: | ||
- '@app.event_store.default' | ||
tags: | ||
- { name: 'prooph_service_bus.default_command_bus.plugin' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"copy-from-recipe": { | ||
"config/": "%CONFIG_DIR%/" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
prooph/event-store-symfony-bundle/0.4/config/packages/prooph_event_store.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
prooph_event_store: | ||
stores: | ||
default: | ||
event_store: 'app.event_store.default' | ||
|
||
services: | ||
_defaults: | ||
public: false | ||
|
||
Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator: ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"bundles": { | ||
"Prooph\\Bundle\\EventStore\\ProophEventStoreBundle": ["all"] | ||
}, | ||
"copy-from-recipe": { | ||
"config/": "%CONFIG_DIR%/", | ||
"src/": "%SRC_DIR%/" | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
prooph/event-store-symfony-bundle/0.4/src/Command/CreateEventStreamCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Command; | ||
|
||
use Prooph\EventStore\EventStore; | ||
use Prooph\EventStore\Stream; | ||
use Prooph\EventStore\StreamName; | ||
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
final class CreateEventStreamCommand extends ContainerAwareCommand | ||
{ | ||
private $eventStore; | ||
|
||
public function __construct(EventStore $eventStore) | ||
{ | ||
$this->eventStore = $eventStore; | ||
} | ||
|
||
protected function configure() | ||
{ | ||
$this->setName('event-store:event-stream:create') | ||
->setDescription('Create event_stream.') | ||
->setHelp('This command creates the event_stream'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$this->eventStore->create(new Stream(new StreamName('event_stream'), new \ArrayIterator([]))); | ||
|
||
$output->writeln('<info>Event stream was created successfully.</info>'); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
prooph/pdo-event-store/1.7/config/packages/prooph_pdo_event_store.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
services: | ||
_defaults: | ||
public: false | ||
|
||
Prooph\EventStore\EventStore: '@app.event_store.default' | ||
|
||
app.event_store.default: | ||
class: Prooph\EventStore\Pdo\MySqlEventStore | ||
arguments: | ||
- '@prooph_event_store.message_factory' | ||
- '@app.event_store.pdo_connection.mysql' | ||
- '@app.event_store.mysql.persistence_strategy' | ||
|
||
app.event_store.pdo_connection.mysql: | ||
class: \PDO | ||
arguments: | ||
- 'mysql:host=%env(MYSQL_HOST)%;dbname=%env(MYSQL_DBNAME)%' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could use a environment variable like "MSQL_DSN" here instead. |
||
- '%env(MYSQL_USER)%' | ||
- '%env(MYSQL_PASSWORD)%' | ||
|
||
app.event_store.mysql.persistence_strategy: | ||
class: Prooph\EventStore\Pdo\PersistenceStrategy\MySqlSingleStreamStrategy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"copy-from-recipe": { | ||
"config/": "%CONFIG_DIR%/" | ||
}, | ||
"copy-from-package": { | ||
"scripts/": "%CONFIG_DIR%/scripts/" | ||
}, | ||
"env": { | ||
"MYSQL_HOST": "127.0.0.1", | ||
"MYSQL_DBNAME": "event_streams", | ||
"MYSQL_USER": "user", | ||
"MYSQL_PASSWORD": "password" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<bg=blue;fg=white> </> | ||
<bg=blue;fg=white> MySql Event Store Configuration </> | ||
<bg=blue;fg=white> </> | ||
|
||
* Modify your MYSQL_* configuration in <fg=green>.env</> | ||
|
||
* Create event streams and projections tables using SQL scripts | ||
in <comment>%CONFIG_DIR%/scripts/*</comment> |
13 changes: 13 additions & 0 deletions
13
prooph/service-bus-symfony-bundle/0.6/config/packages/prooph_service_bus.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
prooph_service_bus: | ||
command_buses: | ||
default_command_bus: ~ | ||
event_buses: | ||
default_event_bus: ~ | ||
query_buses: | ||
default_query_bus: ~ | ||
|
||
services: | ||
_defaults: | ||
public: false | ||
|
||
Prooph\ServiceBus\CommandBus: '@prooph_service_bus.default_command_bus' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"bundles": { | ||
"Prooph\\Bundle\\ServiceBus\\ProophServiceBusBundle": ["all"] | ||
}, | ||
"copy-from-recipe": { | ||
"config/": "%CONFIG_DIR%/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<bg=blue;fg=white> </> | ||
<bg=blue;fg=white> Service Bus Configuration </> | ||
<bg=blue;fg=white> </> | ||
|
||
* Verify and uncomment the configuration in <comment>%CONFIG_DIR%/packages/prooph_service_bus.yaml</> | ||
to register message handlers | ||
|
||
* Dispatch commands by injecting | ||
the <comment>Prooph\ServiceBus\CommandBus</comment> service into your controllers |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about explicitly passing the event bus (
@prooph_service_bus.app_event_bus
) as argument?This would make copy and paste for new buses/stores more transparent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, configuration might benefit from being a bit more explicit here.
In that case, I would remove the
Prooph\ServiceBus\EventBus
service alias.