|
@ -17,6 +17,7 @@ import com.epmet.utils.ServerHttpRequestUtils; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.slf4j.MDC; |
|
|
import org.springframework.cloud.gateway.filter.GatewayFilter; |
|
|
import org.springframework.cloud.gateway.filter.GatewayFilter; |
|
|
import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
|
|
import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
|
|
import org.springframework.core.io.buffer.DataBuffer; |
|
|
import org.springframework.core.io.buffer.DataBuffer; |
|
@ -94,7 +95,10 @@ public class EpmetGatewayFilter implements GatewayFilter { |
|
|
// 设置当前线程名
|
|
|
// 设置当前线程名
|
|
|
request.mutate().header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{tranSerial}); |
|
|
request.mutate().header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{tranSerial}); |
|
|
} |
|
|
} |
|
|
Thread.currentThread().setName(tranSerial); |
|
|
|
|
|
|
|
|
// Thread.currentThread().setName(tranSerial);
|
|
|
|
|
|
// 设置mdc
|
|
|
|
|
|
MDC.put(AppClientConstant.TRANSACTION_SERIAL_KEY, tranSerial); |
|
|
|
|
|
|
|
|
//1.打印请求信息
|
|
|
//1.打印请求信息
|
|
|
logRequest(request); |
|
|
logRequest(request); |
|
|