Fix tools/call routing and dependency injection for MSA architecture

This commit is contained in:
jade
2026-07-05 18:01:39 +09:00
parent 10f3f0513d
commit 4c718d38f1
22 changed files with 399 additions and 18 deletions

4
axhub-gateway/Dockerfile Normal file
View File

@@ -0,0 +1,4 @@
FROM eclipse-temurin:21-jdk-alpine
WORKDIR /app
COPY build/libs/axhub-gateway-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]

View File

@@ -4,7 +4,8 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
@SpringBootApplication
@SpringBootApplication(scanBasePackages = {"io.shinhanlife.axhub.biz.mcp.gateway", "io.shinhanlife.axhub.common.mcp", "io.shinhanlife.axhub.common.config"})
@org.springframework.boot.context.properties.ConfigurationPropertiesScan(basePackages = {"io.shinhanlife.axhub.biz.mcp.gateway", "io.shinhanlife.axhub.common.mcp", "io.shinhanlife.axhub.common.config"})
@EnableCaching
public class AxHubGatewayApplication {
public static void main(String[] args) {

View File

@@ -47,7 +47,13 @@ public class ExecuteService {
// Forward the request to the target tool pod
try {
ResponseEntity<Object> response = restTemplate.postForEntity(executeApiUrl, payload, Object.class);
org.springframework.http.HttpHeaders headers = new org.springframework.http.HttpHeaders();
headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON);
headers.set("X-API-KEY", "SHINHAN_MCP_TEST_KEY_9999"); // TODO: Use actual tenant's key
headers.set("X-Trace-Id", java.util.UUID.randomUUID().toString());
org.springframework.http.HttpEntity<Map<String, Object>> entity = new org.springframework.http.HttpEntity<>(payload, headers);
ResponseEntity<Object> response = restTemplate.postForEntity(executeApiUrl, entity, Object.class);
return response.getBody();
} catch (Exception e) {
log.error(" [ExecuteService] Tool Pod 호출 실패: {}", e.getMessage());