Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cameron-michie committed Nov 29, 2023
1 parent b92c770 commit ec20e30
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ logger.addHandler(logging.StreamHandler())
await channel.publish('event', 'message')
```

### Publishing a message to a channel including metadata

```python
from ably.types.message import Message
messageObject = Message(name="messagename",
data="payload",
extras={"headers": {"metadataKey": "metadataValue"}})
await channel.publish(messageObject)
```

### Querying the History

```python
Expand Down

0 comments on commit ec20e30

Please sign in to comment.