Skip to content

Add functions to create/delete super stream in manager #3503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 14, 2021

Conversation

acogoluegnes
Copy link
Contributor

No description provided.

@mergify mergify bot added the bazel label Sep 23, 2021
@acogoluegnes
Copy link
Contributor Author

AC:

From the umbrella, check out the branch and start the broker:

git checkout super-stream-cli
make run-broker PLUGINS="rabbitmq_stream_management"

Check the help of the add_super_stream command works properly:

sbin/rabbitmqctl add_super_stream --help

It should output the descriptions and the options of command.

Create an invoice super stream:

sbin/rabbitmqctl add_super_stream invoices

Go to http://localhost:15672/#/exchanges/%2F/invoices to check the invoices exchange:

  • durable direct exchange
  • x-super-stream argument set to true
  • 3 bindings to invoices- queues
  • the bindings should have a x-stream-partition-order argument each that matches the index of each queue

Go to http://localhost:15672/#/queues to check the queues:

  • there should be 3 queues, invoices-0, invoices-1, invoices-2
  • they should all be streams

Delete the super stream:

sbin/rabbitmqctl delete_super_stream invoices

Make sure the exchange and the queues have been deleted.

Now create a super stream with 5 partitions (the default is 3)

sbin/rabbitmqctl add_super_stream invoices --partitions 5

Check the exchange and the partition streams have been created, with the appropriate bindings.

Delete the super stream:

sbin/rabbitmqctl delete_super_stream invoices

Make sure the exchange and the queues have been deleted.

Create a super stream using explicit routing keys:

sbin/rabbitmqctl add_super_stream invoices --routing-keys amer,emea,apac

Check the exchange:

  • it should have 3 bindings
  • the bindings should use the routing keys specified
  • the order argument should match the order of the routing keys specified in the command line

Delete the super stream:

sbin/rabbitmqctl delete_super_stream invoices

Create a super stream with stream arguments:

sbin/rabbitmqctl add_super_stream invoices \
  --max-length-bytes 1gb --max-age PT10M \
  --stream-max-segment-size-bytes 50mb --leader-locator random \
  --initial-cluster-size 1

Check the created streams and make sure the specified arguments have been propagated to them.

Delete the super stream:

sbin/rabbitmqctl delete_super_stream invoices

@acogoluegnes acogoluegnes marked this pull request as ready for review September 30, 2021 09:13
@kjnilsson kjnilsson self-requested a review October 11, 2021 13:12
@acogoluegnes acogoluegnes merged commit 75b2a53 into master Oct 14, 2021
@acogoluegnes acogoluegnes added this to the 3.10.0 milestone Oct 14, 2021
@acogoluegnes acogoluegnes deleted the super-stream-cli branch October 14, 2021 09:17
acogoluegnes added a commit that referenced this pull request Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants