OCEJBCD (SCBCD) - 1Z0-895 - Enterprise JavaBeans Developer Certification
6.1. Review JMS technology
JMS (Java Messaging Service) is an API to send/receive messages :
1) Asynchronously:
JMS works asynchronously because it sends messages to the client without a previous request, also it sends messages without having to wait for a reply.
2) Loosely coupled:
Provides vendor-independent access to messaging systems.
Messaging domain types:
6.2. Describe the roles of the participants in the JMS API messaging system
Components is a JMS system:
6.3. Create a queue message producer
6.4. Create a synchronous message consumer
The message can be consumed synchronously or asynchronously.
- synchronously : the consumer call the receive() method, that blocks until the message arrives
- asynchronously : the consumer call the onMessage() message listener method.
OCEJBCD (SCBCD) - 1Z0-895 - Enterprise JavaBeans Developer Certification
JMS (Java Messaging Service) is an API to send/receive messages :
1) Asynchronously:
JMS works asynchronously because it sends messages to the client without a previous request, also it sends messages without having to wait for a reply.
2) Loosely coupled:
Provides vendor-independent access to messaging systems.
Messaging domain types:
- Point to point :
- Every message has a consumer
- The messages are requested from the queue by the consumer.
- Publish/Subscribe
- Every message has several consumers
- The messages are pushed to the consumers without requesting.
6.2. Describe the roles of the participants in the JMS API messaging system
Components is a JMS system:
- JMS Provider.- The messaging system
- JMS Clients .- Any java component that is producer or consumer of messages
- Producer
- Consumer(Listener and selectors)
- Messages .- the objects that contain the information.
- Administered objects.- Destinations and connection factories.
- Session.- single threaded context.
- Connection.- connection with JMS provider.
- Queue browsers.
- Exception handling .
6.3. Create a queue message producer
MessageProducer producer = session.createProducer(queue);
See JMS message producer from the oracle java EE tutorialproducer.send(message);
6.4. Create a synchronous message consumer
MessageConsumer consumer = session.createConsumer(queue);
See JMS message consumer from the oracle java EE tutorialconnection.start(); Message m = consumer.receive();
The message can be consumed synchronously or asynchronously.
- synchronously : the consumer call the receive() method, that blocks until the message arrives
- asynchronously : the consumer call the onMessage() message listener method.
OCEJBCD (SCBCD) - 1Z0-895 - Enterprise JavaBeans Developer Certification