R4RIN
MCQS
Spring MCQ Quiz Hub
Spring Mcq Set 15
Choose a topic to test your knowledge and improve your Spring skills
1. JMS sender and receiver classes can also extend to retrieve a JMS template:-
JmsGatewaySupport
JmsGateway
All of the mentioned
None of the mentioned
2. When you need access to the JMS template.
setJmsTemplate
getJmsTemplate
getJms
none of the mentioned
3. Spring provides an implementation of SimpleMessageConvertor to handle the translation of a JMS message received.
True
False
none
None of the mentioned
4. y default, the JMS template uses SimpleMessageConverter for converting TextMessage to or from a string.
True
False
none
all the mentoined
5. For your front desk and back office classes, you can send and receive a map using the:-
convertAndSend()
receiveAndConvert()
all of the mentioned
None of the mentioned
6. When you call the receive() method on a JMS message consumer to receive a message.
send
receive
All of the mentioned
None of the mentioned
7. EJB component which was introduced for asynchronous reception of JMS messages.
message-driven bean
message-driven
message bean
None of the mentioned
8. MDB must implements interfaces:-
javax.ejb.MessageDrivenBean
javax.jms.MessageListener
all of the mentioned
None of the mentioned
9. In EJB 3.0, an MDB can be a POJO that implements the MessageListener interface and is annotated with the:-
@MessageDrive
@Message
all of the mentioned
@MessageDriven
10. You create a message listener to listen for JMS messages. This negates the need for the approach taken in BackOfficeImpl in previous recipes.
True
False
none
all the mentoined
11. A message listener must implement the:-
javax.jms.MessageListener
javax.jms.Message
javax.jms
None of the mentioned
12. When a JMS message arrives, the onMessage() method will be called with the message as the method argument.
True
False
none
all the mentoined
13. Method to convert MapMessage Object into Spring runtime exception JmsException.
JmsUtils.convertJmsAccessException()
JmsUtils.convertJmsAccess()
JmsUtils.convertJms()
none of the mentioned
14. Spring provides several types of message listener containers:-
SimpleMessageListenerContainer
DefaultMessageListenerContainer
All of the mentioned
None of the mentioned
15. If you have a transaction requirement in receiving messages, you have to use:-
SimpleMessageListenerContainer
DefaultMessageListenerContainer
All of the mentioned
None of the mentioned
16. You have to set the delegate property of MessageListenerAdapter to your target bean.
True
False
none
all the mentoined
17. Using Spring JMS support with a very simple instance of:-
org.apache.activemq.ActiveMQConnectionFactory
org.apache.activemq.ActiveMQConnection
org.apache.activemq.ActiveMQ
none of the mentioned
18. ActiveMQ, provides only one pooled connection factory class alternative.
True
False
none
all the mentoined
19. It caches consumers correctly, or use Spring ConnectionFactory implementations.
MessageListenerContainer
MessageListener
MessageContainer
None of the mentioned
20. Implementation which returns the same underlying JMS connection each time (which is thread-safe according to the JMS API) and ignores calls to the close() method.
org.springframework.jms.connection.SingleConnectionFactory
org.springframework.jms.connection.Single
org.springframework.jms.connection.SingleConnection
None of the mentioned
21. Integration of Spring which has each application produce files of shared data for others to consume.
File transfer
Shared Database
Remote Procedure Invocation
Messaging
22. Integration of Spring which has the applications store the data they want to share in a common database.
File transfer
Shared Database
Remote Procedure Invocation
Messaging
23. 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.
File transfer
Shared Database
Remote Procedure Invocation
Messaging
24. Integration of Spring which has each application connect to a common messaging system and exchange data and invoke behavior using messages.
File transfer
Shared Database
Remote Procedure Invocation
Messaging
25. Using an ESB lets you hide the origin of the message from the code that’s handling it.
True
False
none
all the mentoined
26. As with a standard MDP, a configuration for the ConnectionFactory exists.
True
False
none
all the mentoined
27. 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:-
service-activator
service
all of the mentioned
None of the mentioned
28. 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.
True
False
none
all the mentoined
29. A service-activator, however, only helps you invoke your application’s business logic on receipt of a message.
True
False
none
all the mentoined
30. The next component, a service-activator, listens for messages coming into that channel and invokes the bean referenced by the:-
ref
after
before
All of the mentioned
31. Headers Found in Spring Integration Messages:-
ID
TIMESTAMP
CORRELATION_ID
All of the mentioned
32. Some header values are specific to the type of the source message payload.
True
False
none
all the mentoined
33. Component-specific headers are the constants defined for files on:-
org.springframework.integration.file.FileHeaders: FILENAME
org.springframework.integration.file.FileHeaders: PREFIX
all of the mentioned
None of the mentioned
34. Annotation to get access to header metadata:-
@Ref
@service
@Header
None of the mentioned
35. 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>
Message<java.io>
All of the mentioned
None of the mentioned
36. To send a message into the bus and transform it before working with it further.
adding extra headers or augmenting the payload
transformer
all of the mentioned
None of the mentioned
37. Spring Integration provides a transformer message endpoint to permit the augmentation of the message headers.
True
False
all of the mentioned
None of the mentioned
38. 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 :-
error
exceptionChannel
exception
errorChannel
39. The errorChannel doesn’t need to be a service-activator.
True
False
none
all the mentoined
40. All errors thrown from Spring Integration components will be a subclass of:-
Messaging
MessagingException
Exception
None of the mentioned
41. One way to discriminate by Exception type is to use:-
org.springframework.integration.router.ErrorMessageExceptionType
org.springframework.integration.router.ErrorMessageException
org.springframework.integration.router.ErrorMessageExceptionTypeRouter
none of the mentioned
42. Sending all the errors to the same channel can eventually lead to a large switch-laden class that’s too complex to maintain.
True
False
none
all the mentoined
43. You can explicitly specify on what channel errors for a given integration should go.
True
False
none
all the mentoined
44. Spring Integration will use that header and forward errors encountered in the processing of this message to that channel.
True
False
none
all the mentoined
45. To fork the process flow from one component to many, either all at once or to a single one based on a predicate condition.
splitter
fork
all of the mentioned
none of the mentioned
46. A splitter takes an input message and asks you, the user of the component, on what basis it should split the Message.
True
False
none
all the mentoined
47. Spring Integration ships with useful splitters that require no customization.
Splitter
XPathMessageSplitter
All of the mentioned
None of the mentioned
48. Return type of the method annotated by the @Splitter annotation is of type:-
java.util.Collection
java.util.Date
all of the mentioned
none of the mentioned
49. Annotation which collects a series of messages (based on some correlation that you help Spring Integration make between the messages).
@After
@Splitter
@Aggregator
None of the mentioned
50. To determine how many messages to read until it can stop:-
SequenceSizeCompletionStrategy
SequenceSizeCompletion
SequenceSize
None of the mentioned
Submit