Skip to content

Commit 7f4ee0a

Browse files
committed
doc: Adding reference to SuperStreams on Readme
1 parent 1b4d6dd commit 7f4ee0a

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def deps do
3737
end
3838
```
3939

40-
### Producing
40+
## [Producing](https://github.com/VictorGaiva/rabbitmq-stream/blob/main/guides/concepts/producing.md)
4141

4242
RabbitMQ Streams protocol needs a static `:reference_name` per producer. This is used to prevent message duplication. For this reason, each stream needs, for now, a static module to publish messages, which keeps track of its own `publishing_id`.
4343

@@ -98,6 +98,32 @@ def handle_info({:deliver, %RabbitMQStream.Message.Types.DeliverData{} = deliver
9898
end
9999
```
100100

101+
## [SuperStreams](https://github.com/VictorGaiva/rabbitmq-stream/blob/main/guides/concepts/super-streams.md)
102+
103+
[A super stream is a logical stream made of individual, regular streams.](https://www.rabbitmq.com/blog/2022/07/13/rabbitmq-3-11-feature-preview-super-streams)
104+
105+
You can declare SuperStreams with:
106+
107+
```elixir
108+
:ok = MyApp.MyConnection.create_super_stream("my_super_stream", "route-A": ["stream-01", "stream-02"], "route-B": ["stream-03"])
109+
```
110+
111+
And you can consume from it with:
112+
113+
```elixir
114+
defmodule MyApp.MySuperConsumer do
115+
use RabbitMQStream.SuperConsumer,
116+
initial_offset: :next,
117+
super_stream: "my_super_stream"
118+
119+
@impl true
120+
def handle_message(_message) do
121+
# ...
122+
:ok
123+
end
124+
end
125+
```
126+
101127
### Configuration
102128

103129
The configuration for the connection can be set in your `config.exs` file:

0 commit comments

Comments
 (0)