qweeze / rstream

A Python asyncio-based client for RabbitMQ Streams
MIT License
84 stars 13 forks source link

adding support for CREATE/DELETE supersteams #186

Closed DanielePalaia closed 7 months ago

DanielePalaia commented 7 months ago

This closes #156

The SuperstreamProducer is now taking in input a new field: super_stream_creation_option of type

class SuperStreamCreationOption:
    n_partitions: int
    binding_keys: Optional[list[str]] = None
    arguments: Optional[dict[str, Any]] = None

If the super_stream specified in the super_stream field doesn't exist and super_stream_creation_option is set then it will create the super stream.

Also create_super_stream and delete_super_stream have been implemented in the SuperstreamProducer class

Gsantomaggio commented 7 months ago

Can you change the example https://github.com/qweeze/rstream/tree/super_stream_create/docs/examples/super_stream ?

By removing the command line script and using the new API.

I would use the partition number based instead of the keys based for the example or create boh

DanielePalaia commented 7 months ago

@Gsantomaggio Done!