Topics

Runtime information about a tenant's topic

Invoke the create-topic operation

In the websocket API, a topic is automatically created when opened the first time. In the REST api, topics have to be explicitly created

SecurityaccessToken
Request
query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
One of:
num-chunks
integer <uint32>

Number of chunks to store on disk for the topic. This decides the total size of the topic. Each chunk is 1 MB. When chunk num-chunks + 1 is needed, chunk 1 is discarded, etc.

name
required
string <topic-name> ^[0-9A-Za-z+_=:@.-]+$

The name of the topic

replication-factor
integer <uint32>
Default: 1

Integer deciding how many replicas to create for a topic. Always use an odd number. A majority of replicas is required for a topic to be operational.

persistence
string <enumeration>
Default: "disk"
  • disk
  • ram

disk means the topic is persistent on the host where it was originally placed at creation time. If ram is used, replication-factor is implicitly 1.

local-placement
boolean
Default: false

Include the host handling the request in the replication set. For topics with replication-factor 1, this means that the host handling the request is guaranteed to become the topic handler and the topic can never be moved to another host. For topics with higher replication factors, the host handling the request will be part of the initial replication set as long as its maintenance-mode is not set to out-of-service, but the topic can be moved to other hosts later as needed.

format
required
string <enumeration>
  • string: The message payload is a string.
  • json: The message payload is an arbitrary json object.

The format of messages on this topic.

max-days
integer <uint32>

Number of days to keep messages on this topic. If not set, messages will be kept until the topic is full.

encryption
string <enumeration>
  • signature
  • full

Valid when: not(../persistence) or (../persistence = 'disk')

Messages can be encrypted or cryptograhically signed when written to disk.

transit-key
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

Valid when: not(../persistence) or (../persistence = 'disk')

Transit key to use for signing or encryption. If the key does not already exist it will be created automatically.

Responses
204

No Content

400
401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

post/v1/state/volga/create-topic
Request samples
name: mytopic
replication-factor: 3
persistence: disk
local-placement: false
max-size: 10 MiB
format: json
max-days: 100
encryption: full
transit-key: mykey
Response samples
No sample

Retrieve all topic infos

SecurityaccessToken
Request
query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

keys
string <enumeration>

Retrieve only the keys for the list

Value: "true"
count
string <enumeration>

Retrieve only the number of elements in the list

Value: "true"
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

get/v1/state/volga/topics
Response samples
- name: system:container-logs:alpine.my-srv-1.alpine
  archived:
    original-name: system:prev-container-logs:alpine.my-srv-1.alpine
    archive-time: 2022-09-01T22:20:24Z
    archive-days: 5
  tenant: telco
  labels:
    system/controller: "true"
  format: json
  max-size: 9.54 MiB
  max-days: 14
  creation-time: 2022-09-01T08:40:48.484Z
  requested-replication-factor: 3
  current-replication-factor: 1
  persistence: disk
  encryption: full
  transit-key: mykey
  assigned-hosts:
    - h01
  unsynced-hosts: []
  leader-host: h01
  worker-hosts: []
  size: 53.36 KiB
  entries: 41
  oldest-entry: 2022-09-01T22:19:23Z
  last-entry: 2022-09-01T22:20:23Z
  seqno: 41
  chunkno: 1
  dropped-chunks: 0
  producers:
    - name: notifications
      site: control-tower
      host: h01
  consumers:
    - name: myconsumer
      mode: exclusive
      last-delivered-seqno: 41
      last-acked-seqno: 30
      buffered-messages: 0
      blocking-producer: false
      dropped-messages: 0
      clients:
        - site: control-tower
          host: h01
          more-n: 64
  

Retrieve a topic info

SecurityaccessToken
Request
path Parameters
topic-info-name
required
string <topic-name> ^[0-9A-Za-z+_=:@.-]+$

Name of the topic

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

get/v1/state/volga/topics/{topic-info-name}
Response samples
name: system:container-logs:alpine.my-srv-1.alpine
archived:
  original-name: system:prev-container-logs:alpine.my-srv-1.alpine
  archive-time: 2022-09-01T22:20:24Z
  archive-days: 5
tenant: telco
labels:
  system/controller: "true"
format: json
max-size: 9.54 MiB
max-days: 14
creation-time: 2022-09-01T08:40:48.484Z
requested-replication-factor: 3
current-replication-factor: 1
persistence: disk
encryption: full
transit-key: mykey
assigned-hosts:
  - h01
unsynced-hosts: []
leader-host: h01
worker-hosts: []
size: 53.36 KiB
entries: 41
oldest-entry: 2022-09-01T22:19:23Z
last-entry: 2022-09-01T22:20:23Z
seqno: 41
chunkno: 1
dropped-chunks: 0
producers:
  - name: notifications
    site: control-tower
    host: h01
consumers:
  - name: myconsumer
    mode: exclusive
    last-delivered-seqno: 41
    last-acked-seqno: 30
    buffered-messages: 0
    blocking-producer: false
    dropped-messages: 0
    clients:
      - site: control-tower
        host: h01
        more-n: 64

Invoke the change-options operation

Change options for an existing topics

SecurityaccessToken
Request
path Parameters
topic-info-name
required
string <topic-name> ^[0-9A-Za-z+_=:@.-]+$

Name of the topic

query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
One of:
num-chunks
integer <uint32>

Number of chunks to store on disk for the topic. This decides the total size of the topic. Each chunk is 1 MB. When chunk num-chunks + 1 is needed, chunk 1 is discarded, etc.

max-days
integer <uint32>

Number of days to keep messages on this topic. If not set, messages will be kept until the topic is full.

Responses
204

No Content

400
401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

post/v1/state/volga/topics/{topic-info-name}/change-options
Request samples
max-size: 100 MB
max-days: 30
Response samples
No sample

Invoke the consume operation

SecurityaccessToken
Request
path Parameters
topic-info-name
required
string <topic-name> ^[0-9A-Za-z+_=:@.-]+$

Name of the topic

query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
One of:
position
string <enumeration>
Default: "beginning"
  • beginning: Start consuming from the beginning of the stream. If the topic has wrapped, i.e., started to drop chunks, the first message will be the oldest one remaining on the topic.
  • end: Start consuming from the end of the stream
  • unread: Start consuming from last acked message plus one

Indicates where to start consuming in the topic stream

topic-tag
string

If topic-tag is set, only messages produced with the same topic-tag will be received by this consumer. This can be useful when multiple applications need to share the same topic of infra.

re-match
string

Consume only messages that match this Perl RE pattern, and just skip all other messages.

invert-match
boolean

Must have the value true.

Invert the match provided by the re-match pattern

fields
string <select-fields-expression>

A string that matches:

expr = term \*( ',' term )
term = path \*( '/' '[' expr ']' )
path = field-name [ '/' path ]
field-name = identifier / identifier '=' identifier

For example:

  • fields=foo,bar - selects the fields foo and bar
  • fields=foo/bar - selects the fields bar in foo
  • fields=foo/[bar,baz] - selects bar and baz in foo
  • fields=foo=x - selects foo, and renames foo to x in the output

Volga can trim incoming messages, delivering only the fields given here.

follow
boolean
Default: false

In follow mode, the client will continue to consume, although the last message in the topic has been delivered. By default the client will receive a socket close when the topic has been exhausted.

payload-only
boolean
Default: false

By default, a REST consumer will receive JSON structs, with sequence number and more. With this option, only the payload is delivered. This option is useful when viewing plain text logs.

ignore-all-filters
boolean
Default: false

Receive messages regardless of filters such as topic-tags and destination sites. This is sometime useful for debugging

compact-output
boolean
Default: false

DEPRECATED - will be removed.

Deprecated, use accept header application/jsonlines to get new-line separated json.

Responses
204

No Content

400
401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

post/v1/state/volga/topics/{topic-info-name}/consume
Request samples
position-timestamp: 2022-01-01T00:00:00Z
topic-tag: mytag
re-match: path.*topics
fields: payload/user
follow: false
payload-only: false
ignore-all-filters: false
compact-output: false
Response samples
No sample

Invoke the delete operation

Delete a topic from the site

SecurityaccessToken
Request
path Parameters
topic-info-name
required
string <topic-name> ^[0-9A-Za-z+_=:@.-]+$

Name of the topic

query Parameters
site
string

Send the request to the specfifed site

Responses
204

No Content

400
401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

post/v1/state/volga/topics/{topic-info-name}/delete
Response samples
No sample

Invoke the produce operation

Produce a single item to a topic

SecurityaccessToken
Request
path Parameters
topic-info-name
required
string <topic-name> ^[0-9A-Za-z+_=:@.-]+$

Name of the topic

query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
payload
required
object

The payload of the message

topic-tag
string

If set, the message will only reach consumers listening for this specific topic-tag.

Responses
204

No Content

400
401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

post/v1/state/volga/topics/{topic-info-name}/produce
Request samples
payload: Hello world
topic-tag: mytag
Response samples
No sample