kafka-beans.xml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  4. xmlns:mvc="http://www.springframework.org/schema/mvc"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
  7. http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
  8. <context:component-scan base-package="com.palmnest.model.kafka"></context:component-scan>
  9. <bean id="kafkaProducerServer" class="com.palmnest.model.kafka.KafkaProducerServer">
  10. <property name="properties">
  11. <props>
  12. <prop key="topic">buildwindow</prop>
  13. <prop key="bootstrap.servers">172.25.220.213:9092</prop>
  14. <prop key="acks">all</prop>
  15. <prop key="key.serializer">org.apache.kafka.common.serialization.StringSerializer
  16. </prop>
  17. <prop key="value.serializer">org.apache.kafka.common.serialization.StringSerializer
  18. </prop>
  19. <prop key="buffer.memory">33554432</prop>
  20. </props>
  21. </property>
  22. </bean>
  23. <bean id="kafkaConsumerServer" class="com.palmnest.model.kafka.KafkaConsumerServer">
  24. <property name="props">
  25. <props>
  26. <prop key="topic">buildwindow</prop>
  27. <prop key="bootstrap.servers">172.25.220.213:9092</prop>
  28. <prop key="group.id">group1</prop>
  29. <prop key="enable.auto.commit">true</prop>
  30. <prop key="auto.commit.interval.ms">1000</prop>
  31. <prop key="session.timeout.ms">30000</prop>
  32. <prop key="key.deserializer">org.apache.kafka.common.serialization.StringDeserializer
  33. </prop>
  34. <prop key="value.deserializer">org.apache.kafka.common.serialization.StringDeserializer
  35. </prop>
  36. </props>
  37. </property>
  38. </bean>
  39. </beans>