MQTT的学习研究(九)基于HTTP GET MQTT 抓取消息服务端使用
官方参看文档:
HTTP GET 接收主题请求协议和响应协议
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21230_.htm
HTTP POST 发布主题请求协议和响应协议
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21220_.htm
HTTP DELETE 订阅主题请求协议和响应协议
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21240_.htm
请求响应头各个字段的含义的讲解
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21250_.htm
响应错误处理
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21340_.htm
HTTP GET: WebSphere MQ bridge for HTTP command
The HTTP GET operation gets a message from a WebSphere® MQ queue. The message is left on the queue. The HTTP GET operation is equivalent to browsing a WebSphere MQ queue.
Syntax
Request >>-+-DELETE-+-- --| Path |-- --HTTP version--CRLF--------------->
'-GET----' .-CRLF---------------. .-CRLF---------------.
V | V |
>----+----------------+-+----+----------------+-+--------------->
'-general-header-' '-request-header-' .-CRLF----------------------------.
V |
>----+-----------------------------+-+-------------------------><
'-| Entity-header (Request) |-' Path |--/--contextRoot--/--------------------------------------------> >--msg/--+-queue/--queueName--+-------------+-+--/--------------|
| '-@--qMgrName-' |
'-topic/--topicName------------------' entity-header (Request) |--+----------------------------------------------+-------------|
+-standard entity-header-- --entity-value------+
+-x-msg-correlId - --correlation ID------------+
+-x-msg-msgId - --message ID-------------------+
+-x-msg-range-- --range------------------------+
+-x-msg-require-headers-- --entity header name-+
'-x-msg-wait - --wait time---------------------'
- If a question mark (?) is used it must be substituted with %3f. For example, orange?topic should be specified as orange%3ftopic.
- @qMgrName is only valid on an HTTP POST
Response >>-HTTP version-- --HTTP Status-Code-- --HTTP Reason-Phrase--CRLF--> .-CRLF---------------. .-CRLF----------------.
V | V |
>----+----------------+-+----+-----------------+-+-------------->
'-general-header-' '-response-header-' .-CRLF-----------------------------.
V |
>----+------------------------------+-+--+---------------+-----><
'-| Entity-header (Response) |-' '-CRLF--Message-' entity-header (Response) |--+-----------------------------------------+------------------|
+-standard entity-header-- --entity-value-+
+-x-msg-class-- --message type------------+
+-x-msg-correlId-- --correlation ID-------+
+-x-msg-encoding-- --encoding type--------+
+-x-msg-expiry-- --duration---------------+
+-x-msg-format-- --message format---------+
+-x-msg-msgId-- --message ID--------------+
+-x-msg-persistence-- --persistence-------+
+-x-msg-priority-- --priority class-------+
+-x-msg-replyTo-- --reply-to queue--------+
+-x-msg-timestamp-- --HTTP-date-----------+
'-x-msg-usr-- --user properties-----------'
HTTP GET example
HTTP GET gets a message from a queue. The message remains on the queue. In WebSphere MQ terms, HTTP GET is a browse request. You could create an HTTP DELETE request using a Java client, a browser form, or an AJAX toolkit.
Figure 1 is an HTTP request to browse the next message on queue called myQueue.
The request contains the HTTP request header x-msg-wait, which instructs WebSphere MQ bridge for HTTP how long to wait for a message to arrive on the queue. The request also contains the x-msg-require-headersrequest header, which specifies that the client is to receive the message correlation ID in the response.
GET /msg/queue/myQueue/ HTTP/1.1
Host: www.example.org
x-msg-wait: 10
x-msg-require-headers: correlID
Figure 2 is the response returned to the client. The correlation ID is returned to the client, as requested in x-msg-require-headers of the request.
HTTP/1.1 200 OK
Date: Wed, 2 Jan 2007 22:38:34 GMT
Server: Apache-Coyote/1.1 WMQ-HTTP/1.1 JEE-Bridge/1.1
Content-Length: 50
Content-Type: text/plain; charset=utf-8
x-msg-correlId: 1234567890 Here's my message body that will appear on the queue.
MQTT的学习研究(九)基于HTTP GET MQTT 抓取消息服务端使用的更多相关文章
- MQTT的学习研究(十四) MQTT moquette 的 Callback API 消息发布订阅的实现
在moquette-mqtt中提供了回调callback模式的发布和订阅但是在订阅之后没有发现有消息接收的方法,参看moquette-mqtt中Block,Future式的发布订阅基础是callbac ...
- MQTT的学习研究(十二) MQTT moquette 的 Future API 消息发布订阅的实现
MQTT moquette 的Server发布主题 package com.etrip.mqtt.future; import java.net.URISyntaxException; import ...
- MQTT的学习研究(十六) MQTT的Mosquitto的window安装部署
在mqtt的官方网站,有许多mqtt,其中:MosquittoAn Open Source MQTT server with C, C++, Python and Javascript clients ...
- MQTT的学习研究(十五) MQTT 和android整合文章
详细参考: How to Implement Push Notifications for Android http://tokudu.com/2010/how-to-implement-push- ...
- 基于fiddler的APP抓包及服务端模拟
在HTTP接口的测试过程中,一般我们会按照如下的步骤进行: 1)测试环境的准备 2)HTTP消息体的构造 3)HTTP消息的发送及断言 如果我们可以拿到项目组的接口文档,并且HTTP后台服务是可以工作 ...
- [转]基于fiddler的APP抓包及服务端模拟
在HTTP接口的测试过程中,一般我们会按照如下的步骤进行: 1)测试环境的准备 2)HTTP消息体的构造 3)HTTP消息的发送及断言 如果我们可以拿到项目组的接口文档,并且HTTP后台服务是可以工作 ...
- .net平台 基于 XMPP协议的即时消息服务端简单实现
.net平台 基于 XMPP协议的即时消息服务端简单实现 昨天抽空学习了一下XMPP,在网上找了好久,中文的资料太少了所以做这个简单的例子,今天才完成.公司也正在准备开发基于XMPP协议的即时通讯工具 ...
- 记一次企业级爬虫系统升级改造(二):基于AngleSharp实现的抓取服务
爬虫系统升级改造正式启动: 在第一篇文章,博主主要介绍了本次改造的爬虫系统的业务背景与全局规划构思: 未来Support云系统,不仅仅是爬虫系统,是集爬取数据.数据建模处理统计分析.支持全文检索资源库 ...
- python3.4学习笔记(十七) 网络爬虫使用Beautifulsoup4抓取内容
python3.4学习笔记(十七) 网络爬虫使用Beautifulsoup4抓取内容 Beautiful Soup 是用Python写的一个HTML/XML的解析器,它可以很好的处理不规范标记并生成剖 ...
随机推荐
- java TreeMap 源代码分析 平衡二叉树
TreeMap 的实现就是红黑树数据结构,也就说是一棵自平衡的排序二叉树,这样就可以保证当需要快速检索指定节点. TreeSet 和 TreeMap 的关系 为了让大家了解 TreeMap 和 Tre ...
- Redis Key 过期策略
redis 官方提供的 conf https://raw.github.com/antirez/redis/2.2/redis.conf 中6中过期策略的具体方式.redis 中的默认的过期策略是vo ...
- mongo 内存限制wiredTigerCacheSizeGB = 10
[root@iZ2zed126f44v90yv59ht3Z rabbitmq]# cat /usr/local/mongodb/mongodb.confport = 27017dbpath = /us ...
- R工具包
直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和爬一些R的资料,看着看着就入迷了,这就是个大宝库了,以前怎么没发现,看来还是太狭隘了.直到前几天我看到这个 ...
- matlab 等值线函数 contour
matlab 等值线函数 contour contour是等高线绘制函数我并没怎么用过这个函数,只是参照help将上面的英文翻译一下,如果有错误,请大家提出来.contour(Z)根据矩阵Z画出等高线 ...
- getaddrinfo ENOTFOUND https://api.weixin.qq.com https://api.weixin.qq.com:443
原因:这是由于你当前的主机不能够连接到你填写的url. 解决方法: 先ping api.weixin.qq.com ping不通的话,就是外网访问的问题. 开通外网访问就可以了.
- PHP高手修炼50法——勤快篇
.把PHP当成一门新的语言学习: .看<PHP与mysql5?web?开发技术详解>和<PHP高级程序设计:模式.框架与测试>: .不要被VC.BCB.BC.MC.TC等词汇所 ...
- 使用ffmpeg获取视频流后如何封装存储成mp4文件
int main(int argc,char *argv[]) 02 { 03 AVFormatContext *pFormatCtx; 04 int i,videoStream; 05 AVC ...
- ScreenPointToRay - 近视口到屏幕的射线
正如题目所说,ScreenPointToRay可以计算从Camera的近视口nearClip向前发射一条射线到屏幕上的点的坐标. 函数原型为: public Ray ScreenPointToRay( ...
- c++ 转化
atof(将字符串转换成浮点型数)相关函数atoi,atol,strtod,strtol,strtoul表头文件#include定义函数double atof(const char *nptr);函数 ...