Question
import org.apache.log4j.Logger;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageHeaders;
import org.springframework.integration.message.MessageBuilder;
public class ServiceActivatorThatSpecifiesErrorChannel {
private static final Logger logger = Logger.getLogger(
ServiceActivatorThatSpecifiesErrorChannel.class);
@ServiceActivator
public Message<?> startIntegrationFlow(Message<?> firstMessage)
throws Throwable {
return MessageBuilder.fromMessage(firstMessage).
setHeaderIfAbsent( MessageHeaders.ERROR_CHANNEL,
"errorChannelForMySolution").build();
}
}
a.
customErrorChannel
b.
customError
c.
errorChannel
d.
none of the mentioned
Posted under Java Spring Framework
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. All errors that come from the integration in which this component is used will be directed to
Similar Questions
Discover Related MCQs
Q. Spring Integration will use that header and forward errors encountered in the processing of this message to that channel.
View solution
Q. You can explicitly specify on what channel errors for a given integration should go.
View solution
Q. Sending all the errors to the same channel can eventually lead to a large switch-laden class that’s too complex to maintain.
View solution
Q. One way to discriminate by Exception type is to use
View solution
Q. All errors thrown from Spring Integration components will be a subclass of
View solution
Q. The errorChannel doesn’t need to be a service-activator.
View solution
Q. Spring Integration provides the ability to catch exceptions and send them to an error channel of your choosing. By default, it’s a global channel called
View solution
Q. Spring Integration provides a transformer message endpoint to permit the augmentation of the message headers.
View solution
Q. To send a message into the bus and transform it before working with it further.
View solution
Q. To parameterize a job, which is then available to your steps through Spring Batch expression language.
View solution
Q. The bean is recognized and becomes part of the application context because of the:-
View solution
Q. More complicated return codes can be returned by creating and declaring a top-level bean that implements the interface:-
View solution
Q. The CommandLineJobRunner for success will return system error codes:-
View solution
Q. TaskExecutor that will spawn a thread of execution and manage that thread without blocking.
View solution
Q. JobLauncher reference you configured previously is obtained and used to then launch an instance of a Job.
View solution
Q. Spring Batch work with a system scheduler:-
View solution
Q. If you want to vary the execution flow based on some logic more complex than a job’s ExitStatuses:-
View solution
Q. To determine the next step is the simplest example of a conditional flow.
View solution
Q. Spring Batch ships with only handler, which executes steps in multiple threads using a TaskExecutor strategy.
View solution
Q. Pattern which refers to the arrangement of multiple JMS clients all consuming the same queue messages.
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Java Spring Framework? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!