Spring MCQ Quiz Hub

Spring Mcq Set 16

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

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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





✅ Correct Answer: 2

Adapters are opaque in nature.





✅ Correct Answer: 1

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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





✅ Correct Answer: 2

Spring Integration does support reading files into the bus.





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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.





✅ Correct Answer: 3

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





✅ Correct Answer: 2

The capability to hide messaging behind a POJO interface.





✅ Correct Answer: 4

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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.





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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.





✅ Correct Answer: 1

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.





✅ Correct Answer: 1

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

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





✅ Correct Answer: 2

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





✅ Correct Answer: 1

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





✅ Correct Answer: 1

Spring Batch models solutions using XML schema.





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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.





✅ Correct Answer: 2

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





✅ Correct Answer: 3

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.





✅ Correct Answer: 1

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





✅ Correct Answer: 1

There’s support for writing JMS:-





✅ Correct Answer: 4

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

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:-





✅ Correct Answer: 3

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





✅ Correct Answer: 1

Spring core framework provides first-class support for transactions.





✅ Correct Answer: 2

The batch.xml file establishes a:-





✅ Correct Answer: 3

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

Element to configure this for the step:-





✅ Correct Answer: 1

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

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>





✅ Correct Answer: 1

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





✅ Correct Answer: 1

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.





✅ Correct Answer: 2

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





✅ Correct Answer: 1