diff --git a/saturn-job-api/src/main/java/com/vip/saturn/job/SaturnJobReturn.java b/saturn-job-api/src/main/java/com/vip/saturn/job/SaturnJobReturn.java index dc8ae517..19d8f271 100644 --- a/saturn-job-api/src/main/java/com/vip/saturn/job/SaturnJobReturn.java +++ b/saturn-job-api/src/main/java/com/vip/saturn/job/SaturnJobReturn.java @@ -199,6 +199,10 @@ public void reconsumeLater(SaturnDelayedLevel delayLevel) { prop.put(SaturnJobReturn.DELAY_LEVEL_WHEN_RECONSUME_PROP_KEY, String.valueOf(delayLevel.getValue())); } + public void setDelayLevel(SaturnDelayedLevel delayLevel) { + prop.put(SaturnJobReturn.DELAY_LEVEL_WHEN_RECONSUME_PROP_KEY, String.valueOf(delayLevel.getValue())); + } + /** * only use for single consume */ @@ -247,19 +251,8 @@ public List getCompleteOffsets() { * only use for batch consume */ public void reconsumeSome(List msgHolders) { - reconsumeSome(msgHolders, null); - } - - /** - * only use for batch consume - */ - public void reconsumeSome(List msgHolders, SaturnDelayedLevel delayLevel) { String finalOffsets = mergeOffsets(prop.get(MSG_BATCH_CONSUME_DELAY_OFFSETS), msgHolders); prop.put(MSG_BATCH_CONSUME_DELAY_OFFSETS, finalOffsets); - if (delayLevel != null) { - prop.put(SaturnJobReturn.DELAY_LEVEL_WHEN_RECONSUME_PROP_KEY, String.valueOf(delayLevel.getValue())); - } - } /** @@ -407,6 +400,11 @@ public SaturnJobReturnBuilder errorGroup(int errorGroup) { return this; } + public SaturnJobReturnBuilder deleyLevel(SaturnDelayedLevel delayedLevel) { + saturnJobReturn.setDelayLevel(delayedLevel); + return this; + } + /** * only use for single consume */ @@ -463,14 +461,6 @@ public SaturnJobReturnBuilder reconsumeSome(List msgHolders) { return this; } - /** - * only use for batch consume - */ - public SaturnJobReturnBuilder reconsumeSome(List msgHolders, SaturnDelayedLevel delayLevel) { - saturnJobReturn.reconsumeSome(msgHolders, delayLevel); - return this; - } - /** * only use for batch consume */