Fix tools/call routing and dependency injection for MSA architecture
This commit is contained in:
4
axhub-gateway/Dockerfile
Normal file
4
axhub-gateway/Dockerfile
Normal 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"]
|
||||
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user