2. Use IllegalArgumentException
In ConsumerConfig#validConsumerGroupParameter
private void validConsumerGroupParameter(String consumerGroup) throws Exception {
if (TStringUtils.isBlank(consumerGroup)) {
thrownew Exception("Illegal parameter: consumerGroup is Blank!");
}
String tmpConsumerGroup = String.valueOf(consumerGroup).trim();
if (tmpConsumerGroup.length() > TBaseConstants.META_MAX_GROUPNAME_LENGTH) {
thrownew Exception(new StringBuilder(512)
.append("Illegal parameter: the max length of consumerGroup is ")
.append(TBaseConstants.META_MAX_GROUPNAME_LENGTH)
.append(" characters").toString());
}
if (!tmpConsumerGroup.matches(TBaseConstants.META_TMP_GROUP_VALUE)) {
thrownew Exception(new StringBuilder(512)
.append("Illegal parameter: the value of consumerGroup")
.append(" must begin with a letter, ")
.append("can only contain characters,numbers,hyphen,and underscores").toString());
}
}
will change to throw IllegalArgumentException
private void validConsumerGroupParameter(String consumerGroup) throws Exception {
if (TStringUtils.isBlank(consumerGroup)) {
thrownew IllegalArgumentException("Illegal parameter: consumerGroup is Blank!");
}
String tmpConsumerGroup = String.valueOf(consumerGroup).trim();
if (tmpConsumerGroup.length() > TBaseConstants.META_MAX_GROUPNAME_LENGTH) {
thrownew IllegalArgumentException(new StringBuilder(512)
.append("Illegal parameter: the max length of consumerGroup is ")
.append(TBaseConstants.META_MAX_GROUPNAME_LENGTH)
.append(" characters").toString());
}
if (!tmpConsumerGroup.matches(TBaseConstants.META_TMP_GROUP_VALUE)) {
thrownew IllegalArgumentException(new StringBuilder(512)
.append("Illegal parameter: the value of consumerGroup")
.append(" must begin with a letter, ")
.append("can only contain characters,numbers,hyphen,and underscores").toString());
}
}
1. Fix typo
validConsumerGroupParmeter -> validConsumerGroupParameter
pushIsListenerWaitTimeoutRollBack -> pushListenerWaitTimeoutRollBack
pushIsListenerThrowedRollBack -> pushListenerThrowedRollBack
2. Use IllegalArgumentException
In ConsumerConfig#validConsumerGroupParameter
will change to throw IllegalArgumentException
JIRA link - [INLONG-96] created by technoboy