Study on Mqtt Learning (ix) using HTTP GET mqtt to crawl Messaging server usage

Source: Internet
Author: User
Tags http post

Official documents:


HTTP GET receive Subject Request protocol and Response Protocol
Http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21230_.htm


HTTP Post issue topic request Protocol and Response Protocol
Http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21220_.htm

HTTP DELETE Subscription Topic Request Protocol and Response Protocol
Http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21240_.htm

Explanation of the meaning of each field in the request response header
Http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21250_.htm


Response error Handling
Http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21340_.htm

HTTPGet: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--+-------------+-+--/--------------|                    | ' [Email protected]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---------------------‘
Note:
    1. If a question mark (?) is used it must was substituted with %3f . For example, orange?topic should is specified as orange%3ftopic.
    2. @ is only valid in an qMgrName 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-----------‘
HTTPGET Example

HTTP GET Gets a message from a queue. The message remains on the queue. In WebSphere MQ terms, an 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 a HTTP request to browse the next message on the 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 was to receive the M Essage correlation ID in the response.

Figure 1. Example of an HTTP GET request
Get/msg/queue/myqueue/http/1.1host:www.example.orgx-msg-wait:10x-msg-require-headers:correlid

Figure 2 are the response returned to the client. The correlation ID is returned to the client and as requested in x-msg-require-headers of the request.

Figure 2. Example of an HTTP GET response
http/1.1 okdate:wed, 2 Jan 22:38:34 gmtserver:apache-coyote/1.1 wmq-http/1.1 jee-bridge/1.1content-length:50co Ntent-type:text/plain; Charset=utf-8x-msg-correlid:1234567890here ' s my message body that would appear on the queue.

Study on Mqtt Learning (ix) using HTTP GET mqtt to crawl Messaging server usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.