com.posco.reuse.kafka.clients
Class PosKafkaProducer

java.lang.Object
  extended by com.posco.reuse.kafka.clients.PosKafkaProducer
All Implemented Interfaces:
InitializingBean

public class PosKafkaProducer
extends Object
implements InitializingBean

Kafka¿¡ µ¥ÀÌŸ¸¦ ¼Û½ÅÇØ ÁÖ´Â ±â´ÉÀ» Á¦°øÇϴ Ŭ·¡½º

  Bean Property
  
  - propertisMap : (Çʼö) KafkaProducer¿¡ ÇÊ¿äÇÑ property °ªÀ» Map Çü½ÄÀ¸·Î ¼³Á¤
  
  
  applicationContext.xml »ç¿ë ¿¹
  
    <bean id="kafkaSender" class="com.posco.reuse.kafka.clients.PosKafkaProducer">
      <property name="propertiesMap">
        <map>
          <entry key="bootstrap.servers" value="192.168.193.141:9092,192.168.193.142:9092" />
        </map>
      </property>
    </bean>
 
 


Field Summary
protected  org.slf4j.Logger logger
           
 
Constructor Summary
PosKafkaProducer()
           
 
Method Summary
 void afterPropertiesSet()
           
 void sendMessage(String topic, byte[] message)
           
 void sendMessage(String topic, String id, byte[] message)
           
 void setPropertiesMap(Map<String,String> propertiesMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

PosKafkaProducer

public PosKafkaProducer()
Method Detail

setPropertiesMap

public void setPropertiesMap(Map<String,String> propertiesMap)

sendMessage

public void sendMessage(String topic,
                        byte[] message)

sendMessage

public void sendMessage(String topic,
                        String id,
                        byte[] message)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception


Copyright © 2013–2016 POSCO ICT. All rights reserved.