gember/event-sourcing-symfony-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gember/event-sourcing-symfony-bundle

Composer 安装命令:

composer require gember/event-sourcing-symfony-bundle

包简介

Symfony Bundle for Gember Event Sourcing (gember/event-sourcing)

README 文档

README

Software License PHP Version

Gember Event Sourcing Symfony Bundle for (gember/event-sourcing).

Installation

Install the Symfony Bundle with composer:

composer require gember/event-sourcing-symfony-bundle 

This package requires Symfony ^7.1.

Configuration

This package installs Gember Event Sourcing with all required dependency adapters. Some of these adapters need to be configured.

By default, it uses the following configuration (gember_event_sourcing.yaml):

gember_event_sourcing:
    message_bus:
        symfony:
            event_bus: '@event.bus'
            command_bus: '@command.bus'
    cache:
        enabled: true
        psr6: 
          service: '@cache.app'

        # Or set a PSR-16 compatible cache layer of your choice
        # psr16: '@some.psr16.service'
    serializer:
        symfony:
            serializer: '@serializer'
    event_store:
        rdbms:
            doctrine_dbal:
                connection: '@doctrine.dbal.default_connection'
    generator:
        identity:
            # Use Gember alias of @Symfony\Component\Uid\Factory\UuidFactory:
            service: '@gember.identity_generator_symfony.uuid.symfony_uuid_identity_generator'
            
            # Or use Gember alias of @Symfony\Component\Uid\Factory\UlidFactory:
            # service: '@gember.identity_generator_symfony.ulid.symfony_ulid_identity_generator'
    registry:
        event:
            reflector:
                path: '%kernel.project_dir%/src'
        command_handler:
            reflector:
                path: '%kernel.project_dir%/src'
        saga:
            reflector:
                path: '%kernel.project_dir%/src'
    logging:
        logger: '@logger'

You can override any of these defaults however you like.

Required dependencies

Some of the required dependencies also need to be configured separately.

Symfony Messenger (symfony/messenger)

At least one message bus should be configured, with the name @event.bus.

When this bus is configured, Gember Event Sourcing works out of the box. However, when a different event bus is preferred, it must be a service implementing Symfony\Component\Messenger\MessageBusInterface.

Symfony Cache (symfony/cache)

Gember Event Sourcing makes use of @cache.app. This cache service is automatically configured when using Symfony framework including symfony/cache.

When this cache service is configured, Gember Event Sourcing works out of the box. However, when a different cache pool is preferred, it must be a service implementing Psr\Cache\CacheItemPoolInterface (PSR-6) or Psr\SimpleCache\CacheInterface (PSR-16).

Symfony Serializer (symfony/serializer)

Gember Event Sourcing makes use of @serializer. This serializer service is automatically configured when using Symfony framework including symfony/serializer.

When this serializer service is configured, Gember Event Sourcing works out of the box. However, when a different serializer is preferred, it must be a service implementing Symfony\Component\Serializer\SerializerInterface.

Doctrine DBAL/ORM (doctrine/dbal, doctrine/orm)

Gember Event Sourcing makes use of @doctrine.dbal.default_connection. This connection service is automatically configured when using Symfony framework including doctrine/dbal or doctrine/orm.

When this connection service is configured, Gember Event Sourcing works out of the box. However, when a different Doctrine connection is preferred, it must be a service implementing Doctrine\DBAL\Connection.

Database

In order to persist all domain events in database, a running SQL database is needed. The event store requires two tables. Schema is available in either raw SQL or in a migration file format:

Raw SQL schema: https://github.com/GemberPHP/rdbms-event-store-doctrine-dbal/blob/main/resources/schema.sql

Migrations:

Good to go!

Check the main package gember/event-sourcing or the demo application gember/example-event-sourcing-dcb for examples.

gember/event-sourcing-symfony-bundle 适用场景与选型建议

gember/event-sourcing-symfony-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 355 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 10 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「symfony」 「bundle」 「ddd」 「event-sourcing」 「domain-driven-design」 「gember」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 gember/event-sourcing-symfony-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 gember/event-sourcing-symfony-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 gember/event-sourcing-symfony-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 355
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 37
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-09