提交 6afe0f84 编写于 作者: D duhenglucky 提交者: von gosling

Deprecate admin interface exposed in producer/consumer

上级 87800484
...@@ -40,18 +40,16 @@ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsume ...@@ -40,18 +40,16 @@ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsume
protected final transient DefaultMQPullConsumerImpl defaultMQPullConsumerImpl; protected final transient DefaultMQPullConsumerImpl defaultMQPullConsumerImpl;
/** /**
* Do the same thing for the same Group, the application must be set,and * Do the same thing for the same Group, the application must be set,and guarantee Globally unique
* guarantee Globally unique
*/ */
private String consumerGroup; private String consumerGroup;
/** /**
* Long polling mode, the Consumer connection max suspend time, it is not * Long polling mode, the Consumer connection max suspend time, it is not recommended to modify
* recommended to modify
*/ */
private long brokerSuspendMaxTimeMillis = 1000 * 20; private long brokerSuspendMaxTimeMillis = 1000 * 20;
/** /**
* Long polling mode, the Consumer connection timeout(must greater than * Long polling mode, the Consumer connection timeout(must greater than brokerSuspendMaxTimeMillis), it is not
* brokerSuspendMaxTimeMillis), it is not recommended to modify * recommended to modify
*/ */
private long consumerTimeoutMillisWhenSuspend = 1000 * 30; private long consumerTimeoutMillisWhenSuspend = 1000 * 30;
/** /**
...@@ -102,42 +100,74 @@ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsume ...@@ -102,42 +100,74 @@ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsume
this(MixAll.DEFAULT_CONSUMER_GROUP, rpcHook); this(MixAll.DEFAULT_CONSUMER_GROUP, rpcHook);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public void createTopic(String key, String newTopic, int queueNum) throws MQClientException { public void createTopic(String key, String newTopic, int queueNum) throws MQClientException {
createTopic(key, newTopic, queueNum, 0); createTopic(key, newTopic, queueNum, 0);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public void createTopic(String key, String newTopic, int queueNum, int topicSysFlag) throws MQClientException { public void createTopic(String key, String newTopic, int queueNum, int topicSysFlag) throws MQClientException {
this.defaultMQPullConsumerImpl.createTopic(key, newTopic, queueNum, topicSysFlag); this.defaultMQPullConsumerImpl.createTopic(key, newTopic, queueNum, topicSysFlag);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public long searchOffset(MessageQueue mq, long timestamp) throws MQClientException { public long searchOffset(MessageQueue mq, long timestamp) throws MQClientException {
return this.defaultMQPullConsumerImpl.searchOffset(mq, timestamp); return this.defaultMQPullConsumerImpl.searchOffset(mq, timestamp);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public long maxOffset(MessageQueue mq) throws MQClientException { public long maxOffset(MessageQueue mq) throws MQClientException {
return this.defaultMQPullConsumerImpl.maxOffset(mq); return this.defaultMQPullConsumerImpl.maxOffset(mq);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public long minOffset(MessageQueue mq) throws MQClientException { public long minOffset(MessageQueue mq) throws MQClientException {
return this.defaultMQPullConsumerImpl.minOffset(mq); return this.defaultMQPullConsumerImpl.minOffset(mq);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public long earliestMsgStoreTime(MessageQueue mq) throws MQClientException { public long earliestMsgStoreTime(MessageQueue mq) throws MQClientException {
return this.defaultMQPullConsumerImpl.earliestMsgStoreTime(mq); return this.defaultMQPullConsumerImpl.earliestMsgStoreTime(mq);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public MessageExt viewMessage(String offsetMsgId) throws RemotingException, MQBrokerException, public MessageExt viewMessage(String offsetMsgId) throws RemotingException, MQBrokerException,
InterruptedException, MQClientException { InterruptedException, MQClientException {
return this.defaultMQPullConsumerImpl.viewMessage(offsetMsgId); return this.defaultMQPullConsumerImpl.viewMessage(offsetMsgId);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public QueryResult queryMessage(String topic, String key, int maxNum, long begin, long end) public QueryResult queryMessage(String topic, String key, int maxNum, long begin, long end)
throws MQClientException, InterruptedException { throws MQClientException, InterruptedException {
...@@ -156,6 +186,11 @@ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsume ...@@ -156,6 +186,11 @@ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsume
return brokerSuspendMaxTimeMillis; return brokerSuspendMaxTimeMillis;
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
public void setBrokerSuspendMaxTimeMillis(long brokerSuspendMaxTimeMillis) { public void setBrokerSuspendMaxTimeMillis(long brokerSuspendMaxTimeMillis) {
this.brokerSuspendMaxTimeMillis = brokerSuspendMaxTimeMillis; this.brokerSuspendMaxTimeMillis = brokerSuspendMaxTimeMillis;
} }
...@@ -342,14 +377,27 @@ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsume ...@@ -342,14 +377,27 @@ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsume
this.defaultMQPullConsumerImpl.sendMessageBack(msg, delayLevel, brokerName, consumerGroup); this.defaultMQPullConsumerImpl.sendMessageBack(msg, delayLevel, brokerName, consumerGroup);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
public OffsetStore getOffsetStore() { public OffsetStore getOffsetStore() {
return offsetStore; return offsetStore;
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
public void setOffsetStore(OffsetStore offsetStore) { public void setOffsetStore(OffsetStore offsetStore) {
this.offsetStore = offsetStore; this.offsetStore = offsetStore;
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
public DefaultMQPullConsumerImpl getDefaultMQPullConsumerImpl() { public DefaultMQPullConsumerImpl getDefaultMQPullConsumerImpl() {
return defaultMQPullConsumerImpl; return defaultMQPullConsumerImpl;
} }
......
...@@ -160,7 +160,7 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume ...@@ -160,7 +160,7 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume
/** /**
* Max consumer thread number * Max consumer thread number
*/ */
private int consumeThreadMax = 64; private int consumeThreadMax = 20;
/** /**
* Threshold for dynamic adjustment of the number of thread pool * Threshold for dynamic adjustment of the number of thread pool
...@@ -346,48 +346,84 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume ...@@ -346,48 +346,84 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume
this(consumerGroup, null, new AllocateMessageQueueAveragely()); this(consumerGroup, null, new AllocateMessageQueueAveragely());
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public void createTopic(String key, String newTopic, int queueNum) throws MQClientException { public void createTopic(String key, String newTopic, int queueNum) throws MQClientException {
createTopic(key, newTopic, queueNum, 0); createTopic(key, newTopic, queueNum, 0);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public void createTopic(String key, String newTopic, int queueNum, int topicSysFlag) throws MQClientException { public void createTopic(String key, String newTopic, int queueNum, int topicSysFlag) throws MQClientException {
this.defaultMQPushConsumerImpl.createTopic(key, newTopic, queueNum, topicSysFlag); this.defaultMQPushConsumerImpl.createTopic(key, newTopic, queueNum, topicSysFlag);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public long searchOffset(MessageQueue mq, long timestamp) throws MQClientException { public long searchOffset(MessageQueue mq, long timestamp) throws MQClientException {
return this.defaultMQPushConsumerImpl.searchOffset(mq, timestamp); return this.defaultMQPushConsumerImpl.searchOffset(mq, timestamp);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public long maxOffset(MessageQueue mq) throws MQClientException { public long maxOffset(MessageQueue mq) throws MQClientException {
return this.defaultMQPushConsumerImpl.maxOffset(mq); return this.defaultMQPushConsumerImpl.maxOffset(mq);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public long minOffset(MessageQueue mq) throws MQClientException { public long minOffset(MessageQueue mq) throws MQClientException {
return this.defaultMQPushConsumerImpl.minOffset(mq); return this.defaultMQPushConsumerImpl.minOffset(mq);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public long earliestMsgStoreTime(MessageQueue mq) throws MQClientException { public long earliestMsgStoreTime(MessageQueue mq) throws MQClientException {
return this.defaultMQPushConsumerImpl.earliestMsgStoreTime(mq); return this.defaultMQPushConsumerImpl.earliestMsgStoreTime(mq);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public MessageExt viewMessage( public MessageExt viewMessage(
String offsetMsgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException { String offsetMsgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
return this.defaultMQPushConsumerImpl.viewMessage(offsetMsgId); return this.defaultMQPushConsumerImpl.viewMessage(offsetMsgId);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public QueryResult queryMessage(String topic, String key, int maxNum, long begin, long end) public QueryResult queryMessage(String topic, String key, int maxNum, long begin, long end)
throws MQClientException, InterruptedException { throws MQClientException, InterruptedException {
return this.defaultMQPushConsumerImpl.queryMessage(topic, key, maxNum, begin, end); return this.defaultMQPushConsumerImpl.queryMessage(topic, key, maxNum, begin, end);
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
@Override @Override
public MessageExt viewMessage(String topic, public MessageExt viewMessage(String topic,
String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException { String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
...@@ -456,6 +492,10 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume ...@@ -456,6 +492,10 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume
this.consumeThreadMin = consumeThreadMin; this.consumeThreadMin = consumeThreadMin;
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
public DefaultMQPushConsumerImpl getDefaultMQPushConsumerImpl() { public DefaultMQPushConsumerImpl getDefaultMQPushConsumerImpl() {
return defaultMQPushConsumerImpl; return defaultMQPushConsumerImpl;
} }
...@@ -528,6 +568,10 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume ...@@ -528,6 +568,10 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume
return subscription; return subscription;
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
public void setSubscription(Map<String, String> subscription) { public void setSubscription(Map<String, String> subscription) {
this.subscription = subscription; this.subscription = subscription;
} }
...@@ -702,10 +746,18 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume ...@@ -702,10 +746,18 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume
this.defaultMQPushConsumerImpl.resume(); this.defaultMQPushConsumerImpl.resume();
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
public OffsetStore getOffsetStore() { public OffsetStore getOffsetStore() {
return offsetStore; return offsetStore;
} }
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*/
@Deprecated
public void setOffsetStore(OffsetStore offsetStore) { public void setOffsetStore(OffsetStore offsetStore) {
this.offsetStore = offsetStore; this.offsetStore = offsetStore;
} }
......
...@@ -155,18 +155,20 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -155,18 +155,20 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
* @param producerGroup Producer group, see the name-sake field. * @param producerGroup Producer group, see the name-sake field.
* @param rpcHook RPC hook to execute per each remoting command execution. * @param rpcHook RPC hook to execute per each remoting command execution.
* @param enableMsgTrace Switch flag instance for message trace. * @param enableMsgTrace Switch flag instance for message trace.
* @param customizedTraceTopic The name value of message trace topic.If you don't config,you can use the default trace topic name. * @param customizedTraceTopic The name value of message trace topic.If you don't config,you can use the default
* trace topic name.
*/ */
public DefaultMQProducer(final String producerGroup, RPCHook rpcHook, boolean enableMsgTrace,final String customizedTraceTopic) { public DefaultMQProducer(final String producerGroup, RPCHook rpcHook, boolean enableMsgTrace,
final String customizedTraceTopic) {
this.producerGroup = producerGroup; this.producerGroup = producerGroup;
defaultMQProducerImpl = new DefaultMQProducerImpl(this, rpcHook); defaultMQProducerImpl = new DefaultMQProducerImpl(this, rpcHook);
//if client open the message trace feature //if client open the message trace feature
if (enableMsgTrace) { if (enableMsgTrace) {
try { try {
AsyncTraceDispatcher dispatcher = new AsyncTraceDispatcher(customizedTraceTopic, rpcHook); AsyncTraceDispatcher dispatcher = new AsyncTraceDispatcher(customizedTraceTopic, rpcHook);
dispatcher.setHostProducer(this.getDefaultMQProducerImpl()); dispatcher.setHostProducer(this.defaultMQProducerImpl);
traceDispatcher = dispatcher; traceDispatcher = dispatcher;
this.getDefaultMQProducerImpl().registerSendMessageHook( this.defaultMQProducerImpl.registerSendMessageHook(
new SendMessageTraceHookImpl(traceDispatcher)); new SendMessageTraceHookImpl(traceDispatcher));
} catch (Throwable e) { } catch (Throwable e) {
log.error("system mqtrace hook init failed ,maybe can't send msg trace data"); log.error("system mqtrace hook init failed ,maybe can't send msg trace data");
...@@ -193,13 +195,13 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -193,13 +195,13 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
this(producerGroup, null, enableMsgTrace, null); this(producerGroup, null, enableMsgTrace, null);
} }
/** /**
* Constructor specifying producer group, enabled msgTrace flag and customized trace topic name. * Constructor specifying producer group, enabled msgTrace flag and customized trace topic name.
* *
* @param producerGroup Producer group, see the name-sake field. * @param producerGroup Producer group, see the name-sake field.
* @param enableMsgTrace Switch flag instance for message trace. * @param enableMsgTrace Switch flag instance for message trace.
* @param customizedTraceTopic The name value of message trace topic.If you don't config,you can use the default trace topic name. * @param customizedTraceTopic The name value of message trace topic.If you don't config,you can use the default
* trace topic name.
*/ */
public DefaultMQProducer(final String producerGroup, boolean enableMsgTrace, final String customizedTraceTopic) { public DefaultMQProducer(final String producerGroup, boolean enableMsgTrace, final String customizedTraceTopic) {
this(producerGroup, null, enableMsgTrace, customizedTraceTopic); this(producerGroup, null, enableMsgTrace, customizedTraceTopic);
...@@ -207,7 +209,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -207,7 +209,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/** /**
* Constructor specifying the RPC hook. * Constructor specifying the RPC hook.
* *
* @param rpcHook RPC hook to execute per each remoting command execution. * @param rpcHook RPC hook to execute per each remoting command execution.
*/ */
public DefaultMQProducer(RPCHook rpcHook) { public DefaultMQProducer(RPCHook rpcHook) {
...@@ -308,9 +310,9 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -308,9 +310,9 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
* This method returns immediately. On sending completion, <code>sendCallback</code> will be executed. * This method returns immediately. On sending completion, <code>sendCallback</code> will be executed.
* </p> * </p>
* *
* Similar to {@link #send(Message)}, internal implementation would potentially retry up to * Similar to {@link #send(Message)}, internal implementation would potentially retry up to {@link
* {@link #retryTimesWhenSendAsyncFailed} times before claiming sending failure, which may yield message duplication * #retryTimesWhenSendAsyncFailed} times before claiming sending failure, which may yield message duplication and
* and application developers are the one to resolve this potential issue. * application developers are the one to resolve this potential issue.
* *
* @param msg Message to send. * @param msg Message to send.
* @param sendCallback Callback to execute on sending completed, either successful or unsuccessful. * @param sendCallback Callback to execute on sending completed, either successful or unsuccessful.
...@@ -547,6 +549,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -547,6 +549,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/** /**
* This method is used to send transactional messages. * This method is used to send transactional messages.
*
* @param msg Transactional message to send. * @param msg Transactional message to send.
* @param arg Argument used along with local transaction executor. * @param arg Argument used along with local transaction executor.
* @return Transaction result. * @return Transaction result.
...@@ -559,20 +562,22 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -559,20 +562,22 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
} }
/** /**
* Create a topic on broker. * This method will be removed in a certain version after April 5, 2020, so please do not use this method.
* *
* @param key accesskey * @param key accesskey
* @param newTopic topic name * @param newTopic topic name
* @param queueNum topic's queue number * @param queueNum topic's queue number
* @throws MQClientException if there is any client error. * @throws MQClientException if there is any client error.
*/ */
@Deprecated
@Override @Override
public void createTopic(String key, String newTopic, int queueNum) throws MQClientException { public void createTopic(String key, String newTopic, int queueNum) throws MQClientException {
createTopic(key, newTopic, queueNum, 0); createTopic(key, newTopic, queueNum, 0);
} }
/** /**
* Create a topic on broker. * Create a topic on broker. This method will be removed in a certain version after April 5, 2020, so please do not
* use this method.
* *
* @param key accesskey * @param key accesskey
* @param newTopic topic name * @param newTopic topic name
...@@ -580,6 +585,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -580,6 +585,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
* @param topicSysFlag topic system flag * @param topicSysFlag topic system flag
* @throws MQClientException if there is any client error. * @throws MQClientException if there is any client error.
*/ */
@Deprecated
@Override @Override
public void createTopic(String key, String newTopic, int queueNum, int topicSysFlag) throws MQClientException { public void createTopic(String key, String newTopic, int queueNum, int topicSysFlag) throws MQClientException {
this.defaultMQProducerImpl.createTopic(key, newTopic, queueNum, topicSysFlag); this.defaultMQProducerImpl.createTopic(key, newTopic, queueNum, topicSysFlag);
...@@ -601,10 +607,13 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -601,10 +607,13 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/** /**
* Query maximum offset of the given message queue. * Query maximum offset of the given message queue.
* *
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*
* @param mq Instance of MessageQueue * @param mq Instance of MessageQueue
* @return maximum offset of the given consume queue. * @return maximum offset of the given consume queue.
* @throws MQClientException if there is any client error. * @throws MQClientException if there is any client error.
*/ */
@Deprecated
@Override @Override
public long maxOffset(MessageQueue mq) throws MQClientException { public long maxOffset(MessageQueue mq) throws MQClientException {
return this.defaultMQProducerImpl.maxOffset(mq); return this.defaultMQProducerImpl.maxOffset(mq);
...@@ -613,10 +622,13 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -613,10 +622,13 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/** /**
* Query minimum offset of the given message queue. * Query minimum offset of the given message queue.
* *
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*
* @param mq Instance of MessageQueue * @param mq Instance of MessageQueue
* @return minimum offset of the given message queue. * @return minimum offset of the given message queue.
* @throws MQClientException if there is any client error. * @throws MQClientException if there is any client error.
*/ */
@Deprecated
@Override @Override
public long minOffset(MessageQueue mq) throws MQClientException { public long minOffset(MessageQueue mq) throws MQClientException {
return this.defaultMQProducerImpl.minOffset(mq); return this.defaultMQProducerImpl.minOffset(mq);
...@@ -625,10 +637,13 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -625,10 +637,13 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/** /**
* Query earliest message store time. * Query earliest message store time.
* *
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*
* @param mq Instance of MessageQueue * @param mq Instance of MessageQueue
* @return earliest message store time. * @return earliest message store time.
* @throws MQClientException if there is any client error. * @throws MQClientException if there is any client error.
*/ */
@Deprecated
@Override @Override
public long earliestMsgStoreTime(MessageQueue mq) throws MQClientException { public long earliestMsgStoreTime(MessageQueue mq) throws MQClientException {
return this.defaultMQProducerImpl.earliestMsgStoreTime(mq); return this.defaultMQProducerImpl.earliestMsgStoreTime(mq);
...@@ -637,6 +652,8 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -637,6 +652,8 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/** /**
* Query message of the given offset message ID. * Query message of the given offset message ID.
* *
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*
* @param offsetMsgId message id * @param offsetMsgId message id
* @return Message specified. * @return Message specified.
* @throws MQBrokerException if there is any broker error. * @throws MQBrokerException if there is any broker error.
...@@ -644,6 +661,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -644,6 +661,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
* @throws RemotingException if there is any network-tier error. * @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted. * @throws InterruptedException if the sending thread is interrupted.
*/ */
@Deprecated
@Override @Override
public MessageExt viewMessage( public MessageExt viewMessage(
String offsetMsgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException { String offsetMsgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
...@@ -653,6 +671,8 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -653,6 +671,8 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/** /**
* Query message by key. * Query message by key.
* *
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*
* @param topic message topic * @param topic message topic
* @param key message key index word * @param key message key index word
* @param maxNum max message number * @param maxNum max message number
...@@ -662,6 +682,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -662,6 +682,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
* @throws MQClientException if there is any client error. * @throws MQClientException if there is any client error.
* @throws InterruptedException if the thread is interrupted. * @throws InterruptedException if the thread is interrupted.
*/ */
@Deprecated
@Override @Override
public QueryResult queryMessage(String topic, String key, int maxNum, long begin, long end) public QueryResult queryMessage(String topic, String key, int maxNum, long begin, long end)
throws MQClientException, InterruptedException { throws MQClientException, InterruptedException {
...@@ -671,6 +692,8 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -671,6 +692,8 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
/** /**
* Query message of the given message ID. * Query message of the given message ID.
* *
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*
* @param topic Topic * @param topic Topic
* @param msgId Message ID * @param msgId Message ID
* @return Message specified. * @return Message specified.
...@@ -679,6 +702,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -679,6 +702,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
* @throws RemotingException if there is any network-tier error. * @throws RemotingException if there is any network-tier error.
* @throws InterruptedException if the sending thread is interrupted. * @throws InterruptedException if the sending thread is interrupted.
*/ */
@Deprecated
@Override @Override
public MessageExt viewMessage(String topic, public MessageExt viewMessage(String topic,
String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException { String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
...@@ -715,8 +739,8 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -715,8 +739,8 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
} }
/** /**
* Sets an Executor to be used for executing callback methods. * Sets an Executor to be used for executing callback methods. If the Executor is not set, {@link
* If the Executor is not set, {@link NettyRemotingClient#publicExecutor} will be used. * NettyRemotingClient#publicExecutor} will be used.
* *
* @param callbackExecutor the instance of Executor * @param callbackExecutor the instance of Executor
*/ */
...@@ -781,6 +805,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer { ...@@ -781,6 +805,7 @@ public class DefaultMQProducer extends ClientConfig implements MQProducer {
this.compressMsgBodyOverHowmuch = compressMsgBodyOverHowmuch; this.compressMsgBodyOverHowmuch = compressMsgBodyOverHowmuch;
} }
@Deprecated
public DefaultMQProducerImpl getDefaultMQProducerImpl() { public DefaultMQProducerImpl getDefaultMQProducerImpl() {
return defaultMQProducerImpl; return defaultMQProducerImpl;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册