【发布时间】:2015-11-24 17:22:47
【问题描述】:
我正在尝试使用 spring 集成的入站 http 网关。下面是我的配置。
<int:channel id="requestChannel" />
<int:channel id="responseChannel" />
<int-http:inbound-gateway id="inboundEmployeeSearchRequestGateway"
supported-methods="POST" request-channel="requestChannel"
reply-channel="responseChannel"
mapped-response-headers="Return-Status, Return-Status-Msg, HTTP_RESPONSE_HEADERS"
path="/services/{parama}/{paramb}/search"
reply-timeout="6000000000">
<int-http:header name="parama" expression="#pathVariables.parama" />
<int-http:header name="paramb" expression="#pathVariables.paramb" />
</int-http:inbound-gateway>
<int:service-activator id="activator"
input-channel="requestChannel" output-channel="responseChannel"
ref="execSearch" method="execute" requires-reply="true"
send-timeout="6000000000" />
我的服务激活码如下:
@Service
public class ExecutionService {
@Autowired
private AppDao appDao;
public SQLResponse execute(Message<?> msg) throws Exception {
SQLResponse response = new SQLResponse();
Map<String,String> map = new HashMap<>();
map.put("name","test");
response.setResult(map);
return response;
}
}
但是我的响应越来越多,只有当我使用 POST 使用服务时才会发生这种情况,而 GET 功能非常好。请帮忙
【问题讨论】:
标签: json spring-boot spring-integration