Spring Integration Tutorial (Part 8) - Gateways

8
Copyright © 2014 by Intertech, Inc. Express Spring Integration Gateways

description

In this final post on my tutorial series on Spring Integration (SI), we take a look at gateways. Gateways are a means of loosely coupling other application components from the SI API or other messaging API. The gateway serves as a façade to a SI system.

Transcript of Spring Integration Tutorial (Part 8) - Gateways

  • 1. Copyright 2014 by Intertech, Inc.

2. Copyright 2014 by Intertech, Inc. 3. Copyright 2014 by Intertech, Inc. 4. Copyright 2014 by Intertech, Inc.public interface ShipService {Confirmation ship(Order order);} 5. ClassPathXmlApplicationContext context = newClassPathXmlApplicationContext("/META-INF/spring/si-components.xml");ShipService service = context.getBean("shipService", ShipService.class);Confirmation confirm = service.ship(myOrder);Copyright 2014 by Intertech, Inc. 6. Copyright 2014 by Intertech, Inc.public interface ShipService {Future ship(Order order);}ShipService service = context.getBean("shipService", ShipService.class);Future future = service.ship(myOrder);// other application work hereConfirmation confirm = future.get(5000, TimeUnit.SECONDS); 7. Copyright 2014 by Intertech, Inc. 8. Copyright 2014 by Intertech, Inc.