memcacheQ is a pure distributed message queue service. Its installation depends on BerkeleyDB and libevent, so install BerkeleyDB and libevent first:
1, BerkeleyDB
Second, libevent (requires 1.4.x or higher)
three, memcacheQ
four, start memcacheQ
< Ol>
V, use
Use the above command to start mq, (note the above - The B parameter indicates that the body length of messag cannot exceed 1024 bytes. When using mq, only two commands are required: set and get:
set <queue name> <flags> 0 <message_len>\\ r\ <put your message body here>\ \ STORED\ \get <queue name>\ \ VALUE <queue name> <flags> <message_len>\ \ <your Message body will come here>\ \ END\ \It can be seen that it is basically the same as the memcache protocol, except that the key name is replaced by the queue name, and the parameters of expire_time are ignored in the set command. After all, mq's data storage is stored in berkeleyDB, made persistent storage, no memory expiration time.
When the set command is used, a new message is written to the specified message queue, that is, a new data is inserted into BerkeleyDB. When the get command is used, one is taken from the specified queue. The new message, which is to delete a piece of data to BerkeleyDB. When you use stats to view a specific queue, you can see how many messages the queue has received and how many of them have been fetched.
Example:
fengbo@onlinegame-10-121:~$ telnet 127.0.0.1 22202Trying 127.0.0.1…Connected to 127.0.0.1.Escape character is ‘^]’.set q4 0 0 5helloSTOREDset q4 0 0 5worldSTOREDstats queueSTAT q4 2/0ENDget q4VALUE q4 0 5helloENDstats queueSTAT q4 2/1ENDThe above two commands are executed. When using stats queue, you can see that there are 2 messages in the queue of q4. 0 has been removed; when using get to take the first one, then use stats queue to view, there are 2 messages in q4, of which 1 has been taken.
ifconfig -a View all NIC information of Linuxifconfig eth0 down Turn off eth0 network cardifconfig e
Many beginners linux childrens shoes application have this experience, when I first contacted Linux,
Currently, a very serious Bash vulnerability has been exposed on the Internet. It
view mysql default encoding format show variables like “character%”; If the reality-bash
Linux scp command using tutorial
Simple steps to configure NFS under Linux
How to manually clear or refresh the SWAP partition of Linux
Overview of Linux I2C Driver Architecture
Xauth: (stdin):1: bad display name "LSPPC-Lenny:1" in "ad
Linux system single network card batch add different IP
Easily switch the language of mac apps
Novice Academy: Linux download tool wget and axel introduction
Background daemon under Linux system
SQLPLUS some friendly operation settings tutorial
Introducing the Linux hard disk system to establish partition steps
Win10 set up the operation mode of the Edge browser
How to connect and use the projector with Win7 notebook
Win7 system blue screen and the ultimate repair method for error code 0x000000ed
The Win7 system requires a "troubleshooting" solution every time the network is connected.
How to add right-click installation for Win10 CAB update package?
How to open network neighbor win7 Win7 system open network neighbor operation method
How to completely disable the Win7 browser to automatically save the password of the web page
Carefully install 64-bit Windows Vista
How much is this computer configuration acceptable?
How to use the command prompt to query the time to install win7 system?