서킷 브레이커 SMS 추가

This commit is contained in:
yunjy-hp
2025-12-18 17:28:18 +09:00
parent e368815d69
commit 445117c4fb
@@ -5,12 +5,14 @@ import java.util.Properties;
import com.eactive.eai.common.TransactionContextKeys;
import com.eactive.eai.common.circuitBreaker.CircuitBreakerManager;
import com.eactive.eai.common.util.SMSLogUtil;
import com.eactive.eai.message.StandardMessage;
import com.eactive.eai.util.PropertiesUtil;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.initech.core.util.PropertiesManager;
import io.github.resilience4j.circuitbreaker.CallNotPermittedException;
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
import org.apache.commons.lang3.StringUtils;
@@ -105,7 +107,12 @@ public class RESTProcess extends HTTPProcess {
combinedNode.set("metrics", objectMapper.valueToTree(circuitBreaker.getMetrics()));
logger.info("CircuitBreaker state "+combinedNode.toString());
this.resObject = circuitBreaker.executeCallable(() -> HttpSender.callService(this.adapterGroupName, this.outboundProp, this.reqObject, this.tempProp));
try {
this.resObject = circuitBreaker.executeCallable(() -> HttpSender.callService(this.adapterGroupName, this.outboundProp, this.reqObject, this.tempProp));
}catch(CallNotPermittedException callNotPermittedException){
SMSLogUtil.loggingSMS(reqEaiMsg.getEAISvcCd(), "CIRCUIT_IS_OPEN!");
throw callNotPermittedException;
}
}else{
this.resObject = HttpSender.callService(this.adapterGroupName, this.outboundProp, this.reqObject, this.tempProp);
}