Set - 1

Question 1 :

What is JMS?

Answer :

Answer 1:
Java Message Service: An interface implemented by most J2EE containers to provide point-to-point queueing and topic (publish/subscribe) behavior. JMS is frequently used by EJB's that need to start another process asynchronously.
For example, instead of sending an email directly from an Enterprise JavaBean, the bean may choose to put the message onto a JMS queue to be handled by a Message-Driven Bean (another type of EJB) or another system in the enterprise. This technique allows the EJB to return to handling requests immediately instead of waiting for a potentially lengthy process to complete.

Answer 2:
The Java Message Service (JMS) defines the standard for reliable Enterprise Messaging. Enterprise messaging, often also referred to as Messaging Oriented Middleware (MOM), is universally recognized as an essential tool for building enterprise applications. By combining Java technology with enterprise messaging, the JMS API provides a powerful tool for solving enterprise computing problems.

Answer 3:
JMS stands for Java Messaging Service which is developed by Sun Microsystems . JMS Provider allow applications which are running on different systems can communicate with each other asynchronously . Many EAI tools support JMS as their standard messaging service.

Answer 4:
The Java Message Service is a Java API that allows applications to create, send, receive, and read messages. Designed by Sun and several partner companies, the JMS API defines a common set of interfaces and associated semantics that allow programs written in the Java programming language to communicate with other messaging implementations.

Answer 5:
JMS stands for Java Message Service. It allows applications to communicate through reliable, scaleable, and asynchronous text messages and objects over the network.

Answer 6:
Java Message Service (JMS) is the new standard for interclient communication. It allows J2EE application components to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous.

Answer 7:
JMS is an acronym used for Java Messaging Service. It is Java's answer to creating software using asynchronous messaging. It is one of the official specifications of the J2EE technologies and is a key technology.

Question 2 :

Must I place all my class files in the WEB-INF folder and all JSP's outside?

Answer :

Answer 1:
The class files should place into WEB-INF/classes folder and the JSP files should place within a separate folder.

Answer 2:
Yes! Otherwise the web server/ application server cannot access the .jsp files and classes.
The java class files can be placed either in WEB-INF/lib or WEB-INF/classes. But it is recommended to put the class files in WEB-INF/classes. The server will load the files from the classpath so it just will not matter where the class is.

Answer 3:
Yes, class files is private resources, so you must store class in WEB-INF/classes folder.
JSP and HTML files should be placed outside.

Answer 4:
Class files inside web-inf cannot be access by browsers, while the JSP files are meant for accessible by browsers so, it may be strictly place outside the web-inf only.

Answer 5:
Here is structure of web app.
web (this folder is Accessible from www)
Store all your JSP and HTML files here
WEB-INF (this folder is not Accessible )
classes (store your classes here, classes you are using in jsp
lib (store 3rd party jars)

Answer 6:
1. Class files - Either they must be in WEB-INF\classes directory OR you can package them as JAR and put in WEB-INF\lib
2. JSP files - Depends how do you design your arch. If you have controller/delegator that can forward requests to JSPs, you can keep them under WEB-INF directory also. If not, you have to keep them outside WEB-INF.

Answer 7:
The Java Message Service (JMS) API is a messaging standard that allows application components based on the Java 2 Platform, Enterprise Edition (J2EE) to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous

Question 3 :

What type messaging is provided by JMS?

Answer :

Both synchronous and asynchronous.

Question 4 :

How may messaging models do JMS provide for and what are they?

Answer :

JMS provides for two messaging models, publish-and-subscribe and point-to-point queuing.

Question 5 :

What is the point-to-point model in JMS?

Answer :

A point-to-point model is based on the concept of a message queue: Senders send messages into the queue, and the receiver reads messages from this queue. In the point-to-point model, several receivers can exist, attached to the same queue. However, (Message Oriented Middleware)MOM will deliver the message only to one of them. To which depends on the MOM implementation.

Question 6 :

What are the advantages of JMS?

Answer :

One of the principal advantages of JMS messaging is that it's asynchronous. Thus not all the pieces need to be up all the time for the application to function as a whole.

Question 7 :

What is the publish-and-subscribe model in JMS?

Answer :

A publish-subscribe model is based on the message topic concept: Publishers send messages in a topic, and all subscribers of the given topic receive these messages.

Question 8 :

What is JMS administered object?

Answer :

A preconfigured JMS object (a resource manager connection factory or a destination) created by an administrator for the use of JMS clients and placed in a JNDI namespace

Question 9 :

What is publish/subscribe messaging?

Answer :

With publish/subscribe message passing the sending application/client establishes a named topic in the JMS broker/server and publishes messages to this queue. The receiving clients register (specifically, subscribe) via the broker to messages by topic; every subscriber to a topic receives each message published to that topic. There is a one-to-many relationship between the publishing client and the subscribing clients.

Question 10 :

What is the main parts of JMS applications?

Answer :

The main parts of JMS applications are:
--ConnectionFactory and Destination

Question 11 :

What Is Messaging?

Answer :

Messaging is a method of communication between software components or applications. A messaging system is a peer-to-peer facility: A messaging client can send messages to, and receive messages from, any other client. Each client connects to a messaging agent that provides facilities for creating, sending, receiving, and reading messages.
Messaging enables distributed communication that is loosely coupled. A component sends a message to a destination, and the recipient can retrieve the message from the destination. However, the sender and the receiver do not have to be available at the same time in order to communicate. In fact, the sender does not need to know anything about the receiver; nor does the receiver need to know anything about the sender. The sender and the receiver need to know only what message format and what destination to use. In this respect, messaging differs from tightly coupled technologies, such as Remote Method Invocation (RMI), which require an application to know a remote application's methods.
Messaging also differs from electronic mail (e-mail), which is a method of communication between people or between software applications and people. Messaging is used for communication between software applications or software components.
Messaging is a mechanism by which data can be passed from one application to another application.

Question 12 :

What is the Role of the JMS Provider?

Answer :

The JMS provider handles security of the messages, data conversion and the client triggering. The JMS provider specifies the level of encryption and the security level of the message, the best data type for the non-JMS client.

Question 13 :

What is the diffrence between Java Mail and JMS Queue

Answer :

JMS is the ideal high-performance messaging platform for intrabusiness messaging, with full programmatic control over quality of service and delivery options.
JavaMail provides lowest common denominator, slow, but human-readable messaging using infrastructure already available on virtually every computing platform.

Question 14 :

Does JMS specification define transactions? Queue

Answer :

JMS specification defines a transaction mechanisms allowing clients to send and receive groups of logically bounded messages as a single unit of information. A Session may be marked as transacted. It means that all messages sent in a session are considered as parts of a transaction. A set of messages can be committed (commit() method) or rolled back (rollback() method). If a provider supports distributed transactions, it's recommended to use XAResource API.

Question 15 :

What is synchronous messaging? Queue

Answer :

Synchronous messaging involves a client that waits for the server to respond to a message. So if one end is down the entire communication will fail.

Question 16 :

What is asynchronous messaging? Queue

Answer :

Asynchronous messaging involves a client that does not wait for a message from the server. An event is used to trigger a message from a server. So even if the client is down , the messaging will complete successfully.

Question 17 :

How does a typical client perform the communication? Queue

Answer :

1. Use JNDI to locate administrative objects.
2. Locate a single ConnectionFactory object.
3. Locate one or more Destination objects.
4. Use the ConnectionFactory to create a JMS Connection.
5. Use the Connection to create one or more Session(s).
6. Use a Session and the Destinations to create the MessageProducers and MessageConsumers needed.
7. Perform your communication.

Question 18 :

What is JMS session? Queue

Answer :

A single-threaded context for sending and receiving JMS messages. A JMS session can be nontransacted, locally transacted, or participating in a distributed transaction.

Question 19 :

What is the use of JMS? In which situations we are using JMS? Can we send message from one server to another server using JMS? Queue

Answer :

JMS is the ideal high-performance messaging platform for intrabusiness messaging, with full programmatic control over quality of service and delivery options.

Question 20 :

What is the difference between durable and non-durable subscriptions?

Answer :

Point-To-Point (PTP). This model allows exchanging messages via queues created for some purposes. A client can send and receive messages from one or several queues. PTP model is easier than pub/sub model.
A durable subscription gives a subscriber the freedom of receiving all messages from a topic, whereas a non-durable subscription doesn't make any guarantees about messages sent by others when a client was disconnected from a topic.