[READ: Why-JAVA][Start-Learning-JAVA][Why-Java's-Hot][Start-Using-LINUX][Java-Q-&-A][Question][Java-SE-6-Doc][Struts-Doc][Java-Tutorial-Index] [Java-Certification]
[Tech.][Struts.][Servlet.][JSP.][EJB.][JNDI-JMS][SQL.][JDBC.]
CORE-JAVA: [OOP][CLASS][ABSTRACT][EXCEPTIONS][THREADS][UTILS][PACKAGES][JVM][CASTING][NETWORKING][RMI-XML]
[Tech.][Struts.][Servlet.][JSP.][EJB.][JNDI-JMS][SQL.][JDBC.]
CORE-JAVA: [OOP][CLASS][ABSTRACT][EXCEPTIONS][THREADS][UTILS][PACKAGES][JVM][CASTING][NETWORKING][RMI-XML]
How may messaging models do JMS provide for and what are they?
JMS provide for two messaging models, publish-and-subscribe and point-to-point queuing.
What is messaging?
Messaging is a mechanism by which data can be passed from one application to another application.
What is point-to-point messaging?
With point-to-point message passing the sending application/client establishes a named message queue in the JMS broker/server and sends messages to this queue. The receiving client registers with the broker to receive messages posted to this queue. There is a one-to-one relationship between the sending and receiving clients.
Can two different JMS services talk to each other? For instance, if A and B are two different JMS providers, can Provider A send messages directly to Provider B? If not, then can a subscriber to Provider A act as a publisher to Provider B?
The answers are no to the first question and yes to the second. The JMS specification does not require that one JMS provider be able to send messages directly to another provider. However, the specification does require that a JMS client must be able to accept a message created by a different JMS provider, so a message received by a subscriber to Provider A can then be published to Provider B. One caveat is that the publisher to Provider B is not required to handle a JMSReplyTo header that refers to a destination that is specific to Provider A.
What is the advantage of persistent message delivery compared to nonpersistent delivery?
If the JMS server experiences a failure, for example, a power outage, any message that it is holding in primary storage potentially could be lost. With persistent storage, the JMS server logs every message to secondary storage. (The logging occurs on the front end, that is, as part of handling the send operation from the message producing client.) The logged message is removed from secondary storage only after it has been successfully delivered to all consuming clients
How is a java object message delivered to a non-java Client?
It is according to the specification that the message sent should be received in the same format. A non-java client cannot receive a message in the form of java object. The provider in between handles the conversion of the data type and the message is transferred to the other end.
What is MDB and What is the special feature of that?
MDB is Message driven bean, which very much resembles the Stateless session bean. The incoming and out going messages can be handled by the Message driven bean. The ability to communicate asynchronously is the special feature about the Message driven bean.
Give an example of using the publish/subscribe model.
JMS can be used to broadcast shutdown messages to clients connected to the Weblogic server on a module wise basis. If an application has six modules, each module behaves like a subscriber to a named topic on the server.
What is the difference between the Mailing and Messaging?
Java Mailing is the set of APIs that primarily concerns with the sending of Mail messages through the standard mail protocols. Messaging is the way of communicating to the remote machines using Message Oriented Middlewares. Message Oriented Middlewares do not use mailing internally for communication. They create their own channels for communication.
What are the types of messaging?
There are two kinds of Messaging.
Synchronous Messaging:
Synchronous messaging involves a client that waits for the server to respond to a message.
Asynchronous Messaging:
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.
What is publish/subscribe messaging?
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.
Why doesn't the JMS API provide end-to-end synchronous message delivery and notification of delivery?
Some messaging systems provide synchronous delivery to destinations as a mechanism for implementing reliable applications. Some systems provide clients with various forms of delivery notification so that the clients can detect dropped or ignored messages. This is not the model defined by the JMS API.
JMS API messaging provides guaranteed delivery via the once-and-only-once delivery semantics of PERSISTENT messages. In addition, message consumers can insure reliable processing of messages by using either CLIENT_ACKNOWLEDGE mode or transacted sessions. This achieves reliable delivery with minimum synchronization and is the enterprise messaging model most vendors and developers prefer.
The JMS API does not define a schema of systems messages (such as delivery notifications). If an application requires acknowledgment of message receipt, it can define an application-level acknowledgment message.
What are the core JMS-related objects required for each JMS-enabled application?
Each JMS-enabled client must establish the following:
· A connection object provided by the JMS server (the message broker)
· Within a connection, one or more sessions, which provide a context for message sending and receiving
· Within a session, either a queue or topic object representing the destination (the message staging area) within the message broker
· Within a session, the appropriate sender or publisher or receiver or subscriber object (depending on whether the client is a message producer or consumer and uses a point-to-point or publish/subscribe strategy, respectively)
Within a session, a message object (to send or to receive)
What are the various message types supported by JMS?
Stream Messages: Group of Java Primitives
Map Messages: Name Value Pairs. (Name being a string. Value being a java primitive.)
Text Messages: String messages (since being widely used a separate messaging Type has been supported)
Object Messages: Group of serialize able java object
Bytes Message: Stream of uninterrupted bytes
What is the Role of the JMS Provider?
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.
How does a typical client perform the communication?
1. Use JNDI to locate administrative objects.
1a. Locate a single ConnectionFactory object.
1b. Locate one or more Destination objects.
2. Use the ConnectionFactory to create a JMS Connection.
3. Use the Connection to create one or more Session(s).
4. Use a Session and the Destinations to create the MessageProducers and MessageConsumers needed.
5. Perform your communication.
Give an example of using the point-to-point model.
The point-to-point model is used when the information is specific to a single client. For example, a client can send a message for a print out, and the server can send information back to this client after completion of the print job.
How does the Application server handle the JMS Connection?
- App server creates the server session and stores them in a pool.
- Connection consumer uses the server session to put messages in the session of the JMS.
- Server session is the one that spawns the JMS session.
- Applications written by Application programmers creates the message listener.
What protocols does JNDI provide an interface to?
JNDI itself is independent of any specific directory access protocol. Individual service providers determine the protocols to support. JNDI supports popular protocols, such as LDAP (Light weight Directory Access Protocol) , NDS(Netscape Directory Service), DNS(Domain Naming Service), and NIS(Network Information Service), supplied by different vendors.
What is Context and InitialContext?
A context represents a set of bindings within a naming service. A Context object provides the methods for binding names to objects and unbinding names from objects, for renaming objects, and for listing the bindings. JNDI performs all naming operations relative to a context.
The JNDI specification defines an InitialContext class. This class is instantiated with properties that define the type of naming service in use (such as provider URL, security, ID and password to use when connecting).
What's the difference between JNDI lookup(), list(), listBindings(), and search()?
lookup() attempts to find the specified object in the given context. I.e., it looks for a single, specific object and either finds it in the current context or it fails.
list() attempts to return an enumeration of all of the NameClassPair's of all of the objects in the current context. I.e., it's a listing of all of the objects in the current context but only returns the object's name and the name of the class to which the object belongs.
listBindings() attempts to return an enumeration of the Binding's of all of the objects in the current context. I.e., it's a listing of all of the objects in the current context with the object's name, its class name, and a reference to the object itself.
search() attempts to return an enumeration of all of the objects matching a given set of search criteria. It can search across multiple contexts (or not). It can return whatever attributes of the objects that you desire. Etc. It's by far the most complex and powerful of these options but is also the most expensive.
Components of JNDI
Naming Interface- The naming interface organizes information hierarchically and maps human-friendly names to addresses or objects that are machine-friendly. It allows access to named objects through multiple namespaces.
Directory Interface- JNDI includes a directory service interface that provides access to directory objects, which can contain attributes, thereby providing attribute-based searching and schema support
Service Provider Interface- JNDI comes with the SPI, which supports the protocols provided by third parties.
JMS provide for two messaging models, publish-and-subscribe and point-to-point queuing.
What is messaging?
Messaging is a mechanism by which data can be passed from one application to another application.
What is point-to-point messaging?
With point-to-point message passing the sending application/client establishes a named message queue in the JMS broker/server and sends messages to this queue. The receiving client registers with the broker to receive messages posted to this queue. There is a one-to-one relationship between the sending and receiving clients.
Can two different JMS services talk to each other? For instance, if A and B are two different JMS providers, can Provider A send messages directly to Provider B? If not, then can a subscriber to Provider A act as a publisher to Provider B?
The answers are no to the first question and yes to the second. The JMS specification does not require that one JMS provider be able to send messages directly to another provider. However, the specification does require that a JMS client must be able to accept a message created by a different JMS provider, so a message received by a subscriber to Provider A can then be published to Provider B. One caveat is that the publisher to Provider B is not required to handle a JMSReplyTo header that refers to a destination that is specific to Provider A.
What is the advantage of persistent message delivery compared to nonpersistent delivery?
If the JMS server experiences a failure, for example, a power outage, any message that it is holding in primary storage potentially could be lost. With persistent storage, the JMS server logs every message to secondary storage. (The logging occurs on the front end, that is, as part of handling the send operation from the message producing client.) The logged message is removed from secondary storage only after it has been successfully delivered to all consuming clients
How is a java object message delivered to a non-java Client?
It is according to the specification that the message sent should be received in the same format. A non-java client cannot receive a message in the form of java object. The provider in between handles the conversion of the data type and the message is transferred to the other end.
What is MDB and What is the special feature of that?
MDB is Message driven bean, which very much resembles the Stateless session bean. The incoming and out going messages can be handled by the Message driven bean. The ability to communicate asynchronously is the special feature about the Message driven bean.
Give an example of using the publish/subscribe model.
JMS can be used to broadcast shutdown messages to clients connected to the Weblogic server on a module wise basis. If an application has six modules, each module behaves like a subscriber to a named topic on the server.
What is the difference between the Mailing and Messaging?
Java Mailing is the set of APIs that primarily concerns with the sending of Mail messages through the standard mail protocols. Messaging is the way of communicating to the remote machines using Message Oriented Middlewares. Message Oriented Middlewares do not use mailing internally for communication. They create their own channels for communication.
What are the types of messaging?
There are two kinds of Messaging.
Synchronous Messaging:
Synchronous messaging involves a client that waits for the server to respond to a message.
Asynchronous Messaging:
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.
What is publish/subscribe messaging?
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.
Why doesn't the JMS API provide end-to-end synchronous message delivery and notification of delivery?
Some messaging systems provide synchronous delivery to destinations as a mechanism for implementing reliable applications. Some systems provide clients with various forms of delivery notification so that the clients can detect dropped or ignored messages. This is not the model defined by the JMS API.
JMS API messaging provides guaranteed delivery via the once-and-only-once delivery semantics of PERSISTENT messages. In addition, message consumers can insure reliable processing of messages by using either CLIENT_ACKNOWLEDGE mode or transacted sessions. This achieves reliable delivery with minimum synchronization and is the enterprise messaging model most vendors and developers prefer.
The JMS API does not define a schema of systems messages (such as delivery notifications). If an application requires acknowledgment of message receipt, it can define an application-level acknowledgment message.
What are the core JMS-related objects required for each JMS-enabled application?
Each JMS-enabled client must establish the following:
· A connection object provided by the JMS server (the message broker)
· Within a connection, one or more sessions, which provide a context for message sending and receiving
· Within a session, either a queue or topic object representing the destination (the message staging area) within the message broker
· Within a session, the appropriate sender or publisher or receiver or subscriber object (depending on whether the client is a message producer or consumer and uses a point-to-point or publish/subscribe strategy, respectively)
Within a session, a message object (to send or to receive)
What are the various message types supported by JMS?
Stream Messages: Group of Java Primitives
Map Messages: Name Value Pairs. (Name being a string. Value being a java primitive.)
Text Messages: String messages (since being widely used a separate messaging Type has been supported)
Object Messages: Group of serialize able java object
Bytes Message: Stream of uninterrupted bytes
What is the Role of the JMS Provider?
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.
How does a typical client perform the communication?
1. Use JNDI to locate administrative objects.
1a. Locate a single ConnectionFactory object.
1b. Locate one or more Destination objects.
2. Use the ConnectionFactory to create a JMS Connection.
3. Use the Connection to create one or more Session(s).
4. Use a Session and the Destinations to create the MessageProducers and MessageConsumers needed.
5. Perform your communication.
Give an example of using the point-to-point model.
The point-to-point model is used when the information is specific to a single client. For example, a client can send a message for a print out, and the server can send information back to this client after completion of the print job.
How does the Application server handle the JMS Connection?
- App server creates the server session and stores them in a pool.
- Connection consumer uses the server session to put messages in the session of the JMS.
- Server session is the one that spawns the JMS session.
- Applications written by Application programmers creates the message listener.
What protocols does JNDI provide an interface to?
JNDI itself is independent of any specific directory access protocol. Individual service providers determine the protocols to support. JNDI supports popular protocols, such as LDAP (Light weight Directory Access Protocol) , NDS(Netscape Directory Service), DNS(Domain Naming Service), and NIS(Network Information Service), supplied by different vendors.
What is Context and InitialContext?
A context represents a set of bindings within a naming service. A Context object provides the methods for binding names to objects and unbinding names from objects, for renaming objects, and for listing the bindings. JNDI performs all naming operations relative to a context.
The JNDI specification defines an InitialContext class. This class is instantiated with properties that define the type of naming service in use (such as provider URL, security, ID and password to use when connecting).
What's the difference between JNDI lookup(), list(), listBindings(), and search()?
lookup() attempts to find the specified object in the given context. I.e., it looks for a single, specific object and either finds it in the current context or it fails.
list() attempts to return an enumeration of all of the NameClassPair's of all of the objects in the current context. I.e., it's a listing of all of the objects in the current context but only returns the object's name and the name of the class to which the object belongs.
listBindings() attempts to return an enumeration of the Binding's of all of the objects in the current context. I.e., it's a listing of all of the objects in the current context with the object's name, its class name, and a reference to the object itself.
search() attempts to return an enumeration of all of the objects matching a given set of search criteria. It can search across multiple contexts (or not). It can return whatever attributes of the objects that you desire. Etc. It's by far the most complex and powerful of these options but is also the most expensive.
Components of JNDI
Naming Interface- The naming interface organizes information hierarchically and maps human-friendly names to addresses or objects that are machine-friendly. It allows access to named objects through multiple namespaces.
Directory Interface- JNDI includes a directory service interface that provides access to directory objects, which can contain attributes, thereby providing attribute-based searching and schema support
Service Provider Interface- JNDI comes with the SPI, which supports the protocols provided by third parties.
* [Here are a few more English-SOFT-songs to .]
MeetUp-Message-Board:
Wishes-and-Prayers.Issue-of-Illegal-Immigration-&-Happy-Kingdom.The-New-York-Hillary-Rodham-ClintonCast-God-Religion!Barack-Obama-MeetupDuty-Responsibility-Law-and-OrderJohn-Edwards-One-AmericaGood-Wishes-Life-is-Meaningful-&-BeautifulDennis-Kucinich-MeetupLet-there-be-peace!Bill-Richardson-for-President-2008Logic-of-Good-and-Bad-convert-bad-to-goodMORAL-STORY-Elephants-held-by-small-ropes.Ron-Paul-Meetup.Nancy-Pelosi.Harry-Reid.
No comments:
Post a Comment