File: pubsub.fbs

package info (click to toggle)
python-autobahn 22.7.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,404 kB
  • sloc: python: 38,356; javascript: 2,705; makefile: 905; ansic: 371; sh: 63
file content (240 lines) | stat: -rw-r--r-- 8,449 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240

//////////////////////////////////////////////////////////////////////////////
//
//   FlatBuffers schema for WAMP v2 messages
//   Copyright (c) Crossbar.io Technologies GmbH and contributors
//   Licensed under the MIT License (MIT)
//
//////////////////////////////////////////////////////////////////////////////

include "types.fbs";

namespace wamp.proto;


// SUBSCRIBE message (message_type = 32): [SUBSCRIBE, Request|id, Options|dict, Topic|uri]
table Subscribe
{
    // The WAMP request ID of this request.
    request: uint64 (key);

    // The WAMP or application URI of the PubSub topic the event should be published to.
    topic: string (required, uri_pattern);

    // The topic matching method to be used for the subscription.
    match: Match = EXACT;

    // Whether the client wants the retained message we may have along with the subscription.
    get_retained: bool;
}


// SUBSCRIBED message (message_type = 33): [SUBSCRIBED, SUBSCRIBE.Request|id, Subscription|id]
table Subscribed
{
    // The request ID of the original SUBSCRIBE request.
    request: uint64 (key);

    // The subscription ID for the subscribed topic (or topic pattern).
    subscription: uint64;
}


// UNSUBSCRIBE message (message_type = 34): [UNSUBSCRIBE, Request|id, SUBSCRIBED.Subscription|id]
table Unsubscribe
{
    // The WAMP request ID of this request.
    request: uint64 (key);

    // The subscription ID for the subscription to unsubscribe from.
    subscription: uint64;
}


// UNSUBSCRIBED message (message_type = 35): [UNSUBSCRIBED, UNSUBSCRIBE.Request|id, Details|dict]
table Unsubscribed
{
    // The request ID of the original UNSUBSCRIBE request or 0 if the router triggered the unsubscribe ("router subscription revocation signaling").
    request: uint64 (key);

    // If unsubscribe was actively triggered by router, the ID of the subscription revoked.
    subscription: uint64;

    // The reason (an URI) for an active (router initiated) revocation.
    reason: string (uri);
}


// PUBLISH message (message_type = 16): [PUBLISH, Request|id, Options|dict, Topic|uri, Payload|binary]
table Publish
{
    // The WAMP request ID of this request.
    request: uint64 (key);

    // The WAMP or application URI of the PubSub topic the event should be published to.
    topic: string (required, uri);

    /// Positional values for application-defined event payload.
    args: [uint8];

    /// Keyword values for application-defined event payload.
    kwargs: [uint8];

    /// Alternative, transparent payload. If given, ``args`` and ``kwargs`` must be left unset.
    payload: [uint8];

    // The encoding algorithm that was used to encode the payload.
    enc_algo: Payload;

    // The payload object serializer that was used encoding the payload.
    enc_serializer: Serializer;

    // When using Payload.CRYPTOBOX, the public Cryptobox key of the key pair used for encrypting the payload.
    enc_key: [uint8];

    // If true, acknowledge the publication with a success or error response.
    acknowledge: bool;

    // If true, exclude the publisher from receiving the event, even if he is subscribed (and eligible).
    exclude_me: bool = true;

    // List of WAMP session IDs to exclude from receiving this event.
    exclude: [uint64];

    // List of WAMP authids to exclude from receiving this event.
    exclude_authid: [string] (principal);

    // List of WAMP authroles to exclude from receiving this event.
    exclude_authrole: [string] (principal);

    // List of WAMP session IDs eligible to receive this event.
    eligible: [uint64];

    // List of WAMP authids eligible to receive this event.
    eligible_authid: [string] (principal);

    // List of WAMP authroles eligible to receive this event.
    eligible_authrole: [string] (principal);

    // If true, request the broker retain this event.
    retain: bool;

    // Application provided transaction hash for router-side throttle/deduplicate.
    transaction_hash: string;

    // When this message is forwarded in router-to-router traffic, the route of the message in tuples of (session, authid, authrole) beginning with the publisher session followed by a series of router-link sessions.
    forward_for: [Principal];
}


// PUBLISHED message (message_type = 17): [PUBLISHED, PUBLISH.Request|id, Publication|id]
table Published
{
    // The request ID of the original PUBLISH request.
    request: uint64 (key);

    // The publication ID for the published event.
    publication: uint64;
}


// EVENT message (message_type = 36): [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Payload|binary]
table Event
{
    // The subscription ID this event is dispatched under.
    subscription: uint64;

    // The publication ID of the dispatched event.
    publication: uint64;

    /// Positional values for application-defined event payload.
    args: [uint8];

    /// Keyword values for application-defined event payload.
    kwargs: [uint8];

    /// Alternative, transparent payload. If given, ``args`` and ``kwargs`` must be left unset.
    payload: [uint8];

    // The encoding algorithm that was used to encode the payload.
    enc_algo: Payload;

    // The payload object serializer that was used encoding the payload.
    enc_serializer: Serializer;

    // When using Payload.CRYPTOBOX, the public Cryptobox key of the key pair used for encrypting the payload.
    enc_key: [uint8];

    // The WAMP session ID of the pubisher. Only filled when the publisher is disclosed.
    publisher: uint64;

    // The WAMP authrole of the publisher. Only filled when publisher is disclosed.
    publisher_authid: string (principal);

    // The WAMP authrole of the publisher. Only filled when publisher is disclosed.
    publisher_authrole: string (principal);

    // For pattern-based subscriptions, the event MUST contain the actual topic published to.
    topic: string (uri);

    // Whether the message was retained by the broker on the topic, rather than just published.
    retained: bool;

    // Application provided transaction hash for router-side throttle/deduplicate.
    transaction_hash: string;

    // Hint to request acknowledgement of the reception of this Event by a subscriber.
    acknowledge: bool;

    // When this message is forwarded in router-to-router traffic, the route of the message in tuples of (session, authid, authrole) beginning with the publisher session followed by a series of router-link sessions.
    forward_for: [Principal];
}


// EVENT_RECEIVED message (message_type = 37): [EVENT_RECEIVED, EVENT.Publication|id, Details|dict, Payload|binary]
table EventReceived
{
    // The publication ID of the event that was received, and that is acknowledged.
    publication: uint64;

    // Raw application payload: error arguments. This might be encrypted (with Payload==Payload.CRYPTOBOX), and is serialized according to enc_serializer.
    payload: [uint8];

    // The encoding algorithm that was used to encode the payload.
    enc_algo: Payload;

    // The payload object serializer that was used encoding the payload.
    enc_serializer: Serializer;

    // When using Payload.CRYPTOBOX, the public Cryptobox key of the key pair used for encrypting the payload.
    enc_key: [uint8];
}


// SUBSCRIBER_RECEIVED message (message_type = 38): [SUBSCRIBER_RECEIVED, EVENT_RECEIVED.Publication|id, Details|dict, EVENT_RECEIVED.Payload|binary]
table SubscriberReceived
{
    // The publication ID of the event that was received, and that is acknowledged.
    publication: uint64;

    // The WAMP session ID of the subscriber. Only filled when the subscriber is disclosed.
    subscriber: uint64;

    // The WAMP authrole of the subscriber. Only filled when subscriber is disclosed.
    subscriber_authid: string (principal);

    // The WAMP authrole of the subscriber. Only filled when subscriber is disclosed.
    subscriber_authrole: string (principal);

    // Raw application payload: error arguments. This might be encrypted (with Payload==Payload.CRYPTOBOX), and is serialized according to enc_serializer.
    payload: [uint8];

    // The encoding algorithm that was used to encode the payload.
    enc_algo: Payload;

    // The payload object serializer that was used encoding the payload.
    enc_serializer: Serializer;

    // When using Payload.CRYPTOBOX, the public Cryptobox key of the key pair used for encrypting the payload.
    enc_key: [uint8];
}