forked from apache/shenyu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apache#264 from 241600489/master
hystrix 插件新增支持线程池模式
- Loading branch information
Showing
16 changed files
with
412 additions
and
54 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
8 changes: 4 additions & 4 deletions
8
.../main/resources/static/index.342da2e4.css → .../main/resources/static/index.65957209.css
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
23 changes: 23 additions & 0 deletions
23
soul-common/src/main/java/org/dromara/soul/common/dto/convert/HystrixThreadPoolConfig.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,23 @@ | ||
package org.dromara.soul.common.dto.convert; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.dromara.soul.common.constant.Constants; | ||
|
||
/** | ||
* hystrix thread pool config. | ||
* @author liangziqiang | ||
*/ | ||
@Getter | ||
@Setter | ||
@EqualsAndHashCode | ||
public class HystrixThreadPoolConfig { | ||
private int coreSize = Constants.HYSTRIX_THREAD_POOL_CORE_SIZE; | ||
|
||
private int maximumSize = Constants.HYSTRIX_THREAD_POOL_MAX_SIZE; | ||
|
||
private int keepAliveTimeMinutes = Constants.HYSTRIX_THREAD_KEEP_ALIVE_TIME_MINUTE; | ||
|
||
private int maxQueueSize = Constants.HYSTRIX_THREAD_POOL_QUEUE_SIZE; | ||
} |
26 changes: 26 additions & 0 deletions
26
soul-common/src/main/java/org/dromara/soul/common/enums/HystrixIsolationModeEnum.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,26 @@ | ||
package org.dromara.soul.common.enums; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
/** | ||
* hystrix execution isolation strategy. | ||
* | ||
* @author liangziqiang | ||
*/ | ||
@RequiredArgsConstructor | ||
@Getter | ||
public enum HystrixIsolationModeEnum { | ||
/** | ||
* thread pool mode. | ||
*/ | ||
@SuppressWarnings("checkstyle:WhitespaceAfter") THREAD_POOL(0, "thread"), | ||
/** | ||
* semaphore mode. | ||
*/ | ||
@SuppressWarnings("checkstyle:WhitespaceAfter") SEMAPHORE(1, "semaphore"); | ||
|
||
private final int code; | ||
|
||
private final String name; | ||
} |
25 changes: 25 additions & 0 deletions
25
soul-plugin/soul-plugin-base/src/main/java/org/dromara/soul/plugin/base/utils/UriUtils.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,25 @@ | ||
package org.dromara.soul.plugin.base.utils; | ||
|
||
import java.net.URI; | ||
import org.apache.commons.lang3.StringUtils; | ||
|
||
/** | ||
* uri util. | ||
* @author liangziqiang | ||
*/ | ||
public class UriUtils { | ||
|
||
|
||
/** | ||
* create URI {@link URI}. | ||
* @param uri uri string eg:/fallback | ||
* @return created {@link URI} from uri | ||
*/ | ||
public static URI createUri(final String uri) { | ||
if (StringUtils.isNotBlank(uri)) { | ||
return URI.create(uri); | ||
} | ||
return null; | ||
} | ||
|
||
} |
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
Oops, something went wrong.