2017 © Pedro Peláez
 

library integration-messaging-cqrs

Provides cqrs on top of integration messaging

image

simplycodedsoftware/integration-messaging-cqrs

Provides cqrs on top of integration messaging

  • Wednesday, July 11, 2018
  • by dgafka
  • Repository
  • 1 Watchers
  • 0 Stars
  • 602 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 29 Versions
  • 43 % Grown

The README.md

Integration Messaging CQRS Module

Module proving CQRS functionality. Does work for services and aggregates.
If you're not aware of naming used in here, please read documentation of integration messaging., (*1)

Usage

Service Command Handler
/**
 * @MessageEndpointAnnotation(referenceName="serviceCommandHandlerExample")
 */
class CommandHandlerServiceExample
{
    /**
     * @CommandHandlerAnnotation()
     */
    public function doAction(SomeCommand $command) : void
    {

    }
}
Service Query Handler
/**
 * @MessageEndpointAnnotation()
 */
class QueryHandlerServiceExample
{
    /**
     * @QueryHandlerAnnotation()
     */
    public function searchFor(SomeQuery $query) : SomeResult
    {
        return new SomeResult();
    }
}
Aggregate Command Handler
/**    
 * @AggregateAnnotation()
 */
class Order
{
    /**
     * @param DoStuffCommand $command
     * @CommandHandlerAnnotation()
     */
    public static function register(RegisterNewOrder $command) : void
    {
        // do something
    }

    public functon cancel(CancelOrder $command) : void
    {
        // do something
    }
}


class CancelOrder
{
    /**
     * @var string
     * @AggregateIdAnnotation()
     */
    private $orderId;
    /**
     * @var int
     * @AggregateExpectedVersionAnnotation()
     */
    private $version;
}
Aggregate Query Handler
/**
 * @AggregateAnnotation()
 */
class AggregateQueryHandlerExample
{
    /**
     * @QueryHandlerAnnotation()
     */
    public function doStuff(SomeQuery $query) : SomeResult
    {
        return new SomeResult();
    }
}

How to send messages

inject into your controller/service CommandGateway or QueryGateway

SimplyCodedSoftware\IntegrationMessaging\Cqrs\CommandGateway or SimplyCodedSoftware\IntegrationMessaging\Cqrs\QueryGateway are automatically registered within your container.
They are accessible under class names, so if your container can do auto-wiring then you can just simply type hint in method declaration, to get them injected., (*2)

Manual sending

Send Message with payload as query or command to integration_messaging.cqrs.execute_message message channel, (*3)

Your own flow

If you need to perform some actions, before executing command / query for example deserializing json, then you can benefit from Message Flow extension.
This allows for connecting specific name with message class name. You define default flow, that all your message will go through, or for specific usecases define custom flow.
Also flow will take of of mapping message name to class name, so you know what to deserialize.
To begin flow for message you can make use of SimplyCodedSoftware\IntegrationMessaging\Cqrs\MessageFlowGateway, what you need to pass is message name defined same as in SimplyCodedSoftware\IntegrationMessaging\Cqrs\Annotation\MessageFlowAnnotation.
Then you need to define default channel, where messages will be send integration_messaging.cqrs.start_default_flow, if you will define custom flow for message, then you will also need to create channel after message name.
In headers you will have access to class mapping defined under: integration_messaging.cqrs.message_class, (*4)

The Versions

11/07 2018

dev-master

9999999-dev

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

11/07 2018

0.4.19

0.4.19.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

10/07 2018

0.4.17

0.4.17.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

10/07 2018

0.4.18

0.4.18.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

08/07 2018

0.4.16

0.4.16.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

08/07 2018

0.4.15

0.4.15.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

08/07 2018

0.4.14

0.4.14.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

15/05 2018

0.4.13

0.4.13.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

14/05 2018

0.4.12

0.4.12.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

12/05 2018

0.4.11

0.4.11.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

11/05 2018

0.4.10

0.4.10.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

10/05 2018

0.4.9

0.4.9.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

10/05 2018

0.4.8

0.4.8.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

10/05 2018

0.4.7

0.4.7.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

10/05 2018

0.4.6

0.4.6.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

10/05 2018

0.4.5

0.4.5.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

17/04 2018

0.4.4

0.4.4.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

17/04 2018

0.4.3

0.4.3.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

12/04 2018

0.4.2

0.4.2.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

06/04 2018

0.4.1

0.4.1.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

05/04 2018

0.4.0

0.4.0.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

23/03 2018

0.2.0

0.2.0.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

21/02 2018

0.1.6

0.1.6.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

20/02 2018

0.1.5

0.1.5.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

19/02 2018

0.1.4

0.1.4.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

19/02 2018

0.1.3

0.1.3.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

18/02 2018

0.1.2

0.1.2.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

18/02 2018

0.1.1

0.1.1.0

Provides cqrs on top of integration messaging

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns

18/02 2018

0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dariusz Gafka

command query bus message messaging cqrs handler spring separation enterprise integration patterns