轻量级消息队列服务UCMQ

1,Libevent的安装

 wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
 tar zxvf libevent-2.0.21-stable.tar.gz 
 cd libevent-2.0.21-stable
 ./configure --prefix=/usr/local/libevent
 make clean && make 
 sudo make install

2,UCMQ的安装

git clone git://github.com/ucopensource/ucmq.git
 cd ucmq
 ./configure --with-libevent=/usr/local/libevent --prefix=/usr/local/ucmq
make clean && make 
sudo make install

3,启动UCMQ

cd /usr/local/ucmq/

cd conf修改ucmq.ini文件,设置server ip port 等

[server]
http_listen_addr=127.0.0.1
http_listen_port= 8803
allow_exec_ip=0
output_log_path=../log
output_log_level=DEBUG
binlog_file_path=../binlog
keep_alive=300
conf_file=../conf/ucmq.ini
pid_file=/tmp/ucmq_eth0_8803.pid
# reserved storage space, unit GB */
res_store_space=4
# queue list items limit
max_qlist_itmes=128       


[rtag]
sync_interval=100
sync_time_interval=20


[queue]
# queue store msg number
def_max_queue=1000000
def_delay=0


########################################################################
# DB file size must be less than 64, must be system multiple page !!!  #
# !!! The following contents are not allowed to change after the start #
########################################################################
[db]
data_file_path=../data
db_file_max_size=64

启动: ./ucmq –c ../conf/ucmq.ini –d

关闭:

1,kill

2,curl "http://127.0.0.1:8803/exec?cmd=kill"

    


入队列

curl -d "testdata" "http://127.0.0.1:8803/?name=testmq&opt=put&ver=2"



出队列

http://127.0.0.1:8803/?name=testmq&opt=get&ver=2



获取某队列的状态,查看队列的属性

http://127.0.0.1:8803/?name=testmq&opt=status&ver=2


数据data文件结构


参考:http://ucweb.github.io/ucmq_guide/



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值