##kafka config kafka.consumer.bootstrap.servers=172.0.0.1:9092 kafka.consumer.group.id= kafka.consumer.enable.auto.commit=true kafka.consumer.auto.commit.interval.ms=5000 kafka.consumer.session.timeout.ms=10000 kafka.consumer.concurrency=6 kafka.consumer.topic=dfp kafka.consumer.zookeeper.connect=172.0.0.1:2181 kafka.consumer.zookeeper.timeout=5000 kafka.consumer.zookeeper.sync.time.ms=200 kafka.consumer.auto.offset.reset=smallest kafka.consumer.serializer.class=kafka.serializer.StringEncoder kafka.consumer.reconnect.num=3 kafka.consumer.reconnect.time=600000 kafka.corePoolSize=50 kafka.maxPoolSize=100 kafka.queueCapacity=200
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd" default-autowire="byName"> <bean id="kfkListenerImpl" class="cn.com..plugin.impl.kafka.listener.KafkaListenerImpl"/> <bean id="messageConsumer" class="cn.com..plugin.impl.kafka.listener.MessageConsumer"> <property name="messageListener" ref="kfkListenerImpl"/> <property name="executorService" ref="kfkExecutor"/> </bean> <bean id="messageListenerContainer" class="cn.com..plugin.impl.kafka.listener.MessageConsumerContainer"> <constructor-arg ref="messageConsumer" /> </bean> <bean id="kfkExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean"> <property name="corePoolSize" value="$[kafka.corePoolSize]"/> <property name="maxPoolSize" value="$[kafka.maxPoolSize]"/> <property name="queueCapacity" value="$[kafka.queueCapacity]"/> <property name="threadNamePrefix" value="pool-kafka-"/> </bean> </beans>