Example usage for org.springframework.integration.http.outbound HttpRequestExecutingMessageHandler setExpectedResponseType

List of usage examples for org.springframework.integration.http.outbound HttpRequestExecutingMessageHandler setExpectedResponseType

Introduction

In this page you can find the example usage for org.springframework.integration.http.outbound HttpRequestExecutingMessageHandler setExpectedResponseType.

Prototype

public void setExpectedResponseType(Class<?> expectedResponseType) 

Source Link

Document

Specify the expected response type for the REST request otherwise the default response type is ResponseEntity and will be returned as a payload of the reply Message.

Usage

From source file:com.acmemotors.batch.LoaderJobConfiguration.java

@Bean
@ServiceActivator(inputChannel = "requestChannel")
public HttpRequestExecutingMessageHandler messageHandler(@Value("${serverUrl}") String serverUrl) {
    HttpRequestExecutingMessageHandler handler = new HttpRequestExecutingMessageHandler(serverUrl);
    handler.setHttpMethod(HttpMethod.POST);
    handler.setExpectedResponseType(String.class);

    return handler;
}