Spring / Spring Integration
1. Explain DelegatingVariableResolver in Spring framework.
Spring provides a custom JavaServer Faces VariableResolver implementation, known as DelegatingVariableResolver, extends the standard Java Server Faces managed beans mechanism which enables using JSF and Spring together.
2. How to integrate Java Server Faces (JSF) with Spring?
JSF and Spring do share some of the same features, most noticeably in the area of IOC services. By declaring JSF managed-beans in the faces-config.xml configuration file, we may allow the FacesServlet to instantiate that bean at startup. Your JSF pages have access to these beans and all of their ...
3. What is the significance of JSF and Spring integration?
Spring and JSF integration is useful when an event handler have to explicitly invoke the bean factory to create beans on demand, such as a bean that encapsulates the business logic to be performed when a submit button is pressed or based on any other UI events.
4. What is @EnableIntegration annotation?
@EnableIntegration annotation allows the registration of Spring Integration infrastructure beans.
5. Spring 3.0: How do I schedule Tasks?
Spring 3.0 introduced TaskScheduler for scheduling jobs by enabling Api support for support for Timer (Jdk) and Quartz. TaskScheduler defines the below API. ScheduledFuture scheduleAtFixedRate(Runnable task, long period); ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay); Scheduli...
6. What is a Message channel in Spring integration?
A Message Channel represents the "pipe" of a pipes-and-filters architecture. Producers send Messages to a channel, and consumers receive Messages from a channel. The Message Channel, therefore, decouples the messaging components and also provides a convenient point for interception and monitoring...
7. Explain Message in Spring integration.
Message is a generic wrapper for any Java object combined with metadata used by the framework while handling that object. It consists of a payload and headers . The payload can be of any type and the headers hold commonly required information such as id, timestamp, correlation id, and return addr...
8. What is a Message Endpoint?
The Endpoints primary role is to connect the application code to the messaging framework and to do so in a non-invasive manner.
9. Advantages of using Spring Integration.
Spring integration achieve the following goals. provides a simple model for implementing complex enterprise integration solutions. facilitates asynchronous, message-driven behavior within a spring application. promotes intuitive, incremental adoption for existing Spring users.
10. Different Message Endpoints.
Transformer is responsible for converting a MessageÂs content or structure and returning the modified Message. One common type of transformer is one that converts the payload of the Message from one format to another (for example, from XML to JSON). A Message Filter determines whether a Message ...
11. Different classification of Message Channels.
Broadly there are 2 classifications. Pollable channel, point-to-point channel (only one receiver of a message in the channel), requires a quieue to hold the message and queue will have designated capacity, buffer its messsage. and Subscribable channel. does not buffer messages, allows multiple su...
12. Explain Pipe and Filter architectural design pattern.
Pipe and Filter pattern use components and connectors in which components, also called filters , apply local transformations to their input streams and often do their computing incrementally so that output begins before all input are consumed; Connectors, also called pipes , serve as conduits for...
13. Mention a few alternatives to Spring security.
Apache Shiro and Apache Camel.
14. How does error handling work in synchronous communication?
In synchronous communication, the sender blocks while the message is sent to the messaging system using the same thread. If an exception is raised, it is thrown reaching the application.
15. How does Spring Integration handle error/exceptions in asynchronous communication?
In asynchronous communication, Spring Integration handles exceptions by publishing them to message channels. If an exception is raised, it will not reach the application. Error channel handles this by wrapping the exception thrown into a MessagingException, and becomes the payload of a new message.