O'Reilly logo

Mastering Spring Application Development by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring the outbound HTTP messages

Spring provides HttpRequestExecutingMessageHandler, which takes a string URL as a constructor argument. The class has a property called ReponseChannel, which also needs to be configured.

The bean will call the RestTemplate class by reading the URL configured in the constructor, which the RestTemplate calls HttpMessageConverters. The list of HttpMessageConverters are read and the HttpRequest body is generated.

The converter and HttpRequestExecutingMessageHandler are shown in the following code:

<bean id="httpOutbound" class="org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler"> <constructor-arg value="http://localhost:8080/myweb" /> <property name="outputChannel" ref="responseChannel" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required