com.posco.reuse.kafka.activity
Class SFMessageSend

java.lang.Object
  extended by com.poscoict.glueframework.biz.activity.GlueActivity<GlueContext>
      extended by com.posco.reuse.kafka.activity.SFMessageSend

public class SFMessageSend
extends GlueActivity<GlueContext>

byte[] 데이타를 Kafka에 송신하는 기능을 수행한다.

 Activity Property
 - sender-id : (필수) applicationContext.xml에 등록되어 있는 PosKafkaProducer bean id.
 - message-key : (필수) GlueContext에 등록되어 있는 byte[] 객체의 Key 
 - topic-key : (선택) Kafka의 topic 값이 등록되어 있는 GlueContext 의 Key
 - topic : (선택) Kafka의 topic값
 
 예제
 사용 예# 1
 - Kafka의 GLUE_TEST04라는 topic으로 데이타를 송신하는 경우
 - applicationContext.xml에 등록되어 있는 PosKafkaProducer bean id 는 kafkaSender이고
   Kafka에 전송할 데이터는 sfmessage를 Key로 GlueContext에 등록되어 있는 경우
   
    <activity name="sendMessage" class="com.posco.reuse.kafka.activity.SFMessageSend">
      <transition name="success" value="end"/>
        <property name="sender-id" value="kafkaSender"/>
        <property name="topic" value="GLUE_TEST04"/>
        <property name="message-key" value="sfmessage"/>
    </activity>
 
 사용 예# 2
  - Kafka의 topic 값이 GlueContext에 topic을 Key로 등록되어 있는 경우
   
    <activity name="sendMessage" class="com.posco.reuse.kafka.activity.SFMessageSend">
      <transition name="success" value="end"/>
        <property name="sender-id" value="kafkaSender"/>
        <property name="topic-key" value="topic"/>
        <property name="message-key" value="sfmessage"/>
    </activity>
 
 참고 : applicationContext.xml
 
    <bean id="kafkaSender" class="com.posco.reuse.kafka.clients.PosKafkaProducer">
      <property name="propertisMap">
        <map>
          <entry key="bootstrap.servers" value="192.168.193.141:9092,192.168.193.142:9092" />
        </map>
      </property>
    </bean>
 


Field Summary
 
Fields inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
dynamicProperties, logger
 
Constructor Summary
SFMessageSend()
           
 
Method Summary
 String runActivity(GlueContext ctx)
           
 
Methods inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
commitTransaction, commitTransaction, getDao, getEventList, getName, getProperty, getPropertyNames, getTransition, rollbackTransaction, rollbackTransaction, setEventList, setName, setProperty, setTransition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SFMessageSend

public SFMessageSend()
Method Detail

runActivity

public String runActivity(GlueContext ctx)
Specified by:
runActivity in class GlueActivity<GlueContext>


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