ACTIVEMQ Learning (i)--JMS and ACTIVEMQ

Source: Internet
Author: User
Tags soap

Because the project is useful activemq, so record the learning process, first look at JMS.

The JMS (JAVA message Service,java messaging) API is a standard or specification of a messaging service that allows application components to create, send, receive, and read messages based on the Java EE platform. It makes distributed communication less coupled, and messaging services more reliable and asynchronous.

Message model

0point-to-point (Peer-to-peer)
0publish/subscribe (pub/sub)

Point to Point and publish subscription model

Peer-to-peer peer-to-peer mode diagram
The concepts involved
Message Queuing (queue) sender (Sender) receivers (Receiver) each message is sent to a specific queue, and the receiver obtains the message from the queue. Queues keep messages until they are consumed or timed out.

Peer-to-peer features each message has only one consumer (Consumer) (i.e. once consumed, messages are no longer in Message Queuing there is no time dependency between the sender and the receiver, meaning that when the sender sends a message, no matter whether the receiver is running or not, it does not affect the message being sent to the queue Recipient must reply to queue successfully after receiving message successfully

If every message you want to send should be handled successfully, then you need Peer-to-peer mode.

Pub/sub pub/sub mode diagram
The concepts involved
Subject (Topic) Publisher (publisher) Subscriber (subscriber)
The client sends the message to the subject. Multiple publishers send messages to topic, which the system passes to multiple subscribers.

The characteristics of pub/sub each message can have a time dependency between multiple consumer publishers and subscribers. For a subscriber to a topic (Topic), it must create a subscriber before it can consume the publisher's message, and the Subscriber must remain in the running state in order to consume the message. To mitigate such strict time dependencies, JMS allows subscribers to create a durable subscription. In this way, even if the Subscriber is not activated (running), it can also receive a message from the publisher.

If the message you want to send can be handled without any processing, or handled by a message, or can be handled by multiple consumers, then you can use the PUB/SUB model JMS and SOAP differences
Soap describes the format of data in XML format. Focus on RPC, which makes up a system with WSDL. JMS describes more general messages. Or it can be said that SOAP focuses on remote service invocation, and JMS focuses on information exchange. Soap is a two-point connection system, and JMS is 3 dots. The relationship between JMS and ACTIVEMQ

JMS is a technical specification for messaging services that provides all the data structure and interaction processes throughout the messaging service delivery process. MQ is the Message Queuing service, the ultimate implementation of message-oriented middleware (MOM), the true service provider, and the implementation of MQ can be based on JMS or other specifications or standards.

and ActiveMQ is an open source MQ that supports JMS:

ActiveMQ is the most popular and powerful open source message bus produced by Apache. ActiveMQ is a JMS provider implementation that fully supports the JMS1.1 and Java EE 1.4 specifications, although the JMS specification has been around for a long time, but JMS still plays a special role in today's Java EE applications.

Main Features:

1. Multiple language and protocol writing client. Languages: Java, C, C + +, C #, Ruby, Perl, Python, PHP. Application protocol: Openwire,stomp REST,WSNOTIFICATION,XMPP,AMQP

2. Fully support JMS1.1 and Java EE 1.4 specification (persistence, XA messages, transactions)

3. Support for spring, ACTIVEMQ can easily be embedded inside a system that uses spring, and it also supports Spring2.0 features

4. Through the test of a common Java server (such as Geronimo,jboss 4, glassfish,weblogic), which is configured through the JCA 1.5 resource adaptors, Allows ACTIVEMQ to be automatically deployed to any compatible Java 1.4 Business Server

5. Support for multiple delivery protocols: In-vm,tcp,ssl,nio,udp,jgroups,jxta

6. Support for high-speed message persistence through JDBC and journal

7. From the design to ensure a high-performance cluster, client-server, point to point

8. Ajax support

9. Support for integration with axis

10. You can easily invoke the embedded JMS provider to test

ACTIVEMQ speed is very fast, generally 10 times times faster than JBOSSMQ.

Benefits : A fast Open source Messaging Component (framework) that supports clustering, equivalent networks, automatic detection, TCP,SSL, broadcasting, persistence, XA, and j2ee1.4 containers seamlessly, and supports lightweight containers and Java virtual machines on most cross-language clients. The asynchronous acceptance of message reduces the coupling degree of software Multi system integration. Messages are reliably received, ensuring that messages are stored reliably in the middleware and that multiple messages can also form atomic transactions.

Disadvantages: ACTIVEMQ The default configuration performance is low, requires optimized configuration, but the configuration file is complex, ACTIVEMQ itself does not provide administrative tools; The document on the home page looks more comprehensive, but lacks an effective organization, and the document is fragmented, making it difficult for users to understand ; The overall professionalism of the document is too strong. In the research phase can be understood by looking at Maillist, looking at Javadoc, analyzing the source code.

Statement: The above picture and department content from (http://blog.csdn.net/jiuqiyuliang/article/details/46701559)

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.