类 KafkaMQProducer
java.lang.Object
com.sh.wf.mq.kafka.KafkaMQBase
com.sh.wf.mq.kafka.KafkaMQProducer
Description: kafka消息生产者
Title:首亨软件 - 聚天平台
-
嵌套类概要
嵌套类 -
字段概要
从类继承的字段 com.sh.wf.mq.kafka.KafkaMQBase
AUTH, AUTH_IGNORE, DEFAULT_GROUP_ID, DEFAULT_TOPIC, topic -
方法概要
修饰符和类型方法说明voidclose()connect(Properties prop) static KafkaMQProducergetInstance(String topic) booleansendMessage(String msg) 发送消息booleansendMessage(Properties prop, String msg) 发送消息booleanbooleansendMessageSecurity(Properties prop, String msg) 安全的发送消息,连接将会自动关闭从类继承的方法 com.sh.wf.mq.kafka.KafkaMQBase
checkPropBase, getBootstrapServers, setPropValue
-
方法详细资料
-
getInstance
-
connect
-
sendMessage
发送消息- 参数:
msg- String- 返回:
- boolean
-
sendMessage
发送消息- 参数:
msg- String- 返回:
- boolean
-
sendMessageSecurity
-
sendMessageSecurity
安全的发送消息,连接将会自动关闭- 参数:
prop-msg-- 返回:
-
close
public void close()
-