Spring MCQ Quiz Hub

Spring Mcq Set 16

Choose a topic to test your knowledge and improve your Spring skills

1. The only custom logic is a POJO with an @Aggregator annotation on a method expecting a collection of Message objects.




2. You want to conditionally move a message through different processes based on some criteria.




3. There are some convenient default routers available to fill common needs:-




4. To receive messages from an external system and process them using Spring Integration.




5. Adapters are opaque in nature.




6. Sometimes, functionality is made available from within the application via:-




7. You use Spring Integration’s inbound-channel-adapter element to wire the TwitterMessageSource and a poller element.




8. The API surfaces a Paging object, which works something like Criteria in Hibernate.




9. To take an input file or a payload and reliably, and systematically, decompose it into events that an ESB can work with:-




10. Spring Integration does support reading files into the bus.




11. No processing system (such as an ESB) can deal with a million records at once efficiently.




12. Spring Batch reads the file, transforms the records into:-




13. The BPM engine would thread together the different actors and work lists,




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




15. Serving to abstract away the functionality of other components in an abbreviated interface to provide courser functionality.




16. The capability to hide messaging behind a POJO interface.




17. The most fundamental support for gateways comes from the Spring Integration class:-




18. The SimpleMessagingGateway needs a request and a response channel, and it coordinates the rest.




19. The first thing that the client configuration does is import a shared application context (to save typing if nothing else) that declares a JMS connection factor.




20. Messages sent on the requests channel are forwarded to the:-




21. The gateway element simply exists to identify the component and the interface.




22. There is no coupling between the client facing interface exposed via the gateway component and the interface of the service that ultimately handles the messages.




23. The service-activator is what handles actual processing and there’s no mention of a response channel, for either the service-activator, or for the inbound JMS gateway.




24. Spring Batch provides a lot of flexibility and guarantees to your application, but it cannot work in a vacuum. To do its work:-




25. There’s only one really useful implementation of the JobRepository interface, which stores information about the state of the batch processes in a database.




26. To load the contents of a properties file (batch.properties) whose values you use to configure the data source.




27. MapJobRegistry instance. This is critical—it is the central store for information regarding a given Job.




28. SimpleJobLauncher, whose sole purpose is to give you a mechanism to launch batch jobs, where a “job” in this case is our batch solution.




29. Spring Batch models solutions using XML schema.




30. However, it’s important to wear another hat, that of a DBA, when writing applications.




31. Indeed, a step could be considered the smallest unit of work for a job. Input (what’s read) is passed to the Step and potentially processed; then output (what’s written) is created from the step.




32. Attribute to configure how many items will be processed before the transaction is committed all the input is sent to the writer.




33. Class which delegates the task of delimiting fields and records within a file to a LineMapper, which in turn delegates the task of identifying the fields within that record, to LineTokenizer.




34. The names and values for the named parameters are being created by the bean configured for the itemSqlParameterSourceProvider property, an instance of the interface




35. There’s support for writing JMS:-




36. The processor attribute on the chunk element expects a reference to a bean of the interface:-




37. Spring Batch provides a convenience class, CompositeItemProcessor, which forwards the output of the filter to the input of the successive filter.




38. If the preceding job was run on a batch with a 100 rows, each item was read and passed through the processor, and it found 10 items invalid (it returned null 10 times), the value for the filter_count column would be:-




39. Transaction capabilities are built on top of the first class support already provided by the core Spring framework.




40. Spring core framework provides first-class support for transactions.




41. The batch.xml file establishes a:-




42. Spring Batch will, by default, try to pluck the:-




43. Spring Batch excels in the robustness it surfaces as simple configuration options for the edge and failure cases.




44. Element to configure this for the step:-




45. You want to work with a resource that may fail when you try to read from or write to it.




46. Some invocations will fail but may be retried with some likelihood of success in a transactional scenario.




47. You can specify exception classes on which to retry the operation. <step id = "step23"> <tasklet transaction-manager="transactionManager"> <chunk reader="csvFileReader" writer="jdbcItemWriter" commit-interval="10" retry-limit="3" cache-capacity="10"> <retryable-exception-classes> <include class="org.springframework.dao.DeadlockLoserDataAccessException"/> </retryable-exception-classes> </chunk> </tasklet> </step>




48. You can leverage Spring Batch support for retries and recovery in your own code.




49. The template that (much like its various other Template cousins) isolates your logic from the nuances of retries and instead enables you to write the code as though you were only going to attempt it once.




50. The RetryTemplate supports many use cases, with convenient APIs to wrap.