Giter VIP home page Giter VIP logo

httpsqs's Introduction

HTTPSQS

HTTPSQS is based on HTTP GET/POST protocol open source simple message queue service, Use Tokyo Cabinet's B+Tree Key/Value database to do data persistence storage。

Prepare

openssl

Type openssl version in your linux operator system to make sure the version is 1.1.1f, openssl is installed in every linux system

libevent

wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
tar tar zxvf libevent-2.0.12-stable.tar.gz
cd tar zxvf libevent-2.0.12-stable
./autegen.sh
./configure
make
make install

toyko cabinet

git clone https://github.com/hthetiot/Tokyo-Cabinet
cd Tokyo-Cabinet
./configure
make
make install

ln tokyo cabinet

ln -s /usr/local/tokyocabinet-1.4.48/lib/libtokyocabinet.so.9 /usr/lib/libtokyocabinet.so.9  

httpsqs

git clone https://github.com/WangTingZheng/httpsqs
make 
make install

check

httpsqs -h

if show this, all done:

--------------------------------------------------------------------------------------------------
HTTP Simple Queue Service - httpsqs v1.7 (April 14, 2011)

Author: Zhang Yan (http://blog.s135.com), E-mail: [email protected]
This is free software, and you are welcome to modify and redistribute it under the New BSD License

-l <ip_addr>  interface to listen on, default is 0.0.0.0
-p <num>      TCP port number to listen on (default: 1218)
-x <path>     database directory (example: /opt/httpsqs/data)
-t <second>   keep-alive timeout for an http request (default: 60)
-s <second>   the interval to sync updated contents to the disk (default: 5)
-c <num>      the maximum number of non-leaf nodes to be cached (default: 1024)
-m <size>     database memory cache size in MB (default: 100)
-i <file>     save PID in <file> (default: /tmp/httpsqs.pid)
-a <auth>     the auth password to access httpsqs (example: mypass123)
-d            run as a daemon
-h            print this help and exit

Use command "killall httpsqs", "pkill httpsqs" and "kill `cat /tmp/httpsqs.pid`" to stop httpsqs.
Please note that don't use the command "pkill -9 httpsqs" and "kill -9 PID of httpsqs"!

Please visit "http://code.google.com/p/httpsqs" for more help information.

--------------------------------------------------------------------------------------------------

usage

start httpsqs service

ulimit -SHn 65535
httpsqs -d -p 1218 -x /data0/queue

put data

put 你好,https into queue

GET: curl "http://localhost:1218/?name=your_queue_name&opt=put&data=%E4%BD%A0%E5%A5%BD%EF%BC%8Chttpsqs&auth=mypass123"
POST: curl -d "%E4%BD%A0%E5%A5%BD%EF%BC%8Chttpsqs" "http://localhost:1218/?name=your_queue_name&opt=put&auth=mypass123"

if put successfully, will get HTTPSQS_PUT_OK

get data

get 你好,httpsqs into queue

GET: curl "http://localhost:1218/?charset=utf-8&name=your_queue_name&opt=get&auth=mypass123"
POST: curl "http://localhost:1218/?charset=gb2312&name=your_queue_name&opt=get&auth=mypass123"

if get successfully, will show 你好,httpsqs

stop httpsqs

USE: killall httpsqs, pkill httpsqs, kill cat /tmp/httpsqs.pidPS: DO NOT USEpkill -9 httpsqsorkill -9 httpsqs` to aviod lost unsaved data

Ref

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.