Skip to content

Publishing messages

Publishing messages is done by sending a HTTP POST request to the following endpoint:

http://bunny-rest-proxy.host:3672/publish/<queueName>

HTTP Request Headers

  • Content-Type (required): either application/octet-stream for binary publishers or application/json for JSON publishers
  • X-Bunny-Persistent: mark the message as persistent (surviving broker restarts; defaults to true)
  • X-Bunny-AppID: optional ID of the program publishing the message
  • X-Bunny-CorrelationID: optional correlation ID to be attached to the published message
  • X-Bunny-Identity: optional sender identity name
  • X-Bunny-Token: optional sender identity token

Possible Response Codes

  • 201: Message sent successfully
  • 400: Payload schema validation failed
  • 403: Identity authorization failed or credentials not provided request headers
  • 415: Unsupported content type
  • 500: Something unexpected and rather bad happened.
  • 502: An AMQP error occurred when sending the message to the queue.
  • 503: Bunny REST Proxy is during the graceful shutdown process.

Response Body

In case of the message being sent successfully, JSON response containing the following keys is returned:

  • contentLengthBytes: number of bytes of the sent message body
  • messageId: UUID of the message generated by Bunny REST Proxy