Spring Questions and Answers – Integration of Systems

This set of Java Spring Multiple Choice Questions & Answers (MCQs) focuses on “Integration of Systems”.

1. Integration of Spring which has each application produce files of shared data for others to consume.
a) File transfer
b) Shared Database
c) Remote Procedure Invocation
d) Messaging
View Answer

Answer: a
Explanation: File transfer: Have each application produce files of shared data for others to consume and consume files that others have produced.

2. Integration of Spring which has the applications store the data they want to share in a common database.
a) File transfer
b) Shared Database
c) Remote Procedure Invocation
d) Messaging
View Answer

Answer: b
Explanation: This usually takes the form of a database to which different applications have access.

3. Integration of Spring which has each application expose some of its procedures so that they can be invoked remotely and have applications invoke them to initiate behavior and exchange data.
a) File transfer
b) Shared Database
c) Remote Procedure Invocation
d) Messaging
View Answer

Answer: c
Explanation: There is specific support for optimizing RPC (remote procedure calls such as SOAP, RMI, and HTTP Invoker) exchanges using Spring Integration.
advertisement
advertisement

4. Integration of Spring which has each application connect to a common messaging system and exchange data and invoke behavior using messages.
a) File transfer
b) Shared Database
c) Remote Procedure Invocation
d) Messaging
View Answer

Answer: d
Explanation: This style, most enabled by JMS in the JEE world, also describes other asynchronous or multicast publish/subscribe architectures.

5. Using an ESB lets you hide the origin of the message from the code that’s handling it.
a) True
b) False
View Answer

Answer: a
Explanation: You’ll use this solution as an easy way to see how a Spring Integration solution can be built.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. As with a standard MDP, a configuration for the ConnectionFactory exists.
a) True
b) False
View Answer

Answer: a
Explanation: There’s also a lot of other schem as required for using the configuration elements available in Spring Integration.

7. The configuration starts with the inboundHelloJMSMessageChannel channel, which tells Spring Integration what to name the point-to-point connection from the message queue to the:-
a) service-activator
b) service
c) all of the mentioned
d) none of the mentioned
View Answer

Answer: a
Explanation: You typically define a new channel for every point-to-point connection.
advertisement

8. An adapter is a component that knows how to speak to a specific type of subsystem and translate messages on that subsystem into something that can be used in the Spring Integration bus only.
a) True
b) False
View Answer

Answer: a
Explanation: Adapters also do the same in reverse, taking messages on the Spring Integration bus and translating them into something a specific subsystem will understand.

9. A service-activator, however, only helps you invoke your application’s business logic on receipt of a message.
a) True
b) False
View Answer

Answer: a
Explanation: What you do in the business logic, connecting to another system or not, is up to you.
advertisement

10. The next component, a service-activator, listens for messages coming into that channel and invokes the bean referenced by the:-
a) ref
b) after
c) before
d) all of the mentioned
View Answer

Answer: a
Explanation: The next component, a service-activator, listens for messages coming into that channel and invokes the bean referenced by the ref attribute, which in this case is the bean defined previously: inboundHelloWorldJMSPingServiceActivator.

11. Headers Found in Spring Integration Messages:-
a) ID
b) TIMESTAMP
c) CORRELATION_ID
d) All of the mentioned
View Answer

Answer: d
Explanation: Constant ID This is a unique value assigned to the message by the Spring Integration engine.
TIMESTAMP Timestamp assigned to the message.
CORRELATION_ID This is optional. It is used by some components (such as aggregators) to group
messages together in some sort of processing pipeline.
REPLY_CHANNEL The String name of the channel to which the output of the current component
should be sent. This can be overridden.
ERROR_CHANNEL The String name of the channel to which the output of the current component
should be sent if an exception bubbles up into the runtime. This can be overridden.
EXPIRATION_DATE Used by some components as a threshold for processing after which a component
can wait no longer in processing.
SEQUENCE_NUMBER The order in which the message is to be sequenced; typically used with a sequencer.
SEQUENCE_SIZE
838
Description
The size of the sequence so that an aggregator can know when to stop waiting for
more messages and move forward. This is useful in implementing “join”
functionality.

12. Some header values are specific to the type of the source message payload.
a) True
b) False
View Answer

Answer: a
Explanation: Some header values are specific to the type of the source message payload; for example, payloads sourced from a file on the file system are different from those coming in from a JMS queue, which is different from messages coming from an email system.

13. Component-specific headers are the constants defined for files on:-
a) org.springframework.integration.file.FileHeaders: FILENAME
b) org.springframework.integration.file.FileHeaders: PREFIX
c) all of the mentioned
d) none of the mentioned
View Answer

Answer: c
Explanation: An example of component-specific headers are the constants defined for files on org.springframework.integration.file.FileHeaders: FILENAME and PREFIX.

14. Annotation to get access to header metadata:-
a) @Ref
b) @service
c) @Header
d) None of the mentioned
View Answer

Answer: c
Explanation: Another way to get access to header metadata is to simply have it passed as parameters to your component’s method. You simply annotate the parameter with the @Header annotation, and Spring Integration will take care of the rest.

15. The code for the service-activator has changed to reflect the fact that you’re expecting a message containing a message of type:-
a) Message<java.io.File>
b) Message<java.io>
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: a
Explanation: The code for the service-activator has changed to reflect the fact that you’re expecting a message containing a message of type Message<java.io.File>

Sanfoundry Global Education & Learning Series – Java Spring.
To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.