承接 talentrydev/message-broker-bundle 相关项目开发

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

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

talentrydev/message-broker-bundle

最新稳定版本:5.1.2

Composer 安装命令:

composer require talentrydev/message-broker-bundle

包简介

Symfony bundle integrating talentrydev/message-broker library

README 文档

README

This is a Symfony bundle used for integrating talentrydev/message-broker library into a Symfony project.

Installing

  • Run:
composer require talentrydev/message-broker-bundle
  • Add the MessageBrokerBundle to your kernel's registerBundles method:
return [
    //...
    new \Talentry\MessageBrokerBundle\MessageBrokerBundle();
];

Configuring

Bundle exposes the following configuration:

OptionTypeDefault valueAvailable valuesRequiredDescription
aws_regionstringeu-central-1Any valid AWS regiononly when using sns or sqs implementationAWS region
channelsarray-See belownoUsed for configuring channels and serialization strategies
kafkaarray-See belownoUsed for configuring Kafka
namespacestring-Any stringnoUsed for prefixing SQS queue names
publisher_implementationstringsqssqs,sns,array,kafkayesSelects the message broker implementation used for publishing messages
sns_endpointstring-Any valid URLnoAllows using a custom AWS SNS implementation (eg. localstack); useful for testing
sns_topic_arnstring-Any valid AWS SNS ARNonly when using sns publisher implementationARN of the SNS topic to which messages will be published
sqs_endpointstring-Any valid URLnoAllows using a custom AWS SQS implementation (eg. localstack); useful for testing
subscriber_implementationstringsqssqs,array,kafkayesSelects the message broker implementation used for receiving messages

Channels configuration:

OptionTypeDefault valueAvailable valuesRequiredDescription
namestring-Any valid channel nameyesName of the channel
serialization_strategystring-Valid serialization strategy class nameyesFQCN of the class implementing MessageSerializationStrategy

Kafka configuration:

OptionTypeDefault valueAvailable valuesRequiredDescription
auto_offset_resetstringearliestlatest, earliest, noneonly when using kafka implementationhttps://kafka.apache.org/documentation/#consumerconfigs_auto.offset.reset
broker_liststring-Valid list of host namesonly when using kafka implementationhttps://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/rdkafka.addbrokers.html
enable_partition_eofstringtruetrue or falseonly when using kafka implementationhttps://docs.confluent.io/3.2.1/clients/librdkafka/CONFIGURATION_8md.html
enable_auto_commitstringfalsetrue or falseonly when using kafka implementationhttps://kafka.apache.org/documentation/#consumerconfigs_enable.auto.commit
loglevel | integer | 3 | Any LOG* PHP constantonly when using kafka implementationSets the log level of the Kafka PHP module
max_poll_interval_msinteger300000Any integeronly when using kafka implementationhttps://kafka.apache.org/documentation/#consumerconfigs_max.poll.interval.ms
session_timeout_msinteger45000Any integeronly when using kafka implementationhttps://kafka.apache.org/documentation/#connectconfigs_session.timeout.ms

Important considerations when using kafka implementation

  • In order to use the kafka implementation, you need to install the php-rdkafka extension: https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/index.html
  • There is no support for dead letter queues
  • Horizontal scaling of the consumers is rather limited: the number of consumers cannot exceed the number of partitions on the given topic
  • If the processing of the message takes longer than the max.poll.interval.ms, the consumer will be kicked out of the group and won't receive any more messages

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2022-11-29