Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and Android. Generated with openapi-generator kotlin (library=jvm-okhttp4, useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai. Co-authored-by: Hanzo Dev <[email protected]>
14 KiB
ConsumersApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| mqCreateConsumer | POST /v1/mq/streams/{stream}/consumers | Create consumer |
| mqDeleteConsumer | DELETE /v1/mq/streams/{stream}/consumers/{name} | Delete consumer |
| mqGetConsumer | GET /v1/mq/streams/{stream}/consumers/{name} | Get consumer info |
| mqListConsumers | GET /v1/mq/streams/{stream}/consumers | List consumers |
| mqPullMessages | POST /v1/mq/streams/{stream}/consumers/{name}/next | Pull next message(s) |
| pubsubCreateConsumer | POST /v1/pubsub/jetstream/streams/{stream}/consumers | Create a consumer |
| pubsubDeleteConsumer | DELETE /v1/pubsub/jetstream/streams/{stream}/consumers/{consumer} | Delete a consumer |
| pubsubGetConsumer | GET /v1/pubsub/jetstream/streams/{stream}/consumers/{consumer} | Get consumer info |
| pubsubListConsumers | GET /v1/pubsub/jetstream/streams/{stream}/consumers | List consumers |
mqCreateConsumer
MqConsumer mqCreateConsumer(stream, mqConsumerConfig)
Create consumer
Creates a new consumer on the specified stream. Consumers track delivery state and support at-least-once or exactly-once semantics depending on the ack policy.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String | Stream name.
val mqConsumerConfig : MqConsumerConfig = // MqConsumerConfig |
try {
val result : MqConsumer = apiInstance.mqCreateConsumer(stream, mqConsumerConfig)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#mqCreateConsumer")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#mqCreateConsumer")
e.printStackTrace()
}
Parameters
| stream | kotlin.String| Stream name. | |
| Name | Type | Description | Notes |
|---|---|---|---|
| mqConsumerConfig | MqConsumerConfig |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
mqDeleteConsumer
mqDeleteConsumer(stream, name)
Delete consumer
Deletes a consumer and its delivery state. Unacknowledged messages remain in the stream.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String | Stream name.
val name : kotlin.String = name_example // kotlin.String | Consumer name.
try {
apiInstance.mqDeleteConsumer(stream, name)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#mqDeleteConsumer")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#mqDeleteConsumer")
e.printStackTrace()
}
Parameters
| stream | kotlin.String| Stream name. | |
| Name | Type | Description | Notes |
|---|---|---|---|
| name | kotlin.String | Consumer name. |
Return type
null (empty response body)
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
mqGetConsumer
MqConsumer mqGetConsumer(stream, name)
Get consumer info
Returns consumer configuration and delivery state including pending count, ack floor, and redelivery metrics.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String | Stream name.
val name : kotlin.String = name_example // kotlin.String | Consumer name.
try {
val result : MqConsumer = apiInstance.mqGetConsumer(stream, name)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#mqGetConsumer")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#mqGetConsumer")
e.printStackTrace()
}
Parameters
| stream | kotlin.String| Stream name. | |
| Name | Type | Description | Notes |
|---|---|---|---|
| name | kotlin.String | Consumer name. |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
mqListConsumers
MqListConsumers200Response mqListConsumers(stream, limit, offset)
List consumers
Returns all consumers for the specified stream.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String | Stream name.
val limit : kotlin.Int = 56 // kotlin.Int | Maximum number of items to return.
val offset : kotlin.Int = 56 // kotlin.Int | Number of items to skip.
try {
val result : MqListConsumers200Response = apiInstance.mqListConsumers(stream, limit, offset)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#mqListConsumers")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#mqListConsumers")
e.printStackTrace()
}
Parameters
| stream | kotlin.String| Stream name. | | | limit | kotlin.Int| Maximum number of items to return. | [optional] [default to 100] |
| Name | Type | Description | Notes |
|---|---|---|---|
| offset | kotlin.Int | Number of items to skip. | [optional] [default to 0] |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
mqPullMessages
MqGetStreamMessages200Response mqPullMessages(stream, name, mqPullMessagesRequest)
Pull next message(s)
Pulls the next batch of messages from the consumer. Supports configurable batch size, timeout, and no-wait mode.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String | Stream name.
val name : kotlin.String = name_example // kotlin.String | Consumer name.
val mqPullMessagesRequest : MqPullMessagesRequest = // MqPullMessagesRequest |
try {
val result : MqGetStreamMessages200Response = apiInstance.mqPullMessages(stream, name, mqPullMessagesRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#mqPullMessages")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#mqPullMessages")
e.printStackTrace()
}
Parameters
| stream | kotlin.String| Stream name. | | | name | kotlin.String| Consumer name. | |
| Name | Type | Description | Notes |
|---|---|---|---|
| mqPullMessagesRequest | MqPullMessagesRequest | [optional] |
Return type
MqGetStreamMessages200Response
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
pubsubCreateConsumer
PubsubConsumerInfo pubsubCreateConsumer(stream, pubsubConsumerConfig)
Create a consumer
Create a durable or ephemeral consumer on a stream.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String |
val pubsubConsumerConfig : PubsubConsumerConfig = {"durable_name":"order-processor","ack_policy":"explicit","filter_subject":"orders.created"} // PubsubConsumerConfig |
try {
val result : PubsubConsumerInfo = apiInstance.pubsubCreateConsumer(stream, pubsubConsumerConfig)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#pubsubCreateConsumer")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#pubsubCreateConsumer")
e.printStackTrace()
}
Parameters
| stream | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| pubsubConsumerConfig | PubsubConsumerConfig |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
pubsubDeleteConsumer
pubsubDeleteConsumer(stream, consumer)
Delete a consumer
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String |
val consumer : kotlin.String = consumer_example // kotlin.String |
try {
apiInstance.pubsubDeleteConsumer(stream, consumer)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#pubsubDeleteConsumer")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#pubsubDeleteConsumer")
e.printStackTrace()
}
Parameters
| stream | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| consumer | kotlin.String |
Return type
null (empty response body)
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
pubsubGetConsumer
PubsubConsumerInfo pubsubGetConsumer(stream, consumer)
Get consumer info
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String |
val consumer : kotlin.String = consumer_example // kotlin.String |
try {
val result : PubsubConsumerInfo = apiInstance.pubsubGetConsumer(stream, consumer)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#pubsubGetConsumer")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#pubsubGetConsumer")
e.printStackTrace()
}
Parameters
| stream | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| consumer | kotlin.String |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
pubsubListConsumers
PubsubListConsumers200Response pubsubListConsumers(stream)
List consumers
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ConsumersApi()
val stream : kotlin.String = stream_example // kotlin.String |
try {
val result : PubsubListConsumers200Response = apiInstance.pubsubListConsumers(stream)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConsumersApi#pubsubListConsumers")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConsumersApi#pubsubListConsumers")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| stream | kotlin.String |
Return type
PubsubListConsumers200Response
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json