This set of Java Spring Multiple Choice Questions & Answers (MCQs) focuses on “Splitters and Aggregators,Routing”.
1. To fork the process flow from one component to many, either all at once or to a single one based on a predicate condition.
a) splitter
b) fork
c) all of the mentioned
d) none of the mentioned
View Answer
Explanation: You can use a splitter component (and maybe its cohort, the aggregator component) to fork and join (respectively) control of processing.
2. A splitter takes an input message and asks you, the user of the component, on what basis it should split the Message 3. Spring Integration ships with useful splitters that require no customization. 4. Return type of the method annotated by the @Splitter annotation is of type:- 5. Annotation which collects a series of messages (based on some correlation that you help Spring Integration make between the messages). 6. To determine how many messages to read until it can stop:- 7. For correlation when you might not have a size but know that you’re expecting messages that share a common header value within a known time, Spring Integration provides the HeaderAttributeCorrelationStrategy. 8. The only custom logic is a POJO with an @Aggregator annotation on a method expecting a collection of Message 9. You want to conditionally move a message through different processes based on some criteria. 10. There are some convenient default routers available to fill common needs:- 11. To receive messages from an external system and process them using Spring Integration. 12. Adapters are opaque in nature. 13. Sometimes, functionality is made available from within the application via:- 14. You use Spring Integration’s inbound-channel-adapter element to wire the TwitterMessageSource and a poller element. 15. The API surfaces a Paging object, which works something like Criteria in Hibernate. Sanfoundry Global Education & Learning Series – Java Spring.
a) True
b) False
View Answer
Explanation: You’re responsible for providing the split functionality.
a) Splitter
b) XPathMessageSplitter
c) All of the mentioned
d) None of the mentioned
View Answer
Explanation: In a few cases, Spring Integration ships with useful splitters that require no customization. One example is the splitter provided to partition an XML payload along an XPath query, XPathMessageSplitter.
a) java.util.Collection
b) java.util.Date
c) all of the mentioned
d) none of the mentioned
View Answer
Explanation: The configuration for this is not terribly different from the previous solutions. The Java code is just about the same as well, except that the return type of the method annotated by the @Splitter annotation is of type java.util.Collection.
a) @After
b) @Splitter
c) @Aggregator
d) None of the mentioned
View Answer
Explanation: An @Aggregator collects a series of messages (based on some correlation that you help Spring Integration make between the messages) and publishes a single message to the components downstream.
a) SequenceSizeCompletionStrategy
b) SequenceSizeCompletion
c) SequenceSize
d) None of the mentioned
View Answer
Explanation: There are many ways for Spring Integration to correlate incoming messages. To determine how many messages to read until it can stop, it uses the class SequenceSizeCompletionStrategy, which reads a well known header value (aggregators are often used after a splitter.
a) True
b) False
View Answer
Explanation: In this way, it knows that all messages with that value are from the same group, in the same way that your last name identifies you as being part of a larger group.
a) True
b) False
View Answer
Explanation: It could, of course, be a collection of Customer objects, because they are what you’re expecting as output from the previous splitter.
a) router component
b) EAI
c) all of the mentioned
d) none of the mentioned
View Answer
Explanation: You can use a router component to alter the processing flow based on some predicate. You can also use a router to multicast a message to many subscribers (as you did with the splitter).
a) PayloadTypeRouter
b) PayloadType
c) Payload
d) None of the mentioned
View Answer
Explanation: There are some convenient default routers available to fill common needs, such as payload-type–based routing (PayloadTypeRouter) and routing to a group or list of channels (RecipientListRouter).
a) channel
b) channel adapter
c) EJP
d) none of the mentioned
View Answer
Explanation: Spring Integration makes it trivially easy to build one.
a) True
b) False
View Answer
Explanation: Your external system interfaces with the adapter.
a) Stable API
b) Cohesive API
c) All of the mentioned
d) None of the mentioned
View Answer
Explanation: Sometimes, functionality is made available from within the application via a cohesive, stable API but in a component model or form that isn’t directly accessible to the bus.
a) True
b) False
View Answer
Explanation: The poller element is configured to run every 10 seconds and to consume as many as 100 messages each time it runs.
a) True
b) False
View Answer
Explanation: You can configure how many results to return using the count property. The most interesting option is called the sinceId, which lets you search for all records occurring after the Status having the ID equal to the value given as the sinceId.
To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.