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
registerBundlesmethod:
return [
//...
new \Talentry\MessageBrokerBundle\MessageBrokerBundle();
];
Configuring
Bundle exposes the following configuration:
| Option | Type | Default value | Available values | Required | Description |
|---|---|---|---|---|---|
| aws_region | string | eu-central-1 | Any valid AWS region | only when using sns or sqs implementation | AWS region |
| channels | array | - | See below | no | Used for configuring channels and serialization strategies |
| kafka | array | - | See below | no | Used for configuring Kafka |
| namespace | string | - | Any string | no | Used for prefixing SQS queue names |
| publisher_implementation | string | sqs | sqs,sns,array,kafka | yes | Selects the message broker implementation used for publishing messages |
| sns_endpoint | string | - | Any valid URL | no | Allows using a custom AWS SNS implementation (eg. localstack); useful for testing |
| sns_topic_arn | string | - | Any valid AWS SNS ARN | only when using sns publisher implementation | ARN of the SNS topic to which messages will be published |
| sqs_endpoint | string | - | Any valid URL | no | Allows using a custom AWS SQS implementation (eg. localstack); useful for testing |
| subscriber_implementation | string | sqs | sqs,array,kafka | yes | Selects the message broker implementation used for receiving messages |
Channels configuration:
| Option | Type | Default value | Available values | Required | Description |
|---|---|---|---|---|---|
| name | string | - | Any valid channel name | yes | Name of the channel |
| serialization_strategy | string | - | Valid serialization strategy class name | yes | FQCN of the class implementing MessageSerializationStrategy |
Kafka configuration:
| Option | Type | Default value | Available values | Required | Description |
|---|---|---|---|---|---|
| auto_offset_reset | string | earliest | latest, earliest, none | only when using kafka implementation | https://kafka.apache.org/documentation/#consumerconfigs_auto.offset.reset |
| broker_list | string | - | Valid list of host names | only when using kafka implementation | https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/rdkafka.addbrokers.html |
| enable_partition_eof | string | true | true or false | only when using kafka implementation | https://docs.confluent.io/3.2.1/clients/librdkafka/CONFIGURATION_8md.html |
| enable_auto_commit | string | false | true or false | only when using kafka implementation | https://kafka.apache.org/documentation/#consumerconfigs_enable.auto.commit |
| loglevel | integer | 3 | Any LOG* PHP constant | only when using kafka implementation | Sets the log level of the Kafka PHP module | |||
| max_poll_interval_ms | integer | 300000 | Any integer | only when using kafka implementation | https://kafka.apache.org/documentation/#consumerconfigs_max.poll.interval.ms |
| session_timeout_ms | integer | 45000 | Any integer | only when using kafka implementation | https://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
其他信息
- 授权协议: proprietary
- 更新时间: 2022-11-29