HTTP DELETE 訂閱主題請求協議和響應協議
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21240_.htmhtml
請求響應頭各個字段的含義的講解
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21250_.htmjava
響應錯誤處理
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzau.doc/ts21340_.htmapp
The HTTP DELETE operation gets a message from a WebSphere® MQ queue, or retrieves a publication from a topic. The message is removed from the queue. If the publication is retained, it is not removed. A response message is sent back to the client including information about the message.ui
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---------------------'
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-----------'
If the HTTP DELETE request is successful, the response message contains the data retrieved from the WebSphere MQ queue. The number of bytes in the body of the message is returned in the HTTP Content-Length header. The status code for the HTTP response is set to 200 OK. If x-msg-range is specified as 0, or0-0, then the status code of the HTTP response is 204 No Content.this
If the HTTP DELETE request is unsuccessful, the response includes a WebSphere MQ bridge for HTTP error message and an HTTP status code.url
HTTP DELETE gets a message from a queue and deletes the message, or retrieves and deletes a publication. The HTTPDELETE Java sample is an example an HTTP DELETE request reading a message from a queue. Instead of using Java, you could create an HTTP DELETE request using a browser form, or an AJAX toolkit instead.spa
Figure 1 is an HTTP request to delete the next message on queue called myQueue. In response, the message body is returned to the client. In WebSphere MQ terms, HTTP DELETE is a destructive get..net
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.code
DELETE /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.orm
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.
HTTP DELETE訂閱主題信息