| 限定符和类型 | 方法和说明 |
|---|---|
MessageExt |
MQAdmin.viewMessage(String msgId)
根据消息ID,从服务器获取完整的消息
|
| 限定符和类型 | 方法和说明 |
|---|---|
PullResult |
DefaultMQPullConsumer.pull(MessageQueue mq,
String subExpression,
long offset,
int maxNums) |
PullResult |
MQPullConsumer.pull(MessageQueue mq,
String subExpression,
long offset,
int maxNums)
指定队列,主动拉取消息,即使没有消息,也立刻返回
|
PullResult |
DefaultMQPullConsumer.pullBlockIfNotFound(MessageQueue mq,
String subExpression,
long offset,
int maxNums) |
PullResult |
MQPullConsumer.pullBlockIfNotFound(MessageQueue mq,
String subExpression,
long offset,
int maxNums)
指定队列,主动拉取消息,如果没有消息,则broker阻塞一段时间再返回(时间可配置)
broker阻塞期间,如果有消息,则立刻将消息返回 |
void |
DefaultMQPullConsumer.sendMessageBack(MessageExt msg,
int delayLevel) |
void |
DefaultMQPushConsumer.sendMessageBack(MessageExt msg,
int delayLevel) |
void |
MQConsumer.sendMessageBack(MessageExt msg,
int delayLevel)
Consumer消费失败的消息可以选择重新发回到服务器端,并延时消费
会首先尝试将消息发回到消息之前存储的主机,此时只传送消息Offset,消息体不传送,不会占用网络带宽 如果发送失败,会自动重试发往其他主机,此时消息体也会传送 重传回去的消息只会被当前Consumer Group消费。 |
MessageExt |
DefaultMQPullConsumer.viewMessage(String msgId) |
MessageExt |
DefaultMQPushConsumer.viewMessage(String msgId) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
MQClientAPIImpl.consumerSendMessageBack(MessageExt msg,
String consumerGroup,
int delayLevel,
long timeoutMillis)
失败的消息发回Broker
|
void |
MQClientAPIImpl.createSubscriptionGroup(String addr,
SubscriptionGroupConfig config,
long timeoutMillis) |
void |
MQClientAPIImpl.createTopic(String addr,
String defaultTopic,
TopicConfig topicConfig,
long timeoutMillis) |
void |
MQClientAPIImpl.deleteSubscriptionGroup(String addr,
String groupName,
long timeoutMillis) |
void |
MQClientAPIImpl.deleteTopicInBroker(String addr,
String topic,
long timeoutMillis) |
void |
MQClientAPIImpl.deleteTopicInNameServer(String addr,
String topic,
long timeoutMillis) |
void |
MQClientAPIImpl.endTransactionOneway(String addr,
EndTransactionRequestHeader requestHeader,
String remark,
long timeoutMillis)
提交或者回滚事务
|
ClusterInfo |
MQClientAPIImpl.getBrokerClusterInfo(long timeoutMillis)
Name Server: 从Name Server获取集群信息
|
KVTable |
MQClientAPIImpl.getBrokerRuntimeInfo(String addr,
long timeoutMillis) |
ConsumerConnection |
MQClientAPIImpl.getConsumerConnectionList(String addr,
String consumerGroup,
long timeoutMillis)
根据ConsumerGroup获取Consumer连接列表以及订阅关系
|
List<String> |
MQClientAPIImpl.getConsumerIdListByGroup(String addr,
String consumerGroup,
long timeoutMillis)
获取某个组的Consumer Id列表
|
ConsumeStats |
MQClientAPIImpl.getConsumeStats(String addr,
String consumerGroup,
long timeoutMillis) |
long |
MQClientAPIImpl.getEarliestMsgStoretime(String addr,
String topic,
int queueId,
long timeoutMillis)
获取队列的最早时间
|
long |
MQClientAPIImpl.getMaxOffset(String addr,
String topic,
int queueId,
long timeoutMillis)
获取队列的最大Offset
|
long |
MQClientAPIImpl.getMinOffset(String addr,
String topic,
int queueId,
long timeoutMillis)
获取队列的最小Offset
|
ProducerConnection |
MQClientAPIImpl.getProducerConnectionList(String addr,
String producerGroup,
long timeoutMillis)
根据ProducerGroup获取Producer连接列表
|
TopicStatsTable |
MQClientAPIImpl.getTopicStatsInfo(String addr,
String topic,
long timeoutMillis) |
Set<MessageQueue> |
MQClientAPIImpl.lockBatchMQ(String addr,
LockBatchRequestBody requestBody,
long timeoutMillis) |
PullResult |
MQClientAPIImpl.pullMessage(String addr,
PullMessageRequestHeader requestHeader,
long timeoutMillis,
CommunicationMode communicationMode,
PullCallback pullCallback)
拉消息接口
|
long |
MQClientAPIImpl.queryConsumerOffset(String addr,
QueryConsumerOffsetRequestHeader requestHeader,
long timeoutMillis)
查询Consumer消费进度
|
void |
MQClientAPIImpl.queryMessage(String addr,
QueryMessageRequestHeader requestHeader,
long timeoutMillis,
com.alibaba.rocketmq.remoting.InvokeCallback invokeCallback)
查询消息
|
long |
MQClientAPIImpl.searchOffset(String addr,
String topic,
int queueId,
long timestamp,
long timeoutMillis)
根据时间查询Offset
|
void |
MQClientAPIImpl.sendHearbeat(String addr,
HeartbeatData heartbeatData,
long timeoutMillis)
发送心跳
|
SendResult |
MQClientAPIImpl.sendMessage(String addr,
String brokerName,
Message msg,
SendMessageRequestHeader requestHeader,
long timeoutMillis,
CommunicationMode communicationMode,
SendCallback sendCallback)
发送消息
|
void |
MQClientAPIImpl.unlockBatchMQ(String addr,
UnlockBatchRequestBody requestBody,
long timeoutMillis,
boolean oneway) |
void |
MQClientAPIImpl.unregisterClient(String addr,
String clientID,
String producerGroup,
String consumerGroup,
long timeoutMillis)
发送心跳
|
void |
MQClientAPIImpl.updateBrokerConfig(String addr,
Properties properties,
long timeoutMillis)
更新Broker的配置文件
|
void |
MQClientAPIImpl.updateConsumerOffset(String addr,
UpdateConsumerOffsetRequestHeader requestHeader,
long timeoutMillis)
更新Consumer消费进度
|
MessageExt |
MQAdminImpl.viewMessage(String msgId) |
MessageExt |
MQClientAPIImpl.viewMessage(String addr,
long phyoffset,
long timeoutMillis)
根据时间查询Offset
|
| 限定符和类型 | 方法和说明 |
|---|---|
PullResult |
DefaultMQPullConsumerImpl.pull(MessageQueue mq,
String subExpression,
long offset,
int maxNums) |
PullResult |
DefaultMQPullConsumerImpl.pullBlockIfNotFound(MessageQueue mq,
String subExpression,
long offset,
int maxNums) |
PullResult |
PullAPIWrapper.pullKernelImpl(MessageQueue mq,
String subExpression,
long subVersion,
long offset,
int maxNums,
int sysFlag,
long commitOffset,
long brokerSuspendMaxTimeMillis,
long timeoutMillis,
CommunicationMode communicationMode,
PullCallback pullCallback) |
void |
DefaultMQPullConsumerImpl.sendMessageBack(MessageExt msg,
int delayLevel) |
void |
DefaultMQPushConsumerImpl.sendMessageBack(MessageExt msg,
int delayLevel) |
MessageExt |
DefaultMQPullConsumerImpl.viewMessage(String msgId) |
MessageExt |
DefaultMQPushConsumerImpl.viewMessage(String msgId) |
| 限定符和类型 | 方法和说明 |
|---|---|
SendResult |
DefaultMQProducerImpl.send(Message msg)
DEFAULT SYNC -------------------------------------------------------
|
SendResult |
DefaultMQProducerImpl.send(Message msg,
MessageQueue mq)
KERNEL SYNC -------------------------------------------------------
|
SendResult |
DefaultMQProducerImpl.send(Message msg,
MessageQueueSelector selector,
Object arg)
SELECT SYNC -------------------------------------------------------
|
MessageExt |
DefaultMQProducerImpl.viewMessage(String msgId) |
| 限定符和类型 | 方法和说明 |
|---|---|
SendResult |
DefaultMQProducer.send(Message msg) |
SendResult |
MQProducer.send(Message msg)
发送消息,同步调用
|
SendResult |
DefaultMQProducer.send(Message msg,
MessageQueue mq) |
SendResult |
MQProducer.send(Message msg,
MessageQueue mq)
向指定队列发送消息,同步调用
|
SendResult |
DefaultMQProducer.send(Message msg,
MessageQueueSelector selector,
Object arg) |
SendResult |
MQProducer.send(Message msg,
MessageQueueSelector selector,
Object arg)
发送消息,可以自定义选择队列,队列的总数可能会由于Broker的启停变化
如果要保证消息严格有序,在向运维人员申请Topic时,需要特别说明 同步调用 |
MessageExt |
DefaultMQProducer.viewMessage(String msgId) |
Copyright © 2012–2013. All rights reserved.