HTTP binding for OpenMessaging specification
At present, many message middlewares on the cloud provide http services, such as SNS, SQS in AWS, MNS in Alibaba Cloud, etc., with the rapid spread of http2, there will be more messaging services using http transmission in the future. So many users hope that OpenMessaging can provide binding to the http message service to help users quickly access the messaging services of various vendors.
I would like to propose a simple http binding first. The main idea is simple, and the message model in OMS consist of four parts, I just map these parts into http protocol. The version is put in the url. The message headers are put in http header and prefixed with OMS. The user properties are put in the request headers, and the message body is in the http body and we set Content-Type to application/octet-stream. For the example api in the specification, the http binding would be like the following.
POST /version/1.0.0?service=helloService HTTP/1.1
Host: openmessaging.cloud Content-Type: application/octet-stream Content-Length: 11 OMS-Message-Id: 7F00000100002873000000000004F49C OMS-Born-Timestamp: 1533780827824 OMS-Born-Host: 172.24.0.101:10035 OMS-Store-Timestamp: 1533780827825 OMS-Store-Host: 172.24.0.102:52511 OMS-Expire-Time: 1533780830000 OMS-Priority: 1 OMS-Compression: gzip OMS-Trace-Id: 1E0578887D3F18B4AAC22B64D2B00A5E OMS-Transaction-Id: 1E0578887D3F18B4AAC22B64D2B40A62 OMS-Destination: orderQueue OMS-Message-Key: orderId-103368921567 OMS-Delay-Time: 30000 OMS-Durability: 1 OMS-Correlation-Id: 7F00000100002873000000000004F2B4
hello world