spring integration tutorial (part 8) - gateways

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

Upload: intertech-training

Post on 12-Dec-2014

234 views

Category:

Technology


2 download

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

  • 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.