@@ -26,26 +26,33 @@ interface types {
26
26
type channel = string ;
27
27
28
28
/// Configuration includes a required list of channels the guest is subscribing to, and an
29
- /// optional list of extensions key-value pairs (e.g., partitions/offsets to read from in
30
- /// Kafka/EventHubs, QoS etc.).
29
+ /// optional list of extensions key-value pairs
31
30
record guest-configuration {
32
31
channels : list <channel >,
33
- extensions : option <list <tuple <string , string >>>
34
32
}
35
33
36
34
/// A message with a binary payload and additional information
37
35
resource message {
38
36
constructor (topic : channel , data : list <u8 >, content-type : option <string >, metadata : option <list <tuple <string , string >>>);
39
37
/// The topic/subject/channel this message was received or should be sent on
40
38
topic : func () -> channel ;
39
+ /// Set the topic/subject/channel this message should be sent on
40
+ set-topic : func (topic : channel );
41
41
/// An optional content-type describing the format of the data in the message. This is
42
42
/// sometimes described as the "format" type
43
43
content-type : func () -> option <string >;
44
+ /// Set the content-type describing the format of the data in the message. This is
45
+ /// sometimes described as the "format" type
46
+ set-content-type : func (content-type : string );
44
47
/// An opaque blob of data
45
48
data : func () -> list <u8 >;
49
+ /// Set the opaque blob of data for this message, discarding the old value
50
+ set-data : func (data : list <u8 >);
46
51
/// Optional metadata (also called headers or attributes in some systems) attached to the
47
52
/// message
48
53
metadata : func () -> option <list <tuple <string , string >>>;
54
+ /// Add a new key-value pair to the metadata, overwriting any existing value for the same key
55
+ add-metadata : func (key : string , value : string );
49
56
50
57
/// Completes/acks the message
51
58
///
0 commit comments