【问题标题】:Spring cloud stream kafka binding configuration max requestSpring Cloud Stream kafka绑定配置最大请求
【发布时间】:2020-01-01 12:20:15
【问题描述】:

我正在使用spring cloud stream kafka。

我正在尝试向 kafka 发送超过默认 1000KB 的数据。

我在 server.properties 文件中设置了message.max.bytes,如下所示:

message.max.bytes=20000000

我的 springboot 应用程序中的 application.properties 如下所示:

spring.cloud.stream.kafka.bindings.<channelName>.producer.configuration.max.request.size=20000000

这行得通。 但是,我想概括一下 spring cloud kafka 中的所有主题,以便能够将大文件发送到 channelName。如何设置属性以便能够将大文件(1000KB 以上)发送到所有频道?谢谢

【问题讨论】:

    标签: spring-boot apache-kafka spring-cloud


    【解决方案1】:

    你可以设置:

    spring.cloud.stream.default.producer.configuration.max.request.size=20000000
    

    来自 Spring Cloud Stream Kafka 参考:

    为避免重复,Spring Cloud Stream 支持为 所有频道,格式为 spring.cloud.stream.default.&lt;property&gt;=&lt;value&gt;

    Link 转文档

    【讨论】:

      【解决方案2】:

      使用我测试过的最新版本 kafka 2.5+ 并且以下工作

      spring.cloud.stream.kafka.binder.configuration.max.request.size=&lt;specify size in bytes&gt;

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-04-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多