JMS

1) What is JMS ?
Java messaging service specification is stated and developed by the Java Community process 914. This platform was developed to facilitate sending of messages between two or more clients. Service providers either use JMS or non-Java MO middleware.


2) What are the different elements present in JMS?
The different elements present in JMS are: -
* JMS provider, client, producer, consumer, message, topic and queue. Java client helps in processing and sending messages, this is the primary requisite for JMS to function.


3) Explain about JMS queue?
This acts as a queue where messages are removed once sent to the receiver. This acts as a storage area where messages or products are sent and ready to be accepted by the user. In this queue messages are sent in an orderly fashion and order.


4) Explain about point to point?
At the first point a producer posts a message to the receiver where it stays in a particular queue until the receiver opens the message from the queue. In this model predefining of the user is very important and in this form of model only one user will receive the message. During the process of the message it is not imperative for the user and sender to be online. Message opened is acknowledged.


5) What are the different places where you can use the JMS API?
The different places where JMS API can be used are as follows: -
1) Provider of the message need not depend upon the component of the user
2) Application running should not be affected by the components
3) Where component request of acknowledgement of message is not mandatory.


6) What are all the features of JMS API in J2EE platform?
EJB components, web components and application clients can send messages synchronously as well as receive the messages asynchronously from these applications
Messages can participate in distributed transactions
Asynchronous consumption of messages and implementation of concurrent processing are some of the features and benefits of using JMS in J2EE.


7) Explain about publish model?
This model of messaging is useful when the clients subscribe to a particular service of messaging. Both the client and consumer remain alien. This form of technology is fast gaining ground in commercial usage of messaging. This separates the application from the transport layer.


8) Detail about the features of publish model?
The following are the features of the publish model they are: -
1) Multiple clients or consumers can receive the message simultaneously.
2) Timing dependency is a factor between the client and publisher. Client will not receive messages unless the client remains active all the time. This can be eliminated when a client has durable subscription.


9) What are the three parts of the message?
A message has three parts they are
1) A message header : - Contains operational settings
2) Message properties: -Has settings for compatibility and selectors
3) Optional message body: -Info or message you want to convey.


10) Explain about session interface?
Session interface is an important concept which deals partly with the queue system. It is a single thread session where messages are sent in an order. It holds the messages if transaction phase is selected and it also has facility for roll back.


11) Explain about Connection factory interface?
This has settings which creates a connection between the client and JMS provider. These settings are accessed through portable interface and need not be changed every time. These settings are configured in JNDI namespace.


12) Explain about Connection interface?
This acts as a connection link once the settings are configured between the client and the service provider. It all depends upon the connection type where sessions are configured. Connection to the JMS can be created once the settings are compatible.


13) Explain about message listeners?
It acts as an asynchronous event handler for messages. It implements the message listener interface. A developer defines the actions which should be taken when the message arrives such as deleting, forwarding, etc. A queue connection can be initiated once this connection is defined.


14) Explain about message selector?
Message selector contains an expression and it acts like a string. The syntax is based on the SQL92 conditional expression. Create receiver, create durable subscriber and create subscriber has a form which allows a person to specify message selector as an argument.


15) Explain about map message?
Map message contains name/value pairs. Names are stored as strings and values are stores as primitives in Java programming language. Names can be accessed from the database with the help of enumerator. The way the entries are stored cannot be accessed.


16) Explain about the exception handling mechanism of JMS?
JMS Exception mechanism is the root class thrown by JMS API. All the exceptions generated by JMS API are handled by Catching JMS Exception. Some of the sub classes generated by the exception are as follows
1) InvalidclientIDException
2) JMSSecurityException etc.


17) Explain the creation of JMS Administered objects?
A topic should be created in the window in which clients were compiled. Here you can create a topic by the command j2eeadmin and name the topic as MyTopic. Argument specified at the last determines the destination. Verification of the queue should be done. j2eeadmin –listJmsDestination following command verifies whether the queue is created or not.

Post a Comment

أحدث أقدم