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的解析器,它可以很好的处理不规范标记并生成剖 ...
随机推荐
- C语言 · 淘淘的名单
算法提高 淘淘的名单 时间限制:100ms 内存限制:8.0MB 问题描述 by ZBY... :) 淘淘拿到了一份名单,他想对上面的名字进行处理,挑出一些特殊的名字,他请你来帮忙. ...
- MySQL5.7远程连接和增加密码
主要是5.7的很多操作和以前版本不一样,所以踩了很多坑. 1. 远程连接cant connect to mysql (10061) 一开始以为是权限问题,所以参考了详解 MySQL 5.7 新的权限与 ...
- d3js把circle和rect连接在一起
怎么办呢...哎...突然就必须全选中了.... 但是...一不小心想到 在g里面都添加circle和rect 但是根据tpye可以让circle的r为0或者rect的width和height为0,这 ...
- Javascript中最常用的61个经典技巧[转]
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键<table border oncontextmenu= ...
- 使用特殊构造的5GB文件测试Win2012Dedup功能
WinServer2012一个崭新的功能就是支持重复数据删除功能.为了测试这个功能的情况,特别构造了一个特殊的5GB文件用于此次测试.惯例,先说下测试环境的搭建1 使用ESXi5上的版本8的VM,安装 ...
- 采用thinkphp中f方法实现快速缓存实例
一般使用文件方式的缓存就能够满足要求,而thinkphp还提供了一个专门用于文件方式的快速缓存方法f方法. 由于采用的是php返回方式,所以其效率较s方法较高. f方法具有如下特点: 1.简单数据缓存 ...
- 谷哥的小弟学后台(04)——MySQL(4)
探索Android软键盘的疑难杂症 深入探讨Android异步精髓Handler 具体解释Android主流框架不可或缺的基石 站在源代码的肩膀上全解Scroller工作机制 Android多分辨率适 ...
- ImportError: No module named Crypto.Cipher
from Crypto.Cipher import AES 报错: ImportError: No module named Crypto.Cipher 解决方法: pip install pycry ...
- unity3d中的DontDestroyOnLoad来回切换出现多个实例问题
在用Unity3D开发游戏中,我们会经常创建多个场景,但是在场景过度的时候,通常场景中的对象会被删除.所以Unity3D给了我们一个不删除前一个 场景中的某一个对象或者脚本的API,那就是“DontD ...
- Spring MVC异常统一处理
package com.shzq.common.exception; import java.io.PrintWriter;import java.io.StringWriter;import jav ...