com.alibaba.rocketmq.client.impl.producer
类 DefaultMQProducerImpl

java.lang.Object
  继承者 com.alibaba.rocketmq.client.impl.producer.DefaultMQProducerImpl
所有已实现的接口:
MQProducerInner

public class DefaultMQProducerImpl
extends Object
implements MQProducerInner

生产者默认实现

从以下版本开始:
2013-7-24
作者:
shijia.wxr

字段摘要
protected  ExecutorService checkExecutor
           
protected  BlockingQueue<Runnable> checkRequestQueue
          事务相关
 
构造方法摘要
DefaultMQProducerImpl(DefaultMQProducer defaultMQProducer)
           
 
方法摘要
 TransactionCheckListener checkListener()
           
 void checkTransactionState(String addr, MessageExt msg, CheckTransactionStateRequestHeader header)
           
 void createTopic(String key, String newTopic, int queueNum)
           
 void destroyTransactionEnv()
           
 long earliestMsgStoreTime(MessageQueue mq)
           
 void executeCheckForbiddenHook(CheckForbiddenContext context)
           
 void executeSendMessageHookAfter(SendMessageContext context)
           
 void executeSendMessageHookBefore(SendMessageContext context)
           
 List<MessageQueue> fetchPublishMessageQueues(String topic)
           
 MQClientFactory getmQClientFactory()
           
 Set<String> getPublishTopicList()
           
 ConcurrentHashMap<String,TopicPublishInfo> getTopicPublishInfoTable()
           
 int getZipCompressLevel()
           
 boolean hasCheckForbiddenHook()
           
 boolean hasSendMessageHook()
           
 void initTransactionEnv()
           
 boolean isPublishTopicNeedUpdate(String topic)
           
 boolean isUnitMode()
           
 long maxOffset(MessageQueue mq)
           
 long minOffset(MessageQueue mq)
           
 QueryResult queryMessage(String topic, String key, int maxNum, long begin, long end)
           
 void registerCheckForbiddenHook(CheckForbiddenHook checkForbiddenHook)
           
 void registerSendMessageHook(SendMessageHook hook)
           
 long searchOffset(MessageQueue mq, long timestamp)
           
 SendResult send(Message msg)
          DEFAULT SYNC -------------------------------------------------------
 SendResult send(Message msg, MessageQueue mq)
          KERNEL SYNC -------------------------------------------------------
 SendResult send(Message msg, MessageQueueSelector selector, Object arg)
          SELECT SYNC -------------------------------------------------------
 void send(Message msg, MessageQueueSelector selector, Object arg, SendCallback sendCallback)
          SELECT ASYNC -------------------------------------------------------
 void send(Message msg, MessageQueue mq, SendCallback sendCallback)
          KERNEL ASYNC -------------------------------------------------------
 void send(Message msg, SendCallback sendCallback)
          DEFAULT ASYNC -------------------------------------------------------
 TransactionSendResult sendMessageInTransaction(Message msg, LocalTransactionExecuter tranExecuter, Object arg)
           
 void sendOneway(Message msg)
          DEFAULT ONEWAY -------------------------------------------------------
 void sendOneway(Message msg, MessageQueue mq)
          KERNEL ONEWAY -------------------------------------------------------
 void sendOneway(Message msg, MessageQueueSelector selector, Object arg)
          SELECT ONEWAY -------------------------------------------------------
 void setZipCompressLevel(int zipCompressLevel)
           
 void shutdown()
           
 void shutdown(boolean shutdownFactory)
           
 void start()
           
 void start(boolean startFactory)
           
 void updateTopicPublishInfo(String topic, TopicPublishInfo info)
           
 MessageExt viewMessage(String msgId)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

checkRequestQueue

protected BlockingQueue<Runnable> checkRequestQueue
事务相关


checkExecutor

protected ExecutorService checkExecutor
构造方法详细信息

DefaultMQProducerImpl

public DefaultMQProducerImpl(DefaultMQProducer defaultMQProducer)
方法详细信息

hasCheckForbiddenHook

public boolean hasCheckForbiddenHook()

registerCheckForbiddenHook

public void registerCheckForbiddenHook(CheckForbiddenHook checkForbiddenHook)

executeCheckForbiddenHook

public void executeCheckForbiddenHook(CheckForbiddenContext context)
                               throws MQClientException
抛出:
MQClientException

initTransactionEnv

public void initTransactionEnv()

destroyTransactionEnv

public void destroyTransactionEnv()

hasSendMessageHook

public boolean hasSendMessageHook()

registerSendMessageHook

public void registerSendMessageHook(SendMessageHook hook)

executeSendMessageHookBefore

public void executeSendMessageHookBefore(SendMessageContext context)

executeSendMessageHookAfter

public void executeSendMessageHookAfter(SendMessageContext context)

start

public void start()
           throws MQClientException
抛出:
MQClientException

start

public void start(boolean startFactory)
           throws MQClientException
抛出:
MQClientException

shutdown

public void shutdown()

shutdown

public void shutdown(boolean shutdownFactory)

getPublishTopicList

public Set<String> getPublishTopicList()
指定者:
接口 MQProducerInner 中的 getPublishTopicList

isPublishTopicNeedUpdate

public boolean isPublishTopicNeedUpdate(String topic)
指定者:
接口 MQProducerInner 中的 isPublishTopicNeedUpdate

checkListener

public TransactionCheckListener checkListener()
指定者:
接口 MQProducerInner 中的 checkListener

checkTransactionState

public void checkTransactionState(String addr,
                                  MessageExt msg,
                                  CheckTransactionStateRequestHeader header)
指定者:
接口 MQProducerInner 中的 checkTransactionState

updateTopicPublishInfo

public void updateTopicPublishInfo(String topic,
                                   TopicPublishInfo info)
指定者:
接口 MQProducerInner 中的 updateTopicPublishInfo

isUnitMode

public boolean isUnitMode()
指定者:
接口 MQProducerInner 中的 isUnitMode

createTopic

public void createTopic(String key,
                        String newTopic,
                        int queueNum)
                 throws MQClientException
抛出:
MQClientException

fetchPublishMessageQueues

public List<MessageQueue> fetchPublishMessageQueues(String topic)
                                             throws MQClientException
抛出:
MQClientException

searchOffset

public long searchOffset(MessageQueue mq,
                         long timestamp)
                  throws MQClientException
抛出:
MQClientException

maxOffset

public long maxOffset(MessageQueue mq)
               throws MQClientException
抛出:
MQClientException

minOffset

public long minOffset(MessageQueue mq)
               throws MQClientException
抛出:
MQClientException

earliestMsgStoreTime

public long earliestMsgStoreTime(MessageQueue mq)
                          throws MQClientException
抛出:
MQClientException

viewMessage

public MessageExt viewMessage(String msgId)
                       throws RemotingException,
                              MQBrokerException,
                              InterruptedException,
                              MQClientException
抛出:
RemotingException
MQBrokerException
InterruptedException
MQClientException

queryMessage

public QueryResult queryMessage(String topic,
                                String key,
                                int maxNum,
                                long begin,
                                long end)
                         throws MQClientException,
                                InterruptedException
抛出:
MQClientException
InterruptedException

send

public void send(Message msg,
                 SendCallback sendCallback)
          throws MQClientException,
                 RemotingException,
                 InterruptedException
DEFAULT ASYNC -------------------------------------------------------

抛出:
MQClientException
RemotingException
InterruptedException

sendOneway

public void sendOneway(Message msg)
                throws MQClientException,
                       RemotingException,
                       InterruptedException
DEFAULT ONEWAY -------------------------------------------------------

抛出:
MQClientException
RemotingException
InterruptedException

send

public SendResult send(Message msg,
                       MessageQueue mq)
                throws MQClientException,
                       RemotingException,
                       MQBrokerException,
                       InterruptedException
KERNEL SYNC -------------------------------------------------------

抛出:
MQClientException
RemotingException
MQBrokerException
InterruptedException

send

public void send(Message msg,
                 MessageQueue mq,
                 SendCallback sendCallback)
          throws MQClientException,
                 RemotingException,
                 InterruptedException
KERNEL ASYNC -------------------------------------------------------

抛出:
MQClientException
RemotingException
InterruptedException

sendOneway

public void sendOneway(Message msg,
                       MessageQueue mq)
                throws MQClientException,
                       RemotingException,
                       InterruptedException
KERNEL ONEWAY -------------------------------------------------------

抛出:
MQClientException
RemotingException
InterruptedException

send

public SendResult send(Message msg,
                       MessageQueueSelector selector,
                       Object arg)
                throws MQClientException,
                       RemotingException,
                       MQBrokerException,
                       InterruptedException
SELECT SYNC -------------------------------------------------------

抛出:
MQClientException
RemotingException
MQBrokerException
InterruptedException

send

public void send(Message msg,
                 MessageQueueSelector selector,
                 Object arg,
                 SendCallback sendCallback)
          throws MQClientException,
                 RemotingException,
                 InterruptedException
SELECT ASYNC -------------------------------------------------------

抛出:
MQClientException
RemotingException
InterruptedException

sendOneway

public void sendOneway(Message msg,
                       MessageQueueSelector selector,
                       Object arg)
                throws MQClientException,
                       RemotingException,
                       InterruptedException
SELECT ONEWAY -------------------------------------------------------

抛出:
MQClientException
RemotingException
InterruptedException

sendMessageInTransaction

public TransactionSendResult sendMessageInTransaction(Message msg,
                                                      LocalTransactionExecuter tranExecuter,
                                                      Object arg)
                                               throws MQClientException
抛出:
MQClientException

send

public SendResult send(Message msg)
                throws MQClientException,
                       RemotingException,
                       MQBrokerException,
                       InterruptedException
DEFAULT SYNC -------------------------------------------------------

抛出:
MQClientException
RemotingException
MQBrokerException
InterruptedException

getTopicPublishInfoTable

public ConcurrentHashMap<String,TopicPublishInfo> getTopicPublishInfoTable()

getmQClientFactory

public MQClientFactory getmQClientFactory()

getZipCompressLevel

public int getZipCompressLevel()

setZipCompressLevel

public void setZipCompressLevel(int zipCompressLevel)


Copyright © 2012-2014. All Rights Reserved.