0
int-http:outbound-channel-adapter
내 휴식 서비스를 호출하고 싶지만, 불행히도 내 pojo를 json으로 변환하고 싶지 않습니다.스프링 통합 : int-http : json을 사용한 아웃 바운드 채널 어댑터
내 구성 :
<int-http:outbound-channel-adapter
channel="ticketOutgoingChannel"
http-method="PUT"
url="http://localhost:8080/process/ticket"
expected-response-type="*.model.Ticket"
message-converters="converters"
/>
<util:list id="converters">
<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter" />
<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
</util:list>
스택 트레이스 :
Caused by: org.springframework.web.client.RestClientException: Could not write request: no suitable HttpMessageConverter found for request type [*.model.Ticket] and content type [application/x-java-serialized-object]
at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:810)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:594)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:572)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:493)
at org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler.handleRequestMessage(HttpRequestExecutingMessageHandler.java:382)
... 34 more
답장을 보내 주셔서 감사합니다. 나는 응답을 기대하지 않기 때문에''를 선택했다. ' '를 어떻게 사용해야하는지 조금 설명해 주시겠습니까? 작은 예제가 좋을 수도 있습니다. pojo를 통합 컨텍스트에 보내는 것은' '를 사용합니다. 그래서 헤더가 x-java-serialized-object로 설정되어 있다고 생각합니다. –
내 실수 - 아무것도 제공되지 않는 경우 기본 'contentType'입니다. 내 편집을 참조하십시오. ''나는 응답을 기대하지 않는다'- 그 경우에, 당신은''예상 응답 유형''을 필요로하지 않는다. 그것이 나를 던진 것이다. –
신난다. 고마워 .Btw. 메시지 변환기는 더 이상 필요하지 않습니다. –