public class DefaultMQProducerImpl extends java.lang.Object implements MQProducerInner
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.ExecutorService |
checkExecutor |
protected java.util.concurrent.BlockingQueue<java.lang.Runnable> |
checkRequestQueue |
Constructor and Description |
---|
DefaultMQProducerImpl(DefaultMQProducer defaultMQProducer) |
DefaultMQProducerImpl(DefaultMQProducer defaultMQProducer,
RPCHook rpcHook) |
Modifier and Type | Method and Description |
---|---|
TransactionCheckListener |
checkListener() |
void |
checkTransactionState(java.lang.String addr,
MessageExt msg,
CheckTransactionStateRequestHeader header) |
void |
createTopic(java.lang.String key,
java.lang.String newTopic,
int queueNum) |
void |
createTopic(java.lang.String key,
java.lang.String newTopic,
int queueNum,
int topicSysFlag) |
void |
destroyTransactionEnv() |
long |
earliestMsgStoreTime(MessageQueue mq) |
void |
endTransaction(SendResult sendResult,
LocalTransactionState localTransactionState,
java.lang.Throwable localException) |
void |
executeCheckForbiddenHook(CheckForbiddenContext context) |
void |
executeSendMessageHookAfter(SendMessageContext context) |
void |
executeSendMessageHookBefore(SendMessageContext context) |
java.util.List<MessageQueue> |
fetchPublishMessageQueues(java.lang.String topic) |
long[] |
getLatencyMax() |
MQClientInstance |
getmQClientFactory() |
long[] |
getNotAvailableDuration() |
java.util.Set<java.lang.String> |
getPublishTopicList() |
ServiceState |
getServiceState() |
java.util.concurrent.ConcurrentMap<java.lang.String,TopicPublishInfo> |
getTopicPublishInfoTable() |
int |
getZipCompressLevel() |
boolean |
hasCheckForbiddenHook() |
boolean |
hasSendMessageHook() |
void |
initTransactionEnv() |
boolean |
isPublishTopicNeedUpdate(java.lang.String topic) |
boolean |
isSendLatencyFaultEnable() |
boolean |
isUnitMode() |
long |
maxOffset(MessageQueue mq) |
long |
minOffset(MessageQueue mq) |
QueryResult |
queryMessage(java.lang.String topic,
java.lang.String key,
int maxNum,
long begin,
long end) |
MessageExt |
queryMessageByUniqKey(java.lang.String topic,
java.lang.String uniqKey) |
void |
registerCheckForbiddenHook(CheckForbiddenHook checkForbiddenHook) |
void |
registerSendMessageHook(SendMessageHook hook) |
long |
searchOffset(MessageQueue mq,
long timestamp) |
MessageQueue |
selectOneMessageQueue(TopicPublishInfo tpInfo,
java.lang.String lastBrokerName) |
SendResult |
send(Message msg)
DEFAULT SYNC -------------------------------------------------------
|
SendResult |
send(Message msg,
long timeout) |
SendResult |
send(Message msg,
MessageQueue mq)
KERNEL SYNC -------------------------------------------------------
|
SendResult |
send(Message msg,
MessageQueue mq,
long timeout) |
SendResult |
send(Message msg,
MessageQueueSelector selector,
java.lang.Object arg)
SELECT SYNC -------------------------------------------------------
|
SendResult |
send(Message msg,
MessageQueueSelector selector,
java.lang.Object arg,
long timeout) |
void |
send(Message msg,
MessageQueueSelector selector,
java.lang.Object arg,
SendCallback sendCallback)
SELECT ASYNC -------------------------------------------------------
|
void |
send(Message msg,
MessageQueueSelector selector,
java.lang.Object arg,
SendCallback sendCallback,
long timeout) |
void |
send(Message msg,
MessageQueue mq,
SendCallback sendCallback)
KERNEL ASYNC -------------------------------------------------------
|
void |
send(Message msg,
MessageQueue mq,
SendCallback sendCallback,
long timeout) |
void |
send(Message msg,
SendCallback sendCallback)
DEFAULT ASYNC -------------------------------------------------------
|
void |
send(Message msg,
SendCallback sendCallback,
long timeout) |
TransactionSendResult |
sendMessageInTransaction(Message msg,
LocalTransactionExecuter tranExecuter,
java.lang.Object arg) |
void |
sendOneway(Message msg)
DEFAULT ONEWAY -------------------------------------------------------
|
void |
sendOneway(Message msg,
MessageQueue mq)
KERNEL ONEWAY -------------------------------------------------------
|
void |
sendOneway(Message msg,
MessageQueueSelector selector,
java.lang.Object arg)
SELECT ONEWAY -------------------------------------------------------
|
void |
setLatencyMax(long[] latencyMax) |
void |
setNotAvailableDuration(long[] notAvailableDuration) |
void |
setSendLatencyFaultEnable(boolean sendLatencyFaultEnable) |
void |
setServiceState(ServiceState serviceState) |
void |
setZipCompressLevel(int zipCompressLevel) |
void |
shutdown() |
void |
shutdown(boolean shutdownFactory) |
void |
start() |
void |
start(boolean startFactory) |
void |
updateFaultItem(java.lang.String brokerName,
long currentLatency,
boolean isolation) |
void |
updateTopicPublishInfo(java.lang.String topic,
TopicPublishInfo info) |
MessageExt |
viewMessage(java.lang.String msgId) |
protected java.util.concurrent.BlockingQueue<java.lang.Runnable> checkRequestQueue
protected java.util.concurrent.ExecutorService checkExecutor
public DefaultMQProducerImpl(DefaultMQProducer defaultMQProducer)
public DefaultMQProducerImpl(DefaultMQProducer defaultMQProducer, RPCHook rpcHook)
public void registerCheckForbiddenHook(CheckForbiddenHook checkForbiddenHook)
public void initTransactionEnv()
public void destroyTransactionEnv()
public void registerSendMessageHook(SendMessageHook hook)
public void start() throws MQClientException
MQClientException
public void start(boolean startFactory) throws MQClientException
MQClientException
public void shutdown()
public void shutdown(boolean shutdownFactory)
public java.util.Set<java.lang.String> getPublishTopicList()
getPublishTopicList
in interface MQProducerInner
public boolean isPublishTopicNeedUpdate(java.lang.String topic)
isPublishTopicNeedUpdate
in interface MQProducerInner
public TransactionCheckListener checkListener()
checkListener
in interface MQProducerInner
public void checkTransactionState(java.lang.String addr, MessageExt msg, CheckTransactionStateRequestHeader header)
checkTransactionState
in interface MQProducerInner
public void updateTopicPublishInfo(java.lang.String topic, TopicPublishInfo info)
updateTopicPublishInfo
in interface MQProducerInner
public boolean isUnitMode()
isUnitMode
in interface MQProducerInner
public void createTopic(java.lang.String key, java.lang.String newTopic, int queueNum) throws MQClientException
MQClientException
public void createTopic(java.lang.String key, java.lang.String newTopic, int queueNum, int topicSysFlag) throws MQClientException
MQClientException
public java.util.List<MessageQueue> fetchPublishMessageQueues(java.lang.String topic) throws MQClientException
MQClientException
public long searchOffset(MessageQueue mq, long timestamp) throws MQClientException
MQClientException
public long maxOffset(MessageQueue mq) throws MQClientException
MQClientException
public long minOffset(MessageQueue mq) throws MQClientException
MQClientException
public long earliestMsgStoreTime(MessageQueue mq) throws MQClientException
MQClientException
public MessageExt viewMessage(java.lang.String msgId) throws RemotingException, MQBrokerException, java.lang.InterruptedException, MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
MQClientException
public QueryResult queryMessage(java.lang.String topic, java.lang.String key, int maxNum, long begin, long end) throws MQClientException, java.lang.InterruptedException
MQClientException
java.lang.InterruptedException
public MessageExt queryMessageByUniqKey(java.lang.String topic, java.lang.String uniqKey) throws MQClientException, java.lang.InterruptedException
MQClientException
java.lang.InterruptedException
public void send(Message msg, SendCallback sendCallback) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public void send(Message msg, SendCallback sendCallback, long timeout) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public MessageQueue selectOneMessageQueue(TopicPublishInfo tpInfo, java.lang.String lastBrokerName)
public void updateFaultItem(java.lang.String brokerName, long currentLatency, boolean isolation)
public MQClientInstance getmQClientFactory()
public boolean hasCheckForbiddenHook()
public void executeCheckForbiddenHook(CheckForbiddenContext context) throws MQClientException
MQClientException
public boolean hasSendMessageHook()
public void executeSendMessageHookBefore(SendMessageContext context)
public void executeSendMessageHookAfter(SendMessageContext context)
public void sendOneway(Message msg) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public SendResult send(Message msg, MessageQueue mq) throws MQClientException, RemotingException, MQBrokerException, java.lang.InterruptedException
MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
public SendResult send(Message msg, MessageQueue mq, long timeout) throws MQClientException, RemotingException, MQBrokerException, java.lang.InterruptedException
MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
public void send(Message msg, MessageQueue mq, SendCallback sendCallback) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public void send(Message msg, MessageQueue mq, SendCallback sendCallback, long timeout) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public void sendOneway(Message msg, MessageQueue mq) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public SendResult send(Message msg, MessageQueueSelector selector, java.lang.Object arg) throws MQClientException, RemotingException, MQBrokerException, java.lang.InterruptedException
MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
public SendResult send(Message msg, MessageQueueSelector selector, java.lang.Object arg, long timeout) throws MQClientException, RemotingException, MQBrokerException, java.lang.InterruptedException
MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
public void send(Message msg, MessageQueueSelector selector, java.lang.Object arg, SendCallback sendCallback) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public void send(Message msg, MessageQueueSelector selector, java.lang.Object arg, SendCallback sendCallback, long timeout) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public void sendOneway(Message msg, MessageQueueSelector selector, java.lang.Object arg) throws MQClientException, RemotingException, java.lang.InterruptedException
MQClientException
RemotingException
java.lang.InterruptedException
public TransactionSendResult sendMessageInTransaction(Message msg, LocalTransactionExecuter tranExecuter, java.lang.Object arg) throws MQClientException
MQClientException
public SendResult send(Message msg) throws MQClientException, RemotingException, MQBrokerException, java.lang.InterruptedException
MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
public void endTransaction(SendResult sendResult, LocalTransactionState localTransactionState, java.lang.Throwable localException) throws RemotingException, MQBrokerException, java.lang.InterruptedException, java.net.UnknownHostException
RemotingException
MQBrokerException
java.lang.InterruptedException
java.net.UnknownHostException
public SendResult send(Message msg, long timeout) throws MQClientException, RemotingException, MQBrokerException, java.lang.InterruptedException
MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
public java.util.concurrent.ConcurrentMap<java.lang.String,TopicPublishInfo> getTopicPublishInfoTable()
public int getZipCompressLevel()
public void setZipCompressLevel(int zipCompressLevel)
public ServiceState getServiceState()
public void setServiceState(ServiceState serviceState)
public long[] getNotAvailableDuration()
public void setNotAvailableDuration(long[] notAvailableDuration)
public long[] getLatencyMax()
public void setLatencyMax(long[] latencyMax)
public boolean isSendLatencyFaultEnable()
public void setSendLatencyFaultEnable(boolean sendLatencyFaultEnable)