fedora中安装httpsqs

httpsqs基本用法

妙音 posted @ 2015年3月04日 09:14 in httpsqs , 10364 阅读
基于 HTTP GET/POST 协议的轻量级开源简单消息队列服务

启动/停止

  • 启动
httpsqs -d -x /opt/httpsqs/data
  • 停止
pkill httpsqs
  • 参数
-l <ip_addr> 监听的IP地址,默认值为 0.0.0.0 
-p <num> 监听的TCP端口(默认值:1218)
-x <path> 数据库目录,目录不存在会自动创建(例如:/opt/httpsqs/data)
-t <second> HTTP请求的超时时间(默认值:3)
-s <second> 同步内存缓冲区内容到磁盘的间隔秒数(默认值:5)
-c <num> 内存中缓存的最大非叶子节点数(默认值:1024)
-m <size> 数据库内存缓存大小,单位:MB(默认值:100)
-i <file> 保存进程PID到文件中(默认值:/tmp/httpsqs.pid)
-a <auth> 访问HTTPSQS的验证密码(例如:mypass123)
-d 以守护进程运行
-h 显示这个帮助

入队

  • get方式
http://localhost:1218/?name=your_queue_name&opt=put&data=经过URL编码的文本消息&auth=mypass123
  • post方式
http://localhost:1218/?name=your_queue_name&opt=put&auth=mypass123
  • 返回
HTTPSQS_PUT_OK    入队成功
HTTPSQS_PUT_ERROR 入队失败
HTTPSQS_PUT_END 队列已满

出队

  • get方式
http://localhost:1218/?charset=utf-8&name=your_queue_name&opt=get&auth=mypass123
  • post方式
http://localhost:1218/?charset=gb2312&name=your_queue_name&opt=get&auth=mypass123
  • 返回
HTTPSQS_GET_END 没有未读消息

获取状态

  • get方式
http://localhost:1218/?name=your_queue_name&opt=status&auth=mypass123
  • 返回
HTTP Simple Queue Service v1.7
------------------------------
Queue Name: wyq                      队列名
Maximum number of queues: 1000000    最大数
Put position of queue (1st lap): 18  入队位置
Get position of queue (1st lap): 18  出队位置
Number of unread queue: 0            未读数量
  • get方式
http://localhost:1218/?name=your_queue_name&opt=status_json&auth=mypass123
  • 返回json方式
{
"name":"wyq",
"maxqueue":1000000,
"putpos":18,   入队位置
"getpos":18,   出队位置
"putlap":1,    队列写入初始点
"getlap":1,    队列读取初始点
"unread":0     未读数量
}

重置

  • get方式
http://localhost:1218/?name=your_queue_name&opt=reset&auth=mypass123
  • 返回
HTTPSQS_RESET_OK    重置成功
HTTPSQS_RESET_ERROR 重置失败

更改参数

  • 设置最大队列数
http://localhost:1218/?name=your_queue_name&opt=maxqueue&num=1000000000&auth=mypass123
  • 返回
HTTPSQS_MAXQUEUE_OK     更改最大队列数成功
HTTPSQS_MAXQUEUE_CANCEL 操作被取消
  • 设置刷新内存缓冲区到磁盘间隔时间
http://localhost:1218/?name=your_queue_name&opt=synctime&num=10&auth=mypass123
  • 返回
HTTPSQS_SYNCTIME_CANCEL  本次操作被取消
HTTPSQS_SYNCTIME_OK   修改间隔时间成功
 
 
HTTPSQS_AUTH_FAILED 密码校验失败  
HTTPSQS_ERROR  全局错误
 
Avatar_small
terapia de pareja 说:
2023年6月25日 22:52

En el ámbito de la terapia psicológica de pareja, así como en el tratamiento individual, también existe la opción de solicitar una terapia de manera online, modalidad que presenta ciertas ventajas que deben ser tenidas en cuenta. Algunas de estas son la mayor flexibilidad de horarios y comodidad, mayor seguridad y anonimato en el paciente a quien le cueste desplazarse hacia una consulta psicológica y casi siempre, un coste de terapia más económico.

Avatar_small
Delayed Bilateral Vo 说:
2023年7月01日 02:19

Delayed Bilateral Vocal Cord Paralysis: Unraveling the Link to Cervical Spine Trauma

Avatar_small
Imamia Quran Academy 说:
2023年7月27日 06:00

Hi everyone, I really love your story. You have very useful information; I am from Imamia Quran Academy. Shia Online Quran Academy is an institute for Quran Education. They have trained teaching staff along with renowned Islamic Scholars for a better understanding of the Quran.

Avatar_small
SEO 说:
2023年12月03日 21:29

I recommend Toto Match for 토토사이트 enthusiasts.

Avatar_small
civaget 说:
2023年12月04日 01:33

The mobile optimization aspect of 구글 seo is non-negotiable in an era where mobile-first indexing takes center stage.

Avatar_small
civaget 说:
2023年12月16日 15:11

Premium sports, zero cost - that's 무료스포츠중계 for you.

Avatar_small
civaget 说:
2023年12月16日 19:30

Trust op사이트 순위 for top-rated website suggestions.

Avatar_small
civaget 说:
2023年12月17日 18:58

Engaging in discussions on 오피 sites is a fantastic way to connect with fellow enthusiasts.

Avatar_small
civaget 说:
2023年12月21日 03:33

대전휴게텔's menu is extensive. Take your time to choose the perfect massage.

Avatar_small
civaget 说:
2024年1月07日 22:19

The therapists who offer 출장마사지 are skilled in their craft.

Avatar_small
seo service london 说:
2024年1月13日 20:38

You are really a very high talented singer!!! I really love your music


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter