mirror of https://github.com/longtai-cn/hippo4j
parent
da0c9318c9
commit
60daa594e3
@ -0,0 +1,70 @@
|
||||
package io.dynamic.threadpool.starter.http;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Http Agent.
|
||||
*
|
||||
* @author chen.ma
|
||||
* @date 2021/6/23 20:45
|
||||
*/
|
||||
public interface HttpAgent {
|
||||
|
||||
/**
|
||||
* 开始获取 NacosIp 集合
|
||||
*/
|
||||
void start();
|
||||
|
||||
/**
|
||||
* 获取命名空间
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getNameSpace();
|
||||
|
||||
/**
|
||||
* 获取编码集
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getEncode();
|
||||
|
||||
/**
|
||||
* 发起 Http Get 请求
|
||||
*
|
||||
* @param path
|
||||
* @param headers
|
||||
* @param paramValues
|
||||
* @param encoding
|
||||
* @param readTimeoutMs
|
||||
* @return
|
||||
*/
|
||||
String httpGet(String path, Map<String, String> headers, Map<String, String> paramValues,
|
||||
String encoding, long readTimeoutMs);
|
||||
|
||||
/**
|
||||
* 发起 Http Post 请求
|
||||
*
|
||||
* @param path
|
||||
* @param headers
|
||||
* @param paramValues
|
||||
* @param encoding
|
||||
* @param readTimeoutMs
|
||||
* @return
|
||||
*/
|
||||
String httpPost(String path, Map<String, String> headers, Map<String, String> paramValues,
|
||||
String encoding, long readTimeoutMs);
|
||||
|
||||
/**
|
||||
* 发起 Http Delete 请求
|
||||
*
|
||||
* @param path
|
||||
* @param headers
|
||||
* @param paramValues
|
||||
* @param encoding
|
||||
* @param readTimeoutMs
|
||||
* @return
|
||||
*/
|
||||
String httpDelete(String path, Map<String, String> headers, Map<String, String> paramValues,
|
||||
String encoding, long readTimeoutMs);
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package io.dynamic.threadpool.starter.http;
|
||||
|
||||
import io.dynamic.threadpool.starter.config.DynamicThreadPoolProperties;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Server Http Agent.
|
||||
*
|
||||
* @author chen.ma
|
||||
* @date 2021/6/23 20:50
|
||||
*/
|
||||
public class ServerHttpAgent implements HttpAgent {
|
||||
|
||||
private final DynamicThreadPoolProperties dynamicThreadPoolProperties;
|
||||
|
||||
public ServerHttpAgent(DynamicThreadPoolProperties properties) {
|
||||
this.dynamicThreadPoolProperties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String httpGet(String path, Map<String, String> headers, Map<String, String> paramValues, String encoding, long readTimeoutMs) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String httpPost(String path, Map<String, String> headers, Map<String, String> paramValues, String encoding, long readTimeoutMs) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String httpDelete(String path, Map<String, String> headers, Map<String, String> paramValues, String encoding, long readTimeoutMs) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameSpace() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncode() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package io.dynamic.threadpool.starter.http;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Server List Manager.
|
||||
*
|
||||
* @author chen.ma
|
||||
* @date 2021/6/23 20:42
|
||||
*/
|
||||
@Slf4j
|
||||
public class ServerListManager {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"name": "spring.dynamic.thread-pool.server-addr",
|
||||
"type": "java.lang.String",
|
||||
"defaultValue": "localhost:6691",
|
||||
"description": "dynamic thread-pool server address."
|
||||
},
|
||||
{
|
||||
"name": "spring.dynamic.thread-pool.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"defaultValue": false,
|
||||
"description": "dynamic thread-pool enabled."
|
||||
},
|
||||
{
|
||||
"name": "spring.dynamic.thread-pool.namespace",
|
||||
"type": "java.lang.String",
|
||||
"defaultValue": "public",
|
||||
"description": "dynamic thread-pool namespace."
|
||||
},
|
||||
{
|
||||
"name": "spring.dynamic.thread-pool.item-id",
|
||||
"type": "java.lang.String",
|
||||
"description": "dynamic thread-pool item-id."
|
||||
}
|
||||
]
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
spring:
|
||||
threadpool:
|
||||
dynamic:
|
||||
namespace: common
|
||||
itemId: message-center
|
||||
dynamic:
|
||||
thread-pool:
|
||||
enabled: true
|
||||
server-addr: localhost:6691
|
||||
namespace: public
|
||||
item-id: message-center
|
Loading…
Reference in new issue