承接 valantic-spryker-eco/sqs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

valantic-spryker-eco/sqs

最新稳定版本:1.0.0

Composer 安装命令:

composer require valantic-spryker-eco/sqs

包简介

SQS implementation as an adapter for spryker/queue

README 文档

README

SQS implementation as an adapter for spryker/queue

Install package

composer req valantic-spryker-eco/sqs

Update shared config

config/Shared/config_default.php

$config[KernelConstants::CORE_NAMESPACES] = [
    ...
    'ValanticSpryker',
];

Update your shared config for SQS (sample for ElasticMQ)

$config[SqsConstants::SQS_BASE_URL] = 'http://elasticmq:9324';
$config[SqsConstants::SQS_QUEUE_PATH_PREFIX] = 'queue/';

Update your QueueConfig

\Pyz\Zed\Queue\QueueConfig

...

/**
 * @var string
 */
public const AWS_SQS = 'aws-sqs';

...

/**
 * @return array
 */
protected function getMessageCheckOptions(): array
{
    return [
        QueueConstants::QUEUE_WORKER_MESSAGE_CHECK_OPTION => [
        ...
        static::AWS_SQS => $this->getAwsSqsQueueMessageCheckOptions(),
    ];
}

...

/**
 * @return \Generated\Shared\Transfer\AwsSqsConsumerOptionTransfer
 */
protected function getAwsSqsQueueMessageCheckOptions(): AwsSqsConsumerOptionTransfer
{
    $queueOptionTransfer = new AwsSqsConsumerOptionTransfer();
    $queueOptionTransfer->setCheckMessageCount(true);

    return $queueOptionTransfer;
}

...

Update your ConsoleDependencyProvider

\Pyz\Zed\Console\ConsoleDependencyProvider

/**
 * @param \Spryker\Zed\Kernel\Container $container
 * 
 * @return \Symfony\Component\Console\Command\Command[]
 */
protected function getConsoleCommands(Container $container): array
{
    $commands = [
        ...
        new SqsCreateQueuesConsole(),
        new SqsPurgeAllQueuesConsole(),
        new SqsRemoveQueuesConsole(),
    ];

In many cases when you operate SQS next to RabbitMq, it will make sense to also extend the Queue module to separate RabbitMq workers from SQS workers. To achieve this you should extend QueueDependencyProvider and QueueBusinessFactory to create Task and Worker for RabbitMq and SQS independently.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2023-08-01