Java Spring Multiple Choice Questions & Answers (MCQs) on “Spring Batch and Gateways”.
1. To take an input file or a payload and reliably, and systematically, decompose it into events that an ESB can work with:-
a) Splitter
b) Spring Batch
c) All of the mentioned
d) None of the mentioned
Answer: b
Clarification: You have a file with a million records in it. This file’s too big to handle as one event; it’s far more natural to react to each row as an event. Spring Batch works very well with these types of solutions. It allows you to take an input file or a payload and reliably, and systematically, decompose it into events that an ESB can work with.
2. Spring Integration does support reading files into the bus.
a) True
b) False
Answer: a
Clarification: Spring Batch does support providing custom, unique endpoints for data.
3. No processing system (such as an ESB) can deal with a million records at once efficiently.
a) True
b) False
Answer: a
Clarification: Strive to decompose bigger events and messages into smaller ones.
4. Spring Batch reads the file, transforms the records into:-
a) objects
b) outputs
c) all of the mentioned
d) none of the mentioned
Answer: a
Clarification: Spring Batch reads the file, transforms the records into objects, and writes the output to a JMS topic with a key correlating the original batch to the JMS message.
5. The BPM engine would thread together the different actors and work lists,
a) True
b) False
Answer: a
Clarification: The BPM engine would thread together the different actors and work lists, allow work to continue over the course of days instead of the small millisecond timeframes Spring Integration is more geared to.
6. You want to expose an interface to clients of your service, without betraying the fact that your service is implemented in terms of messaging middleware.
a) Enterprise Integration Patterns
b) Gateway
c) All of the mentioned
d) None of the mentioned
Answer: c
Clarification: Use a gateway—a pattern from the classic book Enterprise Integration Patterns by Gregor Hohpe and Bobby Woolf (Addison-Wesley, 2004) that enjoys rich support in Spring Integration.
7. Serving to abstract away the functionality of other components in an abbreviated interface to provide courser functionality.
a) facade
b) façade
c) gateway
d) none of the mentioned
Answer: b
Clarification: You might use a façade to build an interface oriented around vacation planning that in turn abstracts away the minutiae of using a car rental, hotel reservation, and airline reservation system.
8. The capability to hide messaging behind a POJO interface.
a) Lingo
b) JCA
c) JMS
d) All of the mentioned
Answer: d
Clarification: Lingo, a project from Codehaus.org that is no longer under active development, had such a feature that was specific to JMS and the Java EE Connector Architecture (JCA –it was originally used to talk about the Java Cryptography Architecture, but is more commonly used for The Java EE Connector Architecture now).
9. The most fundamental support for gateways comes from the Spring Integration class:-
a) SimpleMessagingGateway
b) SimpleMessaging
c) SimpleGateway
d) None of the mentioned
