Skip to content

Commit ef8db54

Browse files
committed
#40 - include campaign ID, request ID, message ID in userspace messages
Signed-off-by: Lance-Drane <Lance-Drane@users.noreply.github.com>
1 parent 0f54101 commit ef8db54

23 files changed

Lines changed: 722 additions & 493 deletions

examples/1_hello_world/hello_service_schema.json

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,23 @@
126126
"messageTraits": {
127127
"commonHeaders": {
128128
"userspaceHeaders": {
129-
"$defs": {
130-
"IntersectDataHandler": {
131-
"description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE",
132-
"enum": [
133-
0,
134-
1
135-
],
136-
"title": "IntersectDataHandler",
137-
"type": "integer"
138-
}
139-
},
140-
"description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.",
129+
"description": "ALL request/response/command messages must contain this header.\n\nWe do not include the content type of the message in the header, it is handled separately.",
141130
"properties": {
131+
"message_id": {
132+
"description": "Unique message ID",
133+
"title": "Message Id",
134+
"type": "string"
135+
},
136+
"campaign_id": {
137+
"description": "ID associated with a campaign",
138+
"title": "Campaign Id",
139+
"type": "string"
140+
},
141+
"request_id": {
142+
"description": "ID associated with a specific request message and response message sequence",
143+
"title": "Request Id",
144+
"type": "string"
145+
},
142146
"source": {
143147
"description": "source of the message",
144148
"pattern": "^[a-z0-9][-a-z0-9.]*[-a-z0-9]$",
@@ -153,7 +157,6 @@
153157
},
154158
"created_at": {
155159
"description": "the UTC timestamp of message creation",
156-
"format": "date-time",
157160
"title": "Created At",
158161
"type": "string"
159162
},
@@ -163,41 +166,42 @@
163166
"title": "Sdk Version",
164167
"type": "string"
165168
},
169+
"operation_id": {
170+
"description": "Name of capability and operation we want to call, in the format ${CAPABILITY_NAME}.${FUNCTION_NAME}",
171+
"title": "Operation Id",
172+
"type": "string"
173+
},
166174
"data_handler": {
167-
"$ref": "#/components/messageTraits/commonHeaders/userspaceHeaders/$defs/IntersectDataHandler",
168-
"default": 0,
169-
"description": "Code signifying where data is stored."
175+
"description": "Code signifying where data is stored.",
176+
"type": "string"
170177
},
171178
"has_error": {
172-
"default": false,
173179
"description": "If this value is True, the payload will contain the error message (a string)",
174180
"title": "Has Error",
175-
"type": "boolean"
181+
"type": "string"
176182
}
177183
},
178184
"required": [
185+
"message_id",
186+
"campaign_id",
187+
"request_id",
179188
"source",
180189
"destination",
181190
"created_at",
182-
"sdk_version"
191+
"sdk_version",
192+
"operation_id"
183193
],
184-
"title": "UserspaceMessageHeader",
194+
"title": "UserspaceMessageHeaders",
185195
"type": "object"
186196
},
187197
"eventHeaders": {
188-
"$defs": {
189-
"IntersectDataHandler": {
190-
"description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE",
191-
"enum": [
192-
0,
193-
1
194-
],
195-
"title": "IntersectDataHandler",
196-
"type": "integer"
197-
}
198-
},
199-
"description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.",
198+
"description": "ALL event messages must include this header.\n\nWe do not include the content type of the message in the header, it is handled separately.",
200199
"properties": {
200+
"message_id": {
201+
"description": "Unique message ID",
202+
"title": "Message Id",
203+
"type": "string"
204+
},
201205
"source": {
202206
"description": "source of the message",
203207
"pattern": "^[a-z0-9][-a-z0-9.]*[-a-z0-9]$",
@@ -206,7 +210,6 @@
206210
},
207211
"created_at": {
208212
"description": "the UTC timestamp of message creation",
209-
"format": "date-time",
210213
"title": "Created At",
211214
"type": "string"
212215
},
@@ -217,20 +220,24 @@
217220
"type": "string"
218221
},
219222
"data_handler": {
220-
"$ref": "#/components/messageTraits/commonHeaders/eventHeaders/$defs/IntersectDataHandler",
221-
"default": 0,
222-
"description": "Code signifying where data is stored."
223+
"description": "Code signifying where data is stored.",
224+
"type": "string"
223225
},
224226
"capability_name": {
227+
"description": "The name of the capability which emitted the event originally.",
228+
"pattern": "^[a-zA-Z0-9]\\w*$",
225229
"title": "Capability Name",
226230
"type": "string"
227231
},
228232
"event_name": {
233+
"description": "The name of the event that was emitted, namespaced to the capability.",
234+
"pattern": "^[a-zA-Z0-9]\\w*$",
229235
"title": "Event Name",
230236
"type": "string"
231237
}
232238
},
233239
"required": [
240+
"message_id",
234241
"source",
235242
"created_at",
236243
"sdk_version",

examples/1_hello_world_amqp/hello_service_schema.json

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,23 @@
126126
"messageTraits": {
127127
"commonHeaders": {
128128
"userspaceHeaders": {
129-
"$defs": {
130-
"IntersectDataHandler": {
131-
"description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE",
132-
"enum": [
133-
0,
134-
1
135-
],
136-
"title": "IntersectDataHandler",
137-
"type": "integer"
138-
}
139-
},
140-
"description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.",
129+
"description": "ALL request/response/command messages must contain this header.\n\nWe do not include the content type of the message in the header, it is handled separately.",
141130
"properties": {
131+
"message_id": {
132+
"description": "Unique message ID",
133+
"title": "Message Id",
134+
"type": "string"
135+
},
136+
"campaign_id": {
137+
"description": "ID associated with a campaign",
138+
"title": "Campaign Id",
139+
"type": "string"
140+
},
141+
"request_id": {
142+
"description": "ID associated with a specific request message and response message sequence",
143+
"title": "Request Id",
144+
"type": "string"
145+
},
142146
"source": {
143147
"description": "source of the message",
144148
"pattern": "^[a-z0-9][-a-z0-9.]*[-a-z0-9]$",
@@ -153,7 +157,6 @@
153157
},
154158
"created_at": {
155159
"description": "the UTC timestamp of message creation",
156-
"format": "date-time",
157160
"title": "Created At",
158161
"type": "string"
159162
},
@@ -163,41 +166,42 @@
163166
"title": "Sdk Version",
164167
"type": "string"
165168
},
169+
"operation_id": {
170+
"description": "Name of capability and operation we want to call, in the format ${CAPABILITY_NAME}.${FUNCTION_NAME}",
171+
"title": "Operation Id",
172+
"type": "string"
173+
},
166174
"data_handler": {
167-
"$ref": "#/components/messageTraits/commonHeaders/userspaceHeaders/$defs/IntersectDataHandler",
168-
"default": 0,
169-
"description": "Code signifying where data is stored."
175+
"description": "Code signifying where data is stored.",
176+
"type": "string"
170177
},
171178
"has_error": {
172-
"default": false,
173179
"description": "If this value is True, the payload will contain the error message (a string)",
174180
"title": "Has Error",
175-
"type": "boolean"
181+
"type": "string"
176182
}
177183
},
178184
"required": [
185+
"message_id",
186+
"campaign_id",
187+
"request_id",
179188
"source",
180189
"destination",
181190
"created_at",
182-
"sdk_version"
191+
"sdk_version",
192+
"operation_id"
183193
],
184-
"title": "UserspaceMessageHeader",
194+
"title": "UserspaceMessageHeaders",
185195
"type": "object"
186196
},
187197
"eventHeaders": {
188-
"$defs": {
189-
"IntersectDataHandler": {
190-
"description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE",
191-
"enum": [
192-
0,
193-
1
194-
],
195-
"title": "IntersectDataHandler",
196-
"type": "integer"
197-
}
198-
},
199-
"description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.",
198+
"description": "ALL event messages must include this header.\n\nWe do not include the content type of the message in the header, it is handled separately.",
200199
"properties": {
200+
"message_id": {
201+
"description": "Unique message ID",
202+
"title": "Message Id",
203+
"type": "string"
204+
},
201205
"source": {
202206
"description": "source of the message",
203207
"pattern": "^[a-z0-9][-a-z0-9.]*[-a-z0-9]$",
@@ -206,7 +210,6 @@
206210
},
207211
"created_at": {
208212
"description": "the UTC timestamp of message creation",
209-
"format": "date-time",
210213
"title": "Created At",
211214
"type": "string"
212215
},
@@ -217,20 +220,24 @@
217220
"type": "string"
218221
},
219222
"data_handler": {
220-
"$ref": "#/components/messageTraits/commonHeaders/eventHeaders/$defs/IntersectDataHandler",
221-
"default": 0,
222-
"description": "Code signifying where data is stored."
223+
"description": "Code signifying where data is stored.",
224+
"type": "string"
223225
},
224226
"capability_name": {
227+
"description": "The name of the capability which emitted the event originally.",
228+
"pattern": "^[a-zA-Z0-9]\\w*$",
225229
"title": "Capability Name",
226230
"type": "string"
227231
},
228232
"event_name": {
233+
"description": "The name of the event that was emitted, namespaced to the capability.",
234+
"pattern": "^[a-zA-Z0-9]\\w*$",
229235
"title": "Event Name",
230236
"type": "string"
231237
}
232238
},
233239
"required": [
240+
"message_id",
234241
"source",
235242
"created_at",
236243
"sdk_version",

0 commit comments

Comments
 (0)