Skip to navigation

Acquire or renew a consumer lease

Acquires, takes over or renews a lease on a consumer group’s partitions, and returns the group’s committed cursor for them.

A consumer group belongs to your application and is named by consumer: another application’s group with the same name is a different group. Only an application token can call this operation. See the event feed.

Acquire or renew

  • Without fencingToken, the call acquires the requested partitions (all 16 by default) when no other member holds a live lease on any of them, and EVVA generates a new fencing token (opaque to your application: compare tokens only for equality). Otherwise it answers 409 LEASE_HELD with Retry-After.
  • With the member’s current fencingToken, it renews the lease.

Where reading starts

A partition never committed starts at the oldest retained event. A committed one resumes where it was; if retention passed it while nobody consumed, the next read answers 410. Checkpoints hold positions only, never event data.

Consumer group limit

Your application can hold a limited number of consumer groups. Only groups active within the idle window count, and an existing group is never refused.

An idle group is retired. A group that still owes its consumer a 410 is kept for a further grace period; a group that owes nothing is kept for the feed’s retention plus that grace. After that its name resets: the name starts a new group, with a new groupId, from the oldest retained event, and the old group’s fencing tokens are refused.

Errors

  • 409 LEASE_HELD — another member holds a live lease on a requested partition. Retry after Retry-After seconds.
  • 409 STALE_FENCING_TOKEN — the fencingToken belongs to an earlier incarnation of this group, which was retired and created again. Acquire without it.
  • 409 CONSUMER_GROUP_LIMIT_REACHED — a new consumer name past your application’s consumer-group limit (details.limit). Reuse an existing name.

Authentication

AuthorizationBearer

OAuth 2.0 client credentials. Request an access token at POST /partner/v1/oauth/token (grant_type=client_credentials) with the application’s client secret or a private_key_jwt assertion, then send it as Authorization: Bearer evpa_live_… (or evpa_test_… for a sandbox application). Tokens are opaque and short lived (see expires_in); there is no refresh token. Each operation lists the scopes it requires.

Query parameters

consumerstringRequiredformat: "^[A-Za-z0-9._:-]{1,64}$"

The consumer-group name.

partitionsstringOptional<=64 characters

Comma-separated distinct partitions in 0..15; omit for all 16.

fencingTokenstringOptionalformat: "^[1-9][0-9]{0,15}$"
The member's current fencing token, to renew its lease. Omit it to acquire.

Response headers

X-Request-IdstringOptionalformat: "^[A-Za-z0-9._-]{1,128}$"
The request's id, echoed from your request or generated by EVVA. Quote it when you report a problem.

Response

Leased (acquired, taken over after expiry, or renewed).

consumerstring
cursorstring

Opaque; covers exactly partitions — pass it as after to read them.

fencingTokenstringformat: "^[1-9][0-9]{0,15}$"

A consumer-group member’s fencing token: a positive integer, sent and returned as a decimal string. It is opaque and specific to your application, so compare tokens only for equality, never by size. A takeover issues a new one, and a renewal or a commit under a superseded one is refused with 409 STALE_FENCING_TOKEN.

leaseExpiresAtdatetime
partitionslist of integers
groupIdstringOptionalformat: "uuid"

This incarnation of the consumer group. A different value than the one a member last saw means the group was retired and created again: its earlier tokens are refused (409 STALE_FENCING_TOKEN) and it restarts at the oldest retained event.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error