Spring integration Spring集成Kafka XML参数错误
kafka和zookeeper工作得很好,因为我尝试了JAVA的基本方法来生成或使用消息,所以这里的问题是,我正在考虑在我的项目中使用Spring integration kafka,XML文件如下:Spring integration Spring集成Kafka XML参数错误,spring-integration,Spring Integration,kafka和zookeeper工作得很好,因为我尝试了JAVA的基本方法来生成或使用消息,所以这里的问题是,我正在考虑在我的项目中使用Spring integration kafka,XML文件如下: <int:channel id="inputToKafka"> <int:queue/> </int:channel> <int-kafka:outbound-channel-adapter id="kafkaOutboundChannelAdap
<int:channel id="inputToKafka">
<int:queue/>
</int:channel>
<int-kafka:outbound-channel-adapter id="kafkaOutboundChannelAdapter"
kafka-producer-context-ref="kafkaProducerContext"
auto-startup="false"
channel="inputToKafka"
order="3"
>
<int:poller fixed-delay="1000" time-unit="MILLISECONDS" receive-timeout="0" task-executor="taskExecutor"/>
</int-kafka:outbound-channel-adapter>
<task:executor id="taskExecutor" pool-size="5" keep-alive="120" queue-capacity="500"/>
<bean id="producerProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="topic.metadata.refresh.interval.ms">3600000</prop>
<prop key="message.send.max.retries">5</prop>
<prop key="serializer.class">kafka.serializer.StringEncoder</prop>
<prop key="request.required.acks">1</prop>
</props>
</property>
</bean>
<int-kafka:producer-context id="kafkaProducerContext"
producer-properties="producerProperties">
<int-kafka:producer-configurations>
<int-kafka:producer-configuration broker-list="127.0.0.1:9092"
topic="test"
compression-codec="default"/>
</int-kafka:producer-configurations>
</int-kafka:producer-context>
因此,任何知道如何设置值以避免这种情况的人?该属性称为压缩类型:
<xsd:attribute name="compression-type" use="optional" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Indicates the type of compression codec used for message compression.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
已在1.1
和1.2
Spring Integration Kafka版本之间重命名
<xsd:attribute name="compression-type" use="optional" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Indicates the type of compression codec used for message compression.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>