PHPackages                             simplycodedsoftware/integration-messaging-cqrs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. simplycodedsoftware/integration-messaging-cqrs

Abandoned → [ecotone/ecotone](/?search=ecotone%2Fecotone)Library[Queues &amp; Workers](/categories/queues)

simplycodedsoftware/integration-messaging-cqrs
==============================================

Provides cqrs on top of integration messaging

0.4.21(7y ago)0979MITPHPPHP &gt;=7.1.0

Since Feb 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/SimplyCodedSoftware/integration-messaging-cqrs)[ Packagist](https://packagist.org/packages/simplycodedsoftware/integration-messaging-cqrs)[ RSS](/packages/simplycodedsoftware-integration-messaging-cqrs/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (5)Versions (31)Used By (0)

Integration Messaging CQRS Module
=================================

[](#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](https://github.com/SimplyCodedSoftware/integration-messaging).

#### Usage

[](#usage)

##### Service Command Handler

[](#service-command-handler)

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

    }
}

```

##### Service Query Handler

[](#service-query-handler)

```
/**
 * @MessageEndpointAnnotation()
 */
class QueryHandlerServiceExample
{
    /**
     * @QueryHandlerAnnotation()
     */
    public function searchFor(SomeQuery $query) : SomeResult
    {
        return new SomeResult();
    }
}

```

##### Aggregate Command Handler

[](#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

[](#aggregate-query-handler)

```
/**
 * @AggregateAnnotation()
 */
class AggregateQueryHandlerExample
{
    /**
     * @QueryHandlerAnnotation()
     */
    public function doStuff(SomeQuery $query) : SomeResult
    {
        return new SomeResult();
    }
}

```

#### How to send messages

[](#how-to-send-messages)

##### inject into your controller/service CommandGateway or QueryGateway

[](#inject-into-your-controllerservice-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

[](#manual-sending)

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

#### Your own flow

[](#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`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

30

Last Release

2831d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b6139b0dc15c550b22c76954ec6a96ac6c46b4c19b4a3c1e93c2146481e109e?d=identicon)[dgafka](/maintainers/dgafka)

---

Top Contributors

[![dgafka](https://avatars.githubusercontent.com/u/6060791?v=4)](https://github.com/dgafka "dgafka (42 commits)")

---

Tags

messagequeryhandlermessagingcommandbuscqrsenterprise integration patternsspringseparation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/simplycodedsoftware-integration-messaging-cqrs/health.svg)

```
[![Health](https://phpackages.com/badges/simplycodedsoftware-integration-messaging-cqrs/health.svg)](https://phpackages.com/packages/simplycodedsoftware-integration-messaging-cqrs)
```

###  Alternatives

[bunny/bunny

Performant pure-PHP AMQP (RabbitMQ) non-blocking ReactPHP library

7426.5M37](/packages/bunny-bunny)[friendsofsymfony/message-bundle

Provides user-to-user messaging features for your Symfony application.

356872.3k5](/packages/friendsofsymfony-message-bundle)[ecotone/symfony-bundle

Extends Ecotone with Symfony integration

11229.0k1](/packages/ecotone-symfony-bundle)[kdyby/rabbitmq

Integrates php-amqplib with RabbitMq and Nette Framework

30693.1k4](/packages/kdyby-rabbitmq)[traderinteractive/mongo-queue

Message queue using MongoDB as a backend

4617.5k](/packages/traderinteractive-mongo-queue)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
