You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using wrong log type in try-catch exception handle.
in org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer#doConvertMessage method used log.info instead of log.error in exception handling.
privateObjectdoConvertMessage(MessageExtmessageExt) {
if (Objects.equals(messageType, MessageExt.class) || Objects.equals(messageType, org.apache.rocketmq.common.message.Message.class)) {
returnmessageExt;
} else {
Stringstr = newString(messageExt.getBody(), Charset.forName(charset));
if (Objects.equals(messageType, String.class)) {
returnstr;
} else {
// If msgType not string, use objectMapper change it.try {
// ignored
} catch (Exceptione) {
// here it is 👇log.info("convert failed. str:{}, msgType:{}", str, messageType);
thrownewRuntimeException("cannot convert message to " + messageType, e);
}
}
}
}
log.info should print normal log, it shoud be using log.error instead of log.info
how to fix
privateObjectdoConvertMessage(MessageExtmessageExt) {
if (Objects.equals(messageType, MessageExt.class) || Objects.equals(messageType, org.apache.rocketmq.common.message.Message.class)) {
returnmessageExt;
} else {
Stringstr = newString(messageExt.getBody(), Charset.forName(charset));
if (Objects.equals(messageType, String.class)) {
returnstr;
} else {
// If msgType not string, use objectMapper change it.try {
// ignored
} catch (Exceptione) {
// change like thislog.error("convert failed. str:{}, msgType:{},\n convert error msg: {}.", str, messageType, e.getMessage());
thrownewRuntimeException("cannot convert message to " + messageType, e);
}
}
}
}
The text was updated successfully, but these errors were encountered:
environment
describe
using wrong log type in try-catch exception handle.
in
org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer#doConvertMessage
method usedlog.info
instead oflog.error
in exception handling.log.info
should print normal log, it shoud be usinglog.error
instead oflog.info
how to fix
The text was updated successfully, but these errors were encountered: