|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface MQProducer
消息生产者
| 方法摘要 | |
|---|---|
List<MessageQueue> |
fetchPublishMessageQueues(String topic)
根据topic获取对应的MessageQueue,如果是顺序消息,则按照顺序消息配置返回 |
SendResult |
send(Message msg)
发送消息,同步调用 |
SendResult |
send(Message msg,
long timeout)
|
SendResult |
send(Message msg,
MessageQueue mq)
向指定队列发送消息,同步调用 |
SendResult |
send(Message msg,
MessageQueue mq,
long timeout)
|
SendResult |
send(Message msg,
MessageQueueSelector selector,
Object arg)
发送消息,可以自定义选择队列,队列的总数可能会由于Broker的启停变化 如果要保证消息严格有序,在向运维人员申请Topic时,需要特别说明 同步调用 |
SendResult |
send(Message msg,
MessageQueueSelector selector,
Object arg,
long timeout)
|
void |
send(Message msg,
MessageQueueSelector selector,
Object arg,
SendCallback sendCallback)
发送消息,可以自定义选择队列,队列的总数可能会由于Broker的启停变化 如果要保证消息严格有序,在向运维人员申请Topic时,需要特别说明 异步调用 |
void |
send(Message msg,
MessageQueueSelector selector,
Object arg,
SendCallback sendCallback,
long timeout)
|
void |
send(Message msg,
MessageQueue mq,
SendCallback sendCallback)
向指定队列发送消息,异步调用 |
void |
send(Message msg,
MessageQueue mq,
SendCallback sendCallback,
long timeout)
|
void |
send(Message msg,
SendCallback sendCallback)
发送消息,异步调用 |
void |
send(Message msg,
SendCallback sendCallback,
long timeout)
|
TransactionSendResult |
sendMessageInTransaction(Message msg,
LocalTransactionExecuter tranExecuter,
Object arg)
|
void |
sendOneway(Message msg)
发送消息,Oneway形式,服务器不应答,无法保证消息是否成功到达服务器 |
void |
sendOneway(Message msg,
MessageQueue mq)
向指定队列发送消息,Oneway形式,服务器不应答,无法保证消息是否成功到达服务器 |
void |
sendOneway(Message msg,
MessageQueueSelector selector,
Object arg)
发送消息,可以自定义选择队列,队列的总数可能会由于Broker的启停变化 如果要保证消息严格有序,在向运维人员申请Topic时,需要特别说明 Oneway形式,服务器不应答,无法保证消息是否成功到达服务器 |
void |
shutdown()
关闭服务,一旦关闭,此对象将不可用 |
void |
start()
启动服务 |
| 从接口 com.alibaba.rocketmq.client.MQAdmin 继承的方法 |
|---|
createTopic, createTopic, earliestMsgStoreTime, maxOffset, minOffset, queryMessage, searchOffset, viewMessage |
| 方法详细信息 |
|---|
void start()
throws MQClientException
MQClientExceptionvoid shutdown()
List<MessageQueue> fetchPublishMessageQueues(String topic)
throws MQClientException
topic - 消息Topic
MQClientException
SendResult send(Message msg)
throws MQClientException,
RemotingException,
MQBrokerException,
InterruptedException
msg - 消息
InterruptedException
MQBrokerException
RemotingException
MQClientException
SendResult send(Message msg,
long timeout)
throws MQClientException,
RemotingException,
MQBrokerException,
InterruptedException
MQClientException
RemotingException
MQBrokerException
InterruptedException
void send(Message msg,
SendCallback sendCallback)
throws MQClientException,
RemotingException,
InterruptedException
msg - 消息sendCallback - 发送结果通过此接口回调
MQClientException
RemotingException
InterruptedException
void send(Message msg,
SendCallback sendCallback,
long timeout)
throws MQClientException,
RemotingException,
InterruptedException
MQClientException
RemotingException
InterruptedException
void sendOneway(Message msg)
throws MQClientException,
RemotingException,
InterruptedException
msg - 消息
MQClientException
RemotingException
InterruptedException
SendResult send(Message msg,
MessageQueue mq)
throws MQClientException,
RemotingException,
MQBrokerException,
InterruptedException
msg - 消息mq - 队列
InterruptedException
MQBrokerException
RemotingException
MQClientException
SendResult send(Message msg,
MessageQueue mq,
long timeout)
throws MQClientException,
RemotingException,
MQBrokerException,
InterruptedException
MQClientException
RemotingException
MQBrokerException
InterruptedException
void send(Message msg,
MessageQueue mq,
SendCallback sendCallback)
throws MQClientException,
RemotingException,
InterruptedException
msg - 消息mq - 队列sendCallback - 发送结果通过此接口回调
InterruptedException
RemotingException
MQClientException
void send(Message msg,
MessageQueue mq,
SendCallback sendCallback,
long timeout)
throws MQClientException,
RemotingException,
InterruptedException
MQClientException
RemotingException
InterruptedException
void sendOneway(Message msg,
MessageQueue mq)
throws MQClientException,
RemotingException,
InterruptedException
msg - 消息mq - 队列
MQClientException
RemotingException
InterruptedException
SendResult send(Message msg,
MessageQueueSelector selector,
Object arg)
throws MQClientException,
RemotingException,
MQBrokerException,
InterruptedException
msg - 消息selector - 队列选择器,发送时会回调arg - 回调队列选择器时,此参数会传入队列选择方法
InterruptedException
MQBrokerException
RemotingException
MQClientException
SendResult send(Message msg,
MessageQueueSelector selector,
Object arg,
long timeout)
throws MQClientException,
RemotingException,
MQBrokerException,
InterruptedException
MQClientException
RemotingException
MQBrokerException
InterruptedException
void send(Message msg,
MessageQueueSelector selector,
Object arg,
SendCallback sendCallback)
throws MQClientException,
RemotingException,
InterruptedException
msg - 消息selector - 队列选择器,发送时会回调arg - 回调队列选择器时,此参数会传入队列选择方法sendCallback - 发送结果通过此接口回调
MQClientException
RemotingException
InterruptedException
void send(Message msg,
MessageQueueSelector selector,
Object arg,
SendCallback sendCallback,
long timeout)
throws MQClientException,
RemotingException,
InterruptedException
MQClientException
RemotingException
InterruptedException
void sendOneway(Message msg,
MessageQueueSelector selector,
Object arg)
throws MQClientException,
RemotingException,
InterruptedException
msg - 消息selector - 队列选择器,发送时会回调arg - 回调队列选择器时,此参数会传入队列选择方法
MQClientException
RemotingException
InterruptedException
TransactionSendResult sendMessageInTransaction(Message msg,
LocalTransactionExecuter tranExecuter,
Object arg)
throws MQClientException
MQClientException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||