Maximum number of retry to perform internally before claiming sending failure in synchronous mode.
53 | * This may potentially cause message duplication which is up to application developers to resolve. 54 | */ 55 | private int retryTimesWhenSendFailed = 2; 56 | 57 | /** 58 | *Maximum number of retry to perform internally before claiming sending failure in asynchronous mode.
59 | * This may potentially cause message duplication which is up to application developers to resolve. 60 | */ 61 | private int retryTimesWhenSendAsyncFailed = 2; 62 | 63 | /** 64 | * Indicate whether to retry another broker on sending failure internally. 65 | */ 66 | private boolean retryAnotherBrokerWhenNotStoreOk = false; 67 | 68 | /** 69 | * Maximum allowed message size in bytes. // 4M 70 | */ 71 | private int maxMessageSize = 1024 * 1024 * 4; 72 | 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/rocketmq/starter/core/DefaultRocketMQListenerContainerConstants.java: -------------------------------------------------------------------------------- 1 | package org.rocketmq.starter.core; 2 | 3 | /** 4 | *5 | * Note: 6 | *
7 | * Date: 04/08/2018 18:25.
8 | *
9 | * @author He Jialin
10 | */
11 | public class DefaultRocketMQListenerContainerConstants {
12 | public static final String PROP_NAMESERVER = "nameServer";
13 | public static final String PROP_TOPIC = "topic";
14 | public static final String PROP_CONSUMER_GROUP = "consumerGroup";
15 | public static final String PROP_CONSUME_MODE = "consumeMode";
16 | public static final String PROP_CONSUME_THREAD_MAX = "consumeThreadMax";
17 | public static final String PROP_MESSAGE_MODEL = "messageModel";
18 | public static final String PROP_SELECTOR_EXPRESS = "selectorExpress";
19 | public static final String PROP_SELECTOR_TYPE = "selectorType";
20 | public static final String PROP_ROCKETMQ_LISTENER = "rocketMQListener";
21 | public static final String PROP_OBJECT_MAPPER = "objectMapper";
22 | public static final String METHOD_DESTROY = "destroy";
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/org/rocketmq/starter/core/RocketMQConfig.java:
--------------------------------------------------------------------------------
1 | package org.rocketmq.starter.core;
2 |
3 | /**
4 | * @author He Jialin
5 | */
6 | public class RocketMQConfig {
7 | private Class> messageClass;
8 | private boolean orderlyMessage;
9 |
10 | public Class> getMessageClass() {
11 | return messageClass;
12 | }
13 |
14 | public void setMessageClass(Class> messageClass) {
15 | this.messageClass = messageClass;
16 | }
17 |
18 | public boolean isOrderlyMessage() {
19 | return orderlyMessage;
20 | }
21 |
22 | public void setOrderlyMessage(boolean orderlyMessage) {
23 | this.orderlyMessage = orderlyMessage;
24 | }
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/rocketmq/starter/core/RocketMQProducer.java:
--------------------------------------------------------------------------------
1 | package org.rocketmq.starter.core;
2 |
3 |
4 | import org.apache.rocketmq.client.exception.MQBrokerException;
5 | import org.apache.rocketmq.client.exception.MQClientException;
6 | import org.apache.rocketmq.client.producer.SendResult;
7 | import org.apache.rocketmq.common.message.Message;
8 | import org.apache.rocketmq.remoting.exception.RemotingException;
9 |
10 | import org.rocketmq.starter.core.producer.MessageProxy;
11 |
12 |
13 | /**
14 | * @author He Jialin
15 | */
16 | public interface RocketMQProducer
7 | * Note:
8 | *
9 | * Date: 03/31/2018 16:41.
10 | *
11 | * @author He Jialin
12 | */
13 | public class RocketMQAutoConfigurationTests {
14 | }
15 |
--------------------------------------------------------------------------------