public abstract class DefaultProducerProxy extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected RocketProperties |
configuration |
protected org.slf4j.Logger |
logger |
protected com.aliyun.openservices.ons.api.Producer |
producer |
| 构造器和说明 |
|---|
DefaultProducerProxy() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getTopic()
默认使用基础配置文件中的 topic
|
protected OnsConfiguration |
onsConfiguration()
获取 producer 上面注册的ons配置注解
|
com.aliyun.openservices.ons.api.SendResult |
sendMsg(com.aliyun.openservices.ons.api.Message message)
发送 消息
|
<T> com.aliyun.openservices.ons.api.SendResult |
sendMsg(T msg,
String tag) |
<T> com.aliyun.openservices.ons.api.SendResult |
sendMsg(T msg,
String tag,
String key)
发送主题消息
|
<T> com.aliyun.openservices.ons.api.SendResult |
sendMsg(T msg,
String tag,
String key,
String topic)
发送消息 重载
|
void |
setup()
初始化 producer
|
protected byte[] |
toByte(Object o)
json序列化成字节码
|
@Autowired protected RocketProperties configuration
protected com.aliyun.openservices.ons.api.Producer producer
protected org.slf4j.Logger logger
@PostConstruct public void setup()
public <T> com.aliyun.openservices.ons.api.SendResult sendMsg(T msg,
String tag)
public <T> com.aliyun.openservices.ons.api.SendResult sendMsg(T msg,
String tag,
String key)
T - msg - tag - public <T> com.aliyun.openservices.ons.api.SendResult sendMsg(T msg,
String tag,
String key,
String topic)
T - msg - topic - tag - key - public com.aliyun.openservices.ons.api.SendResult sendMsg(com.aliyun.openservices.ons.api.Message message)
message - public String getTopic()
protected byte[] toByte(Object o)
o - protected OnsConfiguration onsConfiguration()
Copyright © 2020 WUHAN trayvon. All rights reserved.