diff --git a/imports-request-reply.md b/imports-request-reply.md index d183745..17b01f3 100644 --- a/imports-request-reply.md +++ b/imports-request-reply.md @@ -45,12 +45,10 @@ action. This error is mainly used when calling `update-guest-configuration`.
The interface doesn't highlight this difference in the type itself as that's uniquely a consumer issue.
record guest-configuration
Configuration includes a required list of channels the guest is subscribing to, and an -optional list of extensions key-value pairs (e.g., partitions/offsets to read from in -Kafka/EventHubs, QoS etc.).
+optional list of extensions key-value pairschannels
: list<channel
>extensions
: option<list<(string
, string
)>>resource message
[method]message.set-topic: func
Set the topic/subject/channel this message should be sent on
+[method]message.content-type: func
An optional content-type describing the format of the data in the message. This is sometimes described as the "format" type
@@ -97,6 +102,14 @@ sometimes described as the "format" type +[method]message.set-content-type: func
Set the content-type describing the format of the data in the message. This is +sometimes described as the "format" type
+self
: borrow<message
>content-type
: string
[method]message.data: func
An opaque blob of data
[method]message.set-data: func
Set the opaque blob of data for this message, discarding the old value
+self
: borrow<message
>data
: list<u8
>[method]message.metadata: func
Optional metadata (also called headers or attributes in some systems) attached to the message
@@ -118,6 +138,14 @@ message +[method]message.add-metadata: func
Add a new key-value pair to the metadata, overwriting any existing value for the same key
+self
: borrow<message
>key
: string
value
: string
[method]message.complete: func
Completes/acks the message
A message can exist under several statuses: diff --git a/imports.md b/imports.md index 384da07..40667d7 100644 --- a/imports.md +++ b/imports.md @@ -44,12 +44,10 @@ action. This error is mainly used when calling `update-guest-configuration`.
The interface doesn't highlight this difference in the type itself as that's uniquely a consumer issue.
record guest-configuration
Configuration includes a required list of channels the guest is subscribing to, and an -optional list of extensions key-value pairs (e.g., partitions/offsets to read from in -Kafka/EventHubs, QoS etc.).
+optional list of extensions key-value pairschannels
: list<channel
>extensions
: option<list<(string
, string
)>>resource message
[method]message.set-topic: func
Set the topic/subject/channel this message should be sent on
+[method]message.content-type: func
An optional content-type describing the format of the data in the message. This is sometimes described as the "format" type
@@ -96,6 +101,14 @@ sometimes described as the "format" type +[method]message.set-content-type: func
Set the content-type describing the format of the data in the message. This is +sometimes described as the "format" type
+self
: borrow<message
>content-type
: string
[method]message.data: func
An opaque blob of data
[method]message.set-data: func
Set the opaque blob of data for this message, discarding the old value
+self
: borrow<message
>data
: list<u8
>[method]message.metadata: func
Optional metadata (also called headers or attributes in some systems) attached to the message
@@ -117,6 +137,14 @@ message +[method]message.add-metadata: func
Add a new key-value pair to the metadata, overwriting any existing value for the same key
+self
: borrow<message
>key
: string
value
: string
[method]message.complete: func
Completes/acks the message
A message can exist under several statuses: diff --git a/messaging.md b/messaging.md index 2702f43..031f682 100644 --- a/messaging.md +++ b/messaging.md @@ -49,12 +49,10 @@ action. This error is mainly used when calling `update-guest-configuration`.
The interface doesn't highlight this difference in the type itself as that's uniquely a consumer issue.
record guest-configuration
Configuration includes a required list of channels the guest is subscribing to, and an -optional list of extensions key-value pairs (e.g., partitions/offsets to read from in -Kafka/EventHubs, QoS etc.).
+optional list of extensions key-value pairschannels
: list<channel
>extensions
: option<list<(string
, string
)>>resource message
[method]message.set-topic: func
Set the topic/subject/channel this message should be sent on
+[method]message.content-type: func
An optional content-type describing the format of the data in the message. This is sometimes described as the "format" type
@@ -101,6 +106,14 @@ sometimes described as the "format" type +[method]message.set-content-type: func
Set the content-type describing the format of the data in the message. This is +sometimes described as the "format" type
+self
: borrow<message
>content-type
: string
[method]message.data: func
An opaque blob of data
[method]message.set-data: func
Set the opaque blob of data for this message, discarding the old value
+self
: borrow<message
>data
: list<u8
>[method]message.metadata: func
Optional metadata (also called headers or attributes in some systems) attached to the message
@@ -122,6 +142,14 @@ message +[method]message.add-metadata: func
Add a new key-value pair to the metadata, overwriting any existing value for the same key
+self
: borrow<message
>key
: string
value
: string
[method]message.complete: func
Completes/acks the message
A message can exist under several statuses:
diff --git a/wit/types.wit b/wit/types.wit
index c408f53..fe64e47 100644
--- a/wit/types.wit
+++ b/wit/types.wit
@@ -26,11 +26,9 @@ interface types {
type channel = string;
/// Configuration includes a required list of channels the guest is subscribing to, and an
- /// optional list of extensions key-value pairs (e.g., partitions/offsets to read from in
- /// Kafka/EventHubs, QoS etc.).
+ /// optional list of extensions key-value pairs
record guest-configuration {
channels: list>>
}
/// A message with a binary payload and additional information
@@ -38,14 +36,23 @@ interface types {
constructor(topic: channel, data: list
>>);
/// The topic/subject/channel this message was received or should be sent on
topic: func() -> channel;
+ /// Set the topic/subject/channel this message should be sent on
+ set-topic: func(topic: channel);
/// An optional content-type describing the format of the data in the message. This is
/// sometimes described as the "format" type
content-type: func() -> option
>>;
+ /// Add a new key-value pair to the metadata, overwriting any existing value for the same key
+ add-metadata: func(key: string, value: string);
/// Completes/acks the message
///