"Advanced JEE Technology" JMS

Source: Internet
Author: User

ACTIVEMQ the messaging server.

ACTIVEMQ is a JMS standard implementation of Apache that supports two models, a point-to-point message, and a publishing subscriber model.

To standardize the JMS API,JMS, there are a number of concepts defined for message delivery:

JMS clients----100% applications written in Java to send and receive messages.

The NON-JMS client----an app that uses a JMS provider-specific client API instead of a JMS API to send and receive messages.

JMS producer----Client app that creates and sends JMS messages.

JMS Consumer----client applications that receive and process JMS messages.

JMS provider----100% implementation of the JMS interface written in Java.

JMS message----The most basic concept of JMS, which is sent and received by the JMS client.

JMS domains----Both types of messaging, including point-to-point (point-to-point) and publish/subscribe (publish/subscribe) modes.

Administered objects----A preconfigured JMS object that contains provider-specific configuration information. The client accesses this data through Jndi.

Connection Factory----Client uses a connection factory to connect to the JMS provider.

Destination----Where the message was delivered, and the source from which the recipient message was received.

In addition, there are other equally important concepts. The next section will delve into these concepts and describe how they build the entire JMS.

Single Point model:

Publisher/subscriber Model:

?

Start Activemq:

ACTIVEMQ in the window environment just CD to the bin directory, enter ACTIVEMQ Start can start, note that the computer name can not be Chinese, otherwise it will error.

Open Web Management interface after startup: http://localhost:8161/admin/

?

You can see several key information activemq:

Queue,topic,subscribers.

To create a JMS program, there are a few steps necessary:Connectinfactory->connection->session->destination->cosumer/producer

?

A peer-to-peer JMS sender that uses queue as the connection, MQ saves the message.

A queue named "My-queue" was created:

Recipient Program:

?

The Publish/Subscribe model, MQ does not display save data and needs to be displayed stating its own Clienid and persistent subscription connections.

sender, set message for persistence save Setdeliverymode (Deliverymode.persistent)

Receiver, need to display claims that they are persistent subscriptions createdurablesubscriber

"Advanced JEE Technology" JMS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.