codecamp

SpringCloud Kafka生产者Properties

以下属性仅适用于Kafka生产者,并且必须以spring.cloud.stream.kafka.bindings.<channelName>.producer.为前缀。

管理员配置

预置新主题时使用的Kafka主题属性中的Map(例如,spring.cloud.stream.kafka.bindings.input.consumer.admin.configuration.message.format.version=0.9.0.0

默认值:无。

管理员副本分配

副本分配的Map <Integer,List <Integer >>,键为分区,值为分配。在配置新主题时使用。请参见kafka-clients jar中的NewTopic javadocs。

默认值:无。

管理员复制因子

设置新主题时要使用的复制因子。覆盖活页夹范围的设置。如果存在replicas-assignments,则忽略。

默认值:无(使用资料夹范围的默认值1)。

缓冲区大小

Kafka生产者在发送之前尝试分批处理的数据量的上限(以字节为单位)。

默认值:16384

同步

生产者是否同步。

默认值:false

batchTimeout

生产者在发送消息之前等待允许更多消息在同一批中累积的时间。(通常,生产者根本不等待,仅发送在上一次发送过程中累积的所有消息。)非零值可能会增加吞吐量,但会增加延迟。

默认值:0

messageKeyExpression

根据用于填充产生的Kafka消息的密钥的传出消息(例如,headers['myKey'])评估的SpEL表达式。有效负载无法使用,因为在评估此表达式时,有效负载已经采用byte[]的形式。

默认值:none

headerPatterns

以逗号分隔的简单模式列表,以匹配要映射到ProducerRecord中的Kafka Headers的Spring消息头。模式可以以通配符(星号)开头或结尾。可以使用前缀!来否定模式。 比赛在第一个比赛(正数或负数)之后停止。例如,!ask,as*将传递ash,但不会传递askidtimestamp从未映射。

默认值:*(所有标头-idtimestamp除外)

组态

使用包含通用Kafka生产者属性的键/值对进行映射。

默认值:空地图。

Kafka活页夹使用生产者的partitionCount设置作为提示来创建具有给定分区数的主题(与minPartitionCount结合使用,两者中的最大值是所使用的值)。同时为活页夹配置minPartitionCount和为应用程序配置partitionCount时要小心,因为使用了较大的值。如果已经存在一个分区数较小的主题,并且禁用了autoAddPartitions(默认设置),则绑定器无法启动。如果已经存在一个分区数较小的主题,并且启用了autoAddPartitions,则会添加新的分区。如果已经存在的主题的分区数量大于最大数量(minPartitionCountpartitionCount),则使用现有分区计数。


SpringCloud Kafka消费者Properties
SpringCloud 用法示例
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

三、Spring Cloud Netflix

SpringCloud Hystrix超时和Ribbon客户

SpringCloud 重试失败的请求

五、Spring Cloud Stream

六、SpringCloud Binder实现

SpringCloud 重试RabbitMQ Binder

SpringCloud Dead-Letter队列处理

八、Spring Cloud Sleuth

SpringCloud 当前Span

十二、Spring Cloud for Cloud Foundry

十三、Spring Cloud Contract

Spring Cloud Contract验证程序设置

SrpingCloud Gradle项目

十五、Spring Cloud网关

Spring Cloud 配置路由谓词工厂和网关过滤工厂

Spring Cloud TLS / SSL

Spring Cloud网关配置

SpringCloud 故障排除

十八、Spring Cloud GCP

Spring Cloud GCP Spring资源

Spring Cloud Spring JDBC

Spring Cloud Redis的Cloud Memorystore

Spring Cloud 云身份识别代理(IAP)身份验证

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }