Skip to content

Commit df6e51c

Browse files
ilya-4realLancetnikfaststream-actions[bot]
authored
feat: (#2061) Redis Binary Format (#2287)
* fix (#2061): used struct.pack to encode headers length into binary * feat: implemented new binary format for redis messages * feat: implemented new binary format for redis messages(lint and typecheck fix) * docs: generate API References * divided redis message format into different classes and added arguments for choosing format * docs: generate API References * updated the docs * added tests for test broker * refactor: ovveride broker-level format by subscriber one * docs: generate API References * feat: added two additional fields into message metadata and added tests for parsing json with binary message format * docs: generate API References * docs: enhanced docs of new format * feat: added deprecation warnings for JSON message format * docs: generate API References * feat: add message_format option to Redis Publishers * chore: fix lint, bump version * chore: fix python3.8 compat --------- Co-authored-by: Pastukhov Nikita <[email protected]> Co-authored-by: Nikita Pastukhov <[email protected]> Co-authored-by: Lancetnik <[email protected]> Co-authored-by: faststream-actions[bot] <faststream-actions[bot]@users.noreply.github.com>
1 parent 4b5a70a commit df6e51c

25 files changed

+929
-73
lines changed

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,5 @@
185185
}
186186
]
187187
},
188-
"generated_at": "2025-07-15T08:05:07Z"
188+
"generated_at": "2025-06-19T12:24:30Z"
189189
}

docs/docs/SUMMARY.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ search:
122122
- [Pipeline](redis/pipeline.md)
123123
- [Message Information](redis/message.md)
124124
- [Security Configuration](redis/security.md)
125+
- [Message Format](redis/message_format.md)
125126
- [Reference - Code API](api/index.md)
126127
- Public API
127128
- faststream
@@ -205,6 +206,8 @@ search:
205206
- [TestApp](public_api/faststream/rabbit/TestApp.md)
206207
- [TestRabbitBroker](public_api/faststream/rabbit/TestRabbitBroker.md)
207208
- redis
209+
- [BinaryMessageFormatV1](public_api/faststream/redis/BinaryMessageFormatV1.md)
210+
- [JSONMessageFormat](public_api/faststream/redis/JSONMessageFormat.md)
208211
- [ListSub](public_api/faststream/redis/ListSub.md)
209212
- [PubSub](public_api/faststream/redis/PubSub.md)
210213
- [RedisBroker](public_api/faststream/redis/RedisBroker.md)
@@ -1016,6 +1019,8 @@ search:
10161019
- [build_virtual_host](api/faststream/rabbit/utils/build_virtual_host.md)
10171020
- [is_routing_exchange](api/faststream/rabbit/utils/is_routing_exchange.md)
10181021
- redis
1022+
- [BinaryMessageFormatV1](api/faststream/redis/BinaryMessageFormatV1.md)
1023+
- [JSONMessageFormat](api/faststream/redis/JSONMessageFormat.md)
10191024
- [ListSub](api/faststream/redis/ListSub.md)
10201025
- [PubSub](api/faststream/redis/PubSub.md)
10211026
- [RedisBroker](api/faststream/redis/RedisBroker.md)
@@ -1062,7 +1067,12 @@ search:
10621067
- provider
10631068
- [RedisTelemetrySettingsProvider](api/faststream/redis/opentelemetry/provider/RedisTelemetrySettingsProvider.md)
10641069
- parser
1065-
- [RawMessage](api/faststream/redis/parser/RawMessage.md)
1070+
- [BinaryMessageFormatV1](api/faststream/redis/parser/BinaryMessageFormatV1.md)
1071+
- [BinaryReader](api/faststream/redis/parser/BinaryReader.md)
1072+
- [BinaryWriter](api/faststream/redis/parser/BinaryWriter.md)
1073+
- [FastStreamMessageVersion](api/faststream/redis/parser/FastStreamMessageVersion.md)
1074+
- [JSONMessageFormat](api/faststream/redis/parser/JSONMessageFormat.md)
1075+
- [MessageFormat](api/faststream/redis/parser/MessageFormat.md)
10661076
- [RedisBatchListParser](api/faststream/redis/parser/RedisBatchListParser.md)
10671077
- [RedisBatchStreamParser](api/faststream/redis/parser/RedisBatchStreamParser.md)
10681078
- [RedisListParser](api/faststream/redis/parser/RedisListParser.md)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# 0.5 - API
3+
# 2 - Release
4+
# 3 - Contributing
5+
# 5 - Template Page
6+
# 10 - Default
7+
search:
8+
boost: 0.5
9+
---
10+
11+
::: faststream.redis.BinaryMessageFormatV1

docs/docs/en/api/faststream/redis/parser/RawMessage.md renamed to docs/docs/en/api/faststream/redis/JSONMessageFormat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ search:
88
boost: 0.5
99
---
1010

11-
::: faststream.redis.parser.RawMessage
11+
::: faststream.redis.JSONMessageFormat
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# 0.5 - API
3+
# 2 - Release
4+
# 3 - Contributing
5+
# 5 - Template Page
6+
# 10 - Default
7+
search:
8+
boost: 0.5
9+
---
10+
11+
::: faststream.redis.parser.BinaryMessageFormatV1
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# 0.5 - API
3+
# 2 - Release
4+
# 3 - Contributing
5+
# 5 - Template Page
6+
# 10 - Default
7+
search:
8+
boost: 0.5
9+
---
10+
11+
::: faststream.redis.parser.BinaryReader
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# 0.5 - API
3+
# 2 - Release
4+
# 3 - Contributing
5+
# 5 - Template Page
6+
# 10 - Default
7+
search:
8+
boost: 0.5
9+
---
10+
11+
::: faststream.redis.parser.BinaryWriter
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# 0.5 - API
3+
# 2 - Release
4+
# 3 - Contributing
5+
# 5 - Template Page
6+
# 10 - Default
7+
search:
8+
boost: 0.5
9+
---
10+
11+
::: faststream.redis.parser.FastStreamMessageVersion
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# 0.5 - API
3+
# 2 - Release
4+
# 3 - Contributing
5+
# 5 - Template Page
6+
# 10 - Default
7+
search:
8+
boost: 0.5
9+
---
10+
11+
::: faststream.redis.parser.JSONMessageFormat
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# 0.5 - API
3+
# 2 - Release
4+
# 3 - Contributing
5+
# 5 - Template Page
6+
# 10 - Default
7+
search:
8+
boost: 0.5
9+
---
10+
11+
::: faststream.redis.parser.MessageFormat

0 commit comments

Comments
 (0)