Message Communication Library ZEROMQ 4.0.4 Installation Guide
I. Introduction of ZEROMQ
ZEROMQ is an open source Message Queuing system, which, according to the official definition, is a message communication library that helps developers design distributed and parallel applications.
First, we need to understand that ZEROMQ is not a traditional Message queuing system (such as ACTIVEMQ, WEBSPHEREMQ, RABBITMQ, etc.). ZEROMQ can help us build our own Message Queuing system, which is just a library.
The ZEROMQ can be run on a machine with a x86 processor or ARM processor, supporting more than 40 programming languages.
Message Queuing, from a technical point of view, is based on FIFO algorithm, which has good data structure. In addition, there are queue technologies such as priority queues, double-ended queues, and so on. In any case, the basic idea is to add data to the queue, and the receiving side is ready to retrieve the data from the queue.
The use of Message Queuing technology ensures that messages are delivered to the destination regardless of what happens.
Message Queuing allows for asynchronous communication between loosely-coupled components, and also provides solid queue consistency. If the resource is low, it will prevent you from processing the data sent immediately, you can put the message into the Message Queuing server, the Message Queuing server to store the data until the destination is ready to receive the message.
Message Queuing plays an important role in large-scale distributed systems and asynchronous communication.
Ii. Characteristics of ZEROMQ
1) ZEROMQ is simple
We can do asynchronous I/O operations, and ZEROMQ can queue messages in an I/O thread. ZEROMQ I/O threads are asynchronous, and when dealing with network traffic, it can help us do a lot of the rest of the work.
2) Zeromq quite fast
The Second Life website has an end-to-end latency of 13.4 milliseconds and a throughput of up to 4.1 million messages per second. ZEROMQ can use the broadcast transport protocol-it's a good way to transfer data to multiple destinations.
3) No agent design
Unlike other traditional Message Queuing systems, ZEROMQ is non-proxy. Traditional Message Queuing systems typically have a central messaging server (Broker), each of which is connected to the central node, each of which communicates with the other nodes through the central node, rather than the nodes communicating directly with each other.
While ZEROMQ is agentless, applications can communicate directly with each other without having to pass intermediary broker broker.
Note: ZEROMQ does not store messages on disk. However, you can store messages by using local Exchange files. Set the ZMQ. SWAP.
Iii. Conditions of preparation
Os:centos 6.5 x64
Version zeromq:4.0.4
Iv. installation of ZEROMQ
1) Download Zeromq
Execute command:
$ wget http://download.zeromq.org/zeromq-4.0.4.tar.gz
2) Unzip the ZEROMQ
$ tar zvxf zeromq-4.0.4.tar.gz$ mv zeromq-4.0.4 zeromq$ CD ZEROMQ
3) Compile and install
$./configure......checking for GCC ... nochecking for cc ... Nochecking for cl.exe ... noconfigure:error:in '/home/chuser/zeromq ': configure:error:no acceptable C compiler found in $PATHSee ' Config.log ' for more details
Tip missing C compiler, install GCC first.
$ sudo yum install gcc
Installing ok! Execute again
$./configure......checking whether the C + + compiler works ... noconfigure:error:Unable to find a working C + + compiler
Tip the C + + compiler is missing, install g++ first.
$ sudo yum install gcc-c++
Installing ok! Execute again
$./configure$ make$ sudo make install
ZEROMQ installation is successful!
Message Communication Library ZEROMQ 4.0.4 Installation Guide