Produce Service
Overview
The produce service can be used to produce individual messages to a stream. The Rest Proxy supports multiple datatypes for key and value. Producing custom headers is not supported.
Lifecycle
For every produce call the REST Proxy unloads the SSL context and runs the ACL checks against the stream on which the produce is made.
If access is granted, a producer will be created internally and cached using the AXUAL-PRODUCER-UUID
provided in the HTTP Headers
.
The rest of the provided http headers are used to initialize the producer which then will be reused in subsequent calls (given the same AXUAL-PRODUCER-UUID
).
That producer object remains cached for a period of time that is dictated by a REST Proxy configuration parameter (namely axual.producer.cache-ttl-ms
), which defaults to 6 minutes.
Producer objects are evicted from the cache after axual.producer.cache-ttl-ms
of inactivity.
API Specification
HTTP Request Structure
End Point |
<baseurl>/stream/{environment}/{stream} |
HTTP Method |
|
Content-Type |
|
Path Variables
Path Variable |
Description |
|
The environment |
|
The stream name as specified in the Self Service definition |
HTTP Headers
Header Name |
Require / Optional |
Description |
|
Required |
The unique consumer instance id used to identify the consumer object for the session |
|
Required |
The application id of the the producer application as specified in the Self Service |
|
Optional |
The version of the the producer application |
|
Optional |
The acknowledgement waiting strategy to be used, NONE doesn’t wait, SINGLE waits for the target acknowledgement, ALL waits for the replication acknowledgement. Defaults to SINGLE |
|
Optional |
The strategy for ordering, KEEPING will ensure delivery or the message in order. With LOSING messages can overtake other messages. Defaults to LOSING |
|
Optional |
How long does the call wait for delivery in milliseconds. Valid Range 50 - 60000, defaults to 30000 |
|
Optional |
How long does sending engine wait for extra messages in the batch. Valid range 0-2000 defaults to 50 |
The UUID needs to be unique (guaranteed by using a UUID generator), generated prior to the producer loop. This way the producer object created internally is unique to the produce session |