-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ice): Support listen TTR retry count with
@IceTtrListener
.
- Loading branch information
Showing
5 changed files
with
115 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Milkomeda/src/main/java/com/github/yizzuide/milkomeda/ice/IceTtrListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.yizzuide.milkomeda.ice; | ||
|
||
import org.springframework.core.annotation.AliasFor; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* IceTtrListener | ||
* TTR重试监听器,方法参数类型固定为 {@link TtrJob} | ||
* | ||
* @author yizzuide | ||
* @since 3.2.0 | ||
* Create at 2020/04/26 10:37 | ||
*/ | ||
@Documented | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD}) | ||
public @interface IceTtrListener { | ||
/** | ||
* 监听的Topic | ||
* | ||
* @return topic name | ||
*/ | ||
@AliasFor("topic") | ||
String value() default ""; | ||
|
||
/** | ||
* 监听的Topic | ||
* | ||
* @return topic name | ||
*/ | ||
@AliasFor("value") | ||
String topic() default ""; | ||
} |
29 changes: 29 additions & 0 deletions
29
Milkomeda/src/main/java/com/github/yizzuide/milkomeda/ice/TtrJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.github.yizzuide.milkomeda.ice; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* TtrJob | ||
* 重试任务信息 | ||
* | ||
* @author yizzuide | ||
* @since 3.2.0 | ||
* Create at 2020/04/26 10:52 | ||
*/ | ||
@Data | ||
public class TtrJob<T> { | ||
/** | ||
* 是否重试超载 | ||
*/ | ||
private boolean isOverload; | ||
|
||
/** | ||
* 当前重试次数 | ||
*/ | ||
private int retryCount; | ||
|
||
/** | ||
* 任务 | ||
*/ | ||
private Job<T> job; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters