Consume Service

Overview

The consume service can be used to consume messages from a stream. The Rest Proxy supports multiple datatypes for key and value. Headers are returned as name and list of not supported

API Specification

Endpoint

<baseurl>/stream/{environment}/{stream}

HTTP Method

GET

Path Variable

environment

The environment short name as specified in the Self Service definition

Path Variable

stream

The stream name as specified in the Self Service definition

Request

HTTP Header

Content-Type

application/json

HTTP Header

AXUAL-CONSUMER-UUID

(required) The unique consumer instance id (example, 5 parallel consumers would use different consumer uuid)

HTTP Header

AXUAL-APPLICATION-ID

(required) The application id of the the producer application as specified in the Self Service

HTTP Header

AXUAL-APPLICATION-VERSION

(optional) The version of the the producer application

HTTP Header

AXUAL-KEY-TYPE

(required) Contains the type of the key data, this should match with the data used in the stream. Can be NULL, AVRO, AVROJSON or STRING

HTTP Header

AXUAL-VALUE-TYPE

(required) Contains the type of the value data, this should match with the data used in the stream. Can be NULL, AVRO, AVROJSON or STRING

HTTP Header

AXUAL-MAX-MESSAGES-RETURNED

(optional) The maximum number of messages to be returned for the call.

HTTP Header

AXUAL-AUTO-OFFSET-RESET

(optional) This controls if the stream should be read from the begin (EARLIEST) or the end(LATEST) if no offset has been found. Defaults to EARLIEST

HTTP Header

AXUAL-COMMIT-STRATEGY

(required) This controls the offset should be committed on next consume call or immediately after the read for the current consume call. Valid values are AFTER_READ and NEXT_CONSUME

HTTP Header

AXUAL-POLLING-TIMEOUT-MS

(optional) The amount of time to wait for the backend poll to complete. During creation of the backend consumer or rebalance this might result in an empty response. This delay during creation/rebalance should normally not take more than 10 seconds. Default value is 500

Response

HTTP Status Code

200

HTTP Header

Content-Type

application/json

HTTP Body

JSON Object

ConsumeResponse

Error responses

HTTP Status Code

403

Not authorized to access the stream

HTTP Status Code

404

Stream and environment combination not found

HTTP Status Code

500

Generic Internal Error

HTTP Header

Content-Type

application/json

HTTP Body

JSON Object

AxualRestException