Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
转角邂逅
Rocketmq
提交
de628a44
R
Rocketmq
项目概览
转角邂逅
/
Rocketmq
与 Fork 源项目一致
Fork自
Apache RocketMQ / Rocketmq
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rocketmq
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
de628a44
编写于
1月 11, 2017
作者:
Z
Zhanhui Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add javadoc to DefaultMQProducer
上级
7fcf2f1d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
158 addition
and
0 deletion
+158
-0
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java
...rg/apache/rocketmq/client/producer/DefaultMQProducer.java
+158
-0
未找到文件。
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java
浏览文件 @
de628a44
...
...
@@ -321,94 +321,252 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
this
.
defaultMQProducerImpl
.
send
(
msg
,
mq
,
sendCallback
);
}
/**
* Same to {@link #send(Message, SendCallback)} with target message queue and send timeout specified.
* @param msg Message to send.
* @param mq Target message queue.
* @param sendCallback Callback to execute on sending completed, either successful or unsuccessful.
* @param timeout Send timeout.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
void
send
(
Message
msg
,
MessageQueue
mq
,
SendCallback
sendCallback
,
long
timeout
)
throws
MQClientException
,
RemotingException
,
InterruptedException
{
this
.
defaultMQProducerImpl
.
send
(
msg
,
mq
,
sendCallback
,
timeout
);
}
/**
* Same to {@link #sendOneway(Message)} with target message queue specified.
* @param msg Message to send.
* @param mq Target message queue.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
void
sendOneway
(
Message
msg
,
MessageQueue
mq
)
throws
MQClientException
,
RemotingException
,
InterruptedException
{
this
.
defaultMQProducerImpl
.
sendOneway
(
msg
,
mq
);
}
/**
* Same to {@link #send(Message)} with message queue selector specified.
*
* @param msg Message to send.
* @param selector Message queue selector, through which we get target message queue to deliver message to.
* @param arg Argument to work along with message queue selector.
* @return {@link SendResult} instance to inform senders details of the deliverable, say Message ID of the message,
* {@link SendStatus} indicating broker storage/replication status, message queue sent to, etc.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws MQBrokerException if there is any error with broker.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
SendResult
send
(
Message
msg
,
MessageQueueSelector
selector
,
Object
arg
)
throws
MQClientException
,
RemotingException
,
MQBrokerException
,
InterruptedException
{
return
this
.
defaultMQProducerImpl
.
send
(
msg
,
selector
,
arg
);
}
/**
* Same to {@link #send(Message, MessageQueueSelector, Object)} with send timeout specified.
*
* @param msg Message to send.
* @param selector Message queue selector, through which we get target message queue to deliver message to.
* @param arg Argument to work along with message queue selector.
* @param timeout Send timeout.
* @return {@link SendResult} instance to inform senders details of the deliverable, say Message ID of the message,
* {@link SendStatus} indicating broker storage/replication status, message queue sent to, etc.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws MQBrokerException if there is any error with broker.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
SendResult
send
(
Message
msg
,
MessageQueueSelector
selector
,
Object
arg
,
long
timeout
)
throws
MQClientException
,
RemotingException
,
MQBrokerException
,
InterruptedException
{
return
this
.
defaultMQProducerImpl
.
send
(
msg
,
selector
,
arg
,
timeout
);
}
/**
* Same to {@link #send(Message, SendCallback)} with message queue selector specified.
*
* @param msg Message to send.
* @param selector Message selector through which to get target message queue.
* @param arg Argument used along with message queue selector.
* @param sendCallback callback to execute on sending completion.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
void
send
(
Message
msg
,
MessageQueueSelector
selector
,
Object
arg
,
SendCallback
sendCallback
)
throws
MQClientException
,
RemotingException
,
InterruptedException
{
this
.
defaultMQProducerImpl
.
send
(
msg
,
selector
,
arg
,
sendCallback
);
}
/**
* Same to {@link #send(Message, MessageQueueSelector, Object, SendCallback)} with timeout specified.
*
* @param msg Message to send.
* @param selector Message selector through which to get target message queue.
* @param arg Argument used along with message queue selector.
* @param sendCallback callback to execute on sending completion.
* @param timeout Send timeout.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
void
send
(
Message
msg
,
MessageQueueSelector
selector
,
Object
arg
,
SendCallback
sendCallback
,
long
timeout
)
throws
MQClientException
,
RemotingException
,
InterruptedException
{
this
.
defaultMQProducerImpl
.
send
(
msg
,
selector
,
arg
,
sendCallback
,
timeout
);
}
/**
* Same to {@link #sendOneway(Message)} with message queue selector specified.
* @param msg Message to send.
* @param selector Message queue selector, through which to determine target message queue to deliver message
* @param arg Argument used along with message queue selector.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
void
sendOneway
(
Message
msg
,
MessageQueueSelector
selector
,
Object
arg
)
throws
MQClientException
,
RemotingException
,
InterruptedException
{
this
.
defaultMQProducerImpl
.
sendOneway
(
msg
,
selector
,
arg
);
}
/**
* This method is to send transactional messages.
*
* @param msg Transactional message to send.
* @param tranExecuter local transaction executor.
* @param arg Argument used along with local transaction executor.
* @return Transaction result.
* @throws MQClientException if there is any client error.
*/
@Override
public
TransactionSendResult
sendMessageInTransaction
(
Message
msg
,
LocalTransactionExecuter
tranExecuter
,
final
Object
arg
)
throws
MQClientException
{
throw
new
RuntimeException
(
"sendMessageInTransaction not implement, please use TransactionMQProducer class"
);
}
/**
* Create a topic on broker.
* @param key accesskey
* @param newTopic topic name
* @param queueNum topic's queue number
* @throws MQClientException if there is any client error.
*/
@Override
public
void
createTopic
(
String
key
,
String
newTopic
,
int
queueNum
)
throws
MQClientException
{
createTopic
(
key
,
newTopic
,
queueNum
,
0
);
}
/**
* Create a topic on broker.
* @param key accesskey
* @param newTopic topic name
* @param queueNum topic's queue number
* @param topicSysFlag topic system flag
* @throws MQClientException if there is any client error.
*/
@Override
public
void
createTopic
(
String
key
,
String
newTopic
,
int
queueNum
,
int
topicSysFlag
)
throws
MQClientException
{
this
.
defaultMQProducerImpl
.
createTopic
(
key
,
newTopic
,
queueNum
,
topicSysFlag
);
}
/**
* Search consume queue offset of the given time stamp.
* @param mq Instance of MessageQueue
* @param timestamp from when in milliseconds.
* @return Consume queue offset.
* @throws MQClientException if there is any client error.
*/
@Override
public
long
searchOffset
(
MessageQueue
mq
,
long
timestamp
)
throws
MQClientException
{
return
this
.
defaultMQProducerImpl
.
searchOffset
(
mq
,
timestamp
);
}
/**
* Query maximum offset of the given message queue.
*
* @param mq Instance of MessageQueue
* @return maximum offset of the given consume queue.
* @throws MQClientException if there is any client error.
*/
@Override
public
long
maxOffset
(
MessageQueue
mq
)
throws
MQClientException
{
return
this
.
defaultMQProducerImpl
.
maxOffset
(
mq
);
}
/**
* Query minimum offset of the given message queue.
* @param mq Instance of MessageQueue
* @return minimum offset of the given message queue.
* @throws MQClientException if there is any client error.
*/
@Override
public
long
minOffset
(
MessageQueue
mq
)
throws
MQClientException
{
return
this
.
defaultMQProducerImpl
.
minOffset
(
mq
);
}
/**
* Query earliest message store time.
* @param mq Instance of MessageQueue
* @return earliest message store time.
* @throws MQClientException if there is any client error.
*/
@Override
public
long
earliestMsgStoreTime
(
MessageQueue
mq
)
throws
MQClientException
{
return
this
.
defaultMQProducerImpl
.
earliestMsgStoreTime
(
mq
);
}
/**
* Query message of the given offset message ID.
* @param offsetMsgId message id
* @return Message specified.
* @throws MQBrokerException if there is any broker error.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
MessageExt
viewMessage
(
String
offsetMsgId
)
throws
RemotingException
,
MQBrokerException
,
InterruptedException
,
MQClientException
{
return
this
.
defaultMQProducerImpl
.
viewMessage
(
offsetMsgId
);
}
/**
* Query message by key.
* @param topic message topic
* @param key message key index word
* @param maxNum max message number
* @param begin from when
* @param end to when
* @return QueryResult instance contains matched messages.
* @throws MQClientException if there is any client error.
* @throws InterruptedException if the thread is interrupted.
*/
@Override
public
QueryResult
queryMessage
(
String
topic
,
String
key
,
int
maxNum
,
long
begin
,
long
end
)
throws
MQClientException
,
InterruptedException
{
return
this
.
defaultMQProducerImpl
.
queryMessage
(
topic
,
key
,
maxNum
,
begin
,
end
);
}
/**
* Query message of the given message ID.
*
* @param topic Topic
* @param msgId Message ID
* @return Message specified.
* @throws MQBrokerException if there is any broker error.
* @throws MQClientException if there is any client error.
* @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted.
*/
@Override
public
MessageExt
viewMessage
(
String
topic
,
String
msgId
)
throws
RemotingException
,
MQBrokerException
,
InterruptedException
,
MQClientException
{
try
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录