Try simple Queue Service (httpsqs of Zhang banquet)

Source: Internet
Author: User

Statement: The main content of this article from Zhang banquet blog http://blog.s135.com/httpsqs/


1. Download, compile, and install

Note: Do not forget to add sudo before make and make install In ubuntu.

Detailed steps:

1. Install libevent

Wget http://httpsqs.googlecode.com/files/libevent-1.4.13-stable.tar.gz

Tar zxvf libevent-1.4.13-stable.tar.gz
CD libevent-1.4.13-stable/
./Configure -- prefix =/usr
Make
Make install
CD ../

2. Install tokyocabinet

Wget http://httpsqs.googlecode.com/files/tokyocabinet-1.4.41.tar.gz

Tar zxvf tokyocabinet-1.4.41.tar.gz
CD tokyocabinet-1.4.41/
./Configure
# Note: To compile Tokyo cabinet on a 32-bit Linux operating system, use./configure -- enable-off64 instead of./configure, which can make the database file break through the limit of 2 GB.
#./Configure -- enable-off64
Make
Make install
CD ../

/Sbin/ldconfig

 

3. Install the queue service program httpsqs

Wget http://httpsqs.googlecode.com/files/httpsqs-1.1.tar.gz

Tar zxvf httpsqs-1.1.tar.gz
CD httpsqs-1.1/
Make
Make install
CD ../

 

Note: When TC is installed for configure, The libbz2 package may be missing and must be installed first.

Sudo apt-Get install checkinstall build-essential libbz2-dev
(Under Ubuntu)

 

Ii. Preparations

View the queue service program help:

Httpsqs-H

-L IP address of the <ip_addr> listener. The default value is 0.0.0.0.
-P <num> TCP port of the listener (default value: 1218)
-X <path> database Directory, which is automatically created if the directory does not exist (for example,/opt/httpsqs/data)
-T <second> timeout value of the HTTP request (default value: 1)
-D run as a daemon
-H: Show this help

 

Example:

Http sqs-D-P 1218-x/data0/search/queue

 

Terminate process:

Use the command "killall httpsqs", "pkill httpsqs", and "Kill httpsqs process ID" to stop httpsqs.

 

Iii. Instructions for use

Note: You can use curl and a browser without using httpd services such as Apache.

If the shell has not installed curl, sudo apt-Get install curl (under Ubuntu) is required)

 

Example of curl test:

1. Inbound queue:

[Get method] curl "http: // host: Port /? Name = your_queue_name & OPT = put & Data = URL-encoded text message"

[POST method] curl-d "url-encoded text message" "http: // host: Port /? Name = your_queue_name & OPT = put"

2. outbound queue

Curl "http: // host: Port /? Charset = UTF-8 & name = your_queue_name & OPT = get"

3. view the queue status

Curl "http: // host: Port /? Name = your_queue_name & OPT = Status"

4 ,......

 

4. For more information, see

1. http://blog.s135.com/httpsqs/3/1/
Author's blog

2. http://code.google.com/p/httpsqs/
Project address

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.