ACTIVEMQ Learning Notes

Source: Internet
Author: User
Tags failover jboss
1. Basic Concepts

ActiveMQ: It is the most popular and powerful open source message bus that is produced by Apache. is a JMS provider implementation that fully supports the JMS1.1 and Java EE 1.4 specifications.

JMS (Java Messaging Service): is a Java platform for message-oriented middleware (MOM) APIs for sending messages between two applications, or distributed systems, for asynchronous communication. 2. JMS Message mode

1 point to point or queue mode

Each message can only have one consumer. There is no time dependency between the producer and the consumer of the message, and it can extract messages regardless of whether the consumer is running at the time the producer sends the message.

2) pub/sub Publish/Subscribe mode

Each message can have multiple consumers. There is a temporal correlation between producers and consumers. A consumer who subscribes to a subject can only consume messages that have been posted since it was subscribed. 3. Broker Node

Represents a node running MQ. 4. Transport transmission Mode

ACTIVEMQ currently supports transport: VM Transport, TCP Transport, NIO Transport, SSL Transport, Peer Transport, UDP Transport, Multicast transport, HTTP and HTTPS transport, websockets Transport, Failover Transport, fanout Transport, Discovery Transport, zeroconf transport and so on.

1 VM Transport: allows clients and broker to communicate directly within the VM, the connection is not a socket connection, but a direct method call, thus avoiding the overhead of network transmission. The scenario is also limited to broker and client in the same JVM environment.

2 TCP Transport: the client connects to remote broker via a TCP socket. Configuration syntax:

Tcp://hostname:port?transportoptions

3 HTTP and HTTPS Transport: allows clients to connect using rest or Ajax methods. This means that you can use JavaScript directly to send messages to ACTIVEMQ.

4) WebSockets Transport: allows clients to connect to broker through HTML5 standard websockets mode.

5 Failover Transport: Qinglong system MQ is the way to connect. This approach has the mechanism of automatic reconnection, working on the upper layers of other transport to establish reliable transmissions. Allows any number of URIs to be configured, which will automatically select one of the URIs to attempt the connection. Configuration syntax:

Failover: (tcp://localhost:61616,tcp://localhost:61617,.....)? Transportoptions

6) Fanout transport: mainly suitable for production messages sent to multiple agents. If multiple agents appear in loops, the consumer may receive duplicate messages. Therefore, when using this protocol, it is a good idea to send a message to multiple disconnected agents. 5. Persistence Persistent storage

1) AMQ Message Store

ActiveMQ 5.0 is the default persistent storage method.

2) Kaha Persistence

This is a solution specifically for message persistence. It optimizes the typical message usage patterns.

3) JDBC Persistence

Currently supported databases are: Apache Derby, Axion, DB2, Hsql, Informix, MaxDB, MySQL, Oracle, Postgresql, SQL Server, Sybase.

4) Disable Persistence

Persistent storage is not applied. 6. Cluster Programme

1. Master/slave

1.1. Pure Master Slave

No single point of failure;

There is no need to rely on shared file systems or shared databases to persist storage using KAHADB;

A master can only carry one slave;

The message status is automatically synchronized to the slave during master work;

Once the master crashes, slave automatically takes over its work, and the messages that have been sent and not consumed continue to be valid;

After slave takes over, you must stop slave to reboot the previous master;

1.2. Shared File System Master Slave

1.3. JDBC Master Slave

Configuration, there is no distinction between Master and Slave, and the broker of multiple shared data sources forms the JDBC Master Slave;

First grab the resource (Database lock) broker becomes master, other broker periodically attempts to preempt resources;

Once master crashes, other broker preemption Resources, finally only one grab, immediately become master, before master even restart successful, can only as slave wait; 7. Extend Link

1. ActiveMQ http://activemq.apache.org/

2. Metamorphosis (Metaq) http://metaq.taobao.org/

Taobao open source distributed messaging middleware, Taobao and Alipay has a wide range of applications.

3. DOTNETMQ

Open source Message Queuing system based on C # and. NET Framework.

4. JBoss Messaging http://www.jboss.org/jbossmessaging/

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.