Download the PHP package simplycodedsoftware/integration-messaging-cqrs without Composer

On this page you can find all versions of the php package simplycodedsoftware/integration-messaging-cqrs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package integration-messaging-cqrs

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.

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.

Manual sending

Send Message with payload as query or command to integration_messaging.cqrs.execute_message message channel

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


All versions of integration-messaging-cqrs with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
simplycodedsoftware/integration-messaging Version ^0.4.0
doctrine/orm Version ^2.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package simplycodedsoftware/integration-messaging-cqrs contains the following files

Loading the files please wait ....