Skip to content

Commit ec20e30

Browse files
Update README.md
Add in 'publish message to channel including metadata', i.e. in the extras headers json, which I believe has to be done through calling the Message constructor
1 parent b92c770 commit ec20e30

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ logger.addHandler(logging.StreamHandler())
102102
await channel.publish('event', 'message')
103103
```
104104

105+
### Publishing a message to a channel including metadata
106+
107+
```python
108+
from ably.types.message import Message
109+
messageObject = Message(name="messagename",
110+
data="payload",
111+
extras={"headers": {"metadataKey": "metadataValue"}})
112+
await channel.publish(messageObject)
113+
```
114+
105115
### Querying the History
106116

107117
```python

0 commit comments

Comments
 (0)