Request

Path Method Description
/rest/produce POST Publish a message to
MigratoryData or MigratoryData KE

Request Parameters

The following request parameters can be used when sending a produce request. They correspond to the message attributes detailed in the Concepts section.

Name Type Required? Description
subject string yes subject of the messages
token string yes auth token of the client
closure string no closure of the message
default: send timestamp
retained true /
false
no retain or not message
default: true
qos standard / guaranteed no qos of the message
default: guaranteed

Example

To send a message with the content Hello there, on the subject /crm/qa, provided that you have the authorization token u123 for publication, to MigratoryData or MigratoryData KE deployed at the address https://example.com, use the following HTTP request:

curl -d 'Hello there' -X POST \
'https://example.com/rest/produce?token=u123&subject=/crm/qa'

Response

Response Schema

The response to a produce request is a JSON string with the following schema:

{
    "subject": "string",
    "closure": "string",
    "status": "OK|FAILED|DENY|MESSAGE_SIZE_LIMIT_EXCEEDED"
}

Example

The response to the produce request above could be something as follows:

{
    "subject": "/crm/qa",
    "closure": "1613637611733",
    "status": "OK"
}
Even if the parameter closure is not included into the request, it is present in the response with the default value, which is the timestamp when the request is received by MigratoryData or MigratoryData KE.