2 消息分割:可以考虑将消息分割成多个小消息进行发送。可以用messageType来细分一下 3 使用外部存储并发...
throw new MQClientException(ResponseCode.MESSAGE_ILLEGAL, "the message body length is zero"); } if (msg.getBody().length > defaultMQProducer.getMaxMessageSize()) { throw new MQClientException(ResponseCode.MESSAGE_ILLEGAL, "the message body size over max value, MAX: " + defaultMQProducer.get...
int tmpSize = message.getTopic().length() + message.getBody().length; Map<String, String> properties = message.getProperties(); for (Map.Entry<String, String> entry : properties.entrySet()) { tmpSize += entry.getKey().length() + entry.getValue().length(); } tmpSize = tmpSize + ...
(ResponseCode.MESSAGE_ILLEGAL, "the message body size over max value, MAX: " + defaultMQProducer.getMaxMessageSize()); } } //... } checkMessage方法首先checkTopic,然后校验msg.getBody()是否为null,或者长度是否为0,最后校验长度是否大于defaultMQProducer.getMaxMessageSize(),校验不通过都会抛出MQCli...
2019-03-21 11:41:34.581 [pool-8-thread-1] ERROR com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer - send flat message to hashed partition error org.apache.rocketmq.client.exception.MQClientException: CODE: 13 DESC: the message body size over max value, MAX: 4194304 For more information...
MESSAGE_ILLEGAL, "the message body size over max value, MAX: " + defaultMQProducer.getMaxMessageSize()); } } //... } checkMessage方法首先checkTopic,然后校验msg.getBody()是否为null,或者长度是否为0,最后校验长度是否大于defaultMQProducer.getMaxMessageSize(),校验不通过都会抛出MQClientExceptio...
SendResult result=producer.send(message); System.out.println(result);//关闭生产者producer.shutdown(); } } 控制台将会报如下异常: org.apache.rocketmq.client.exception.MQClientException: CODE: 13 DESC: the message body size over max value, MAX: 1024...
Maximum allowed message body size in bytes. */privateintmaxMessageSize=1024*1024*4;// 4M...if(msg.getBody().length>defaultMQProducer.getMaxMessageSize()){thrownewMQClientException(ResponseCode.MESSAGE_ILLEGAL,"the message body size over max value, MAX: "+defaultMQProducer.getMaxMessageSize()...
JAVA_OPT=“${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m” 启动NameServer 启动NameServer nohup sh bin/mqnamesrv & 查看启动日志 tail -f ~/logs/rocketmqlogs/namesrv.log 启动Broker
MQ,Message Queue,是一种提供消息队列服务的中间件,也称为消息中间件,是一套提供了消息生产、存储、消费全过程API的软件系统。消息即数据。一般消息的体量不会很大。 2、MQ 用途 限流削峰 MQ 可以将系统的超量请求暂存其中,以便系统后期可以慢慢进行处理,从而避免了请求的丢失或系统被压垮。