Java Reference
In-Depth Information
xmlns:context="
http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
➥
➥
<beans:import resource="solution041.xml" />
<context:annotation-config />
<channel id="requests" />
<channel id="responses" />
<jms:outbound-gateway
request-destination-name="inboundHotelReservationSearchDestination"
request-channel="requests"
reply-destination-name="outboundHotelReservationSearchResultsDestination"
reply-channel="responses"
connection-factory="connectionFactory" />
<gateway id="vacationService"
service-interface="com.apress.springenterpriserecipes.
➥
springintegration.myholiday.VacationService" />
</beans:beans>
One thing that's conspicuously absent is any mention of an output or input channel from and to the
gateway
element
. While it is possible to declare default request/reply message queues, realistically, most
methods on an interface will require their own request/response queues. So, you configure the channels
on the interface itself.
package com.apress.springenterpriserecipes.springintegration.myholiday;
import java.util.List;
import org.springframework.integration.annotation.Gateway;
public interface VacationService {
@Gateway(requestChannel = "requests", replyChannel = "responses")
List<HotelReservation> findHotels(HotelReservationSearch hotelReservationSearch);
}
Search WWH ::
Custom Search