Skip to content
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

Support zero rate and below one message/second rate #20

Closed
johanrhodin opened this issue May 6, 2024 · 3 comments
Closed

Support zero rate and below one message/second rate #20

johanrhodin opened this issue May 6, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@johanrhodin
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Running omq amqp-amqp --publisher-uri $TARGET --consumer-uri $TARGET -y 1 -x 1 --rate 0 results in the following:

Log with "panic"
time=2024-05-06T17:25:55.988Z level=INFO msg="consumer started" protocol=amqp-1.0 consumerId=1 terminus=/topic/omq
time=2024-05-06T17:25:55.988Z level=INFO msg="Waiting for all publishers and consumers to complete"
time=2024-05-06T17:25:56.227Z level=INFO msg="publisher started" protocol=AMQP-1.0 publisherId=1 rate=0 destination=/topic/omq
panic: non-positive interval for NewTicker

goroutine 28 [running]:
time.NewTicker(0xc0000a40d0?)
	/usr/local/go/src/time/tick.go:22 +0xe5
github.com/rabbitmq/omq/pkg/amqp10_client.Amqp10Publisher.StartRateLimited({0x1, 0xc00019e0f0, 0xc00047c000, {0xa37a71, 0xa}, {{0x7fffbf1e2c89, 0x64}, {0x7fffbf1e2cfd, 0x64}, 0x1, ...}, ...}, ...)
	/home/ubuntu/go/pkg/mod/github.com/rabbitmq/omq@v0.4.6-0.20240506131709-8bad78b9f771/pkg/amqp10_client/publisher.go:106 +0x1b9
github.com/rabbitmq/omq/pkg/amqp10_client.Amqp10Publisher.Start({0x1, 0xc00019e0f0, 0xc00047c000, {0xa37a71, 0xa}, {{0x7fffbf1e2c89, 0x64}, {0x7fffbf1e2cfd, 0x64}, 0x1, ...}, ...}, ...)
	/home/ubuntu/go/pkg/mod/github.com/rabbitmq/omq@v0.4.6-0.20240506131709-8bad78b9f771/pkg/amqp10_client/publisher.go:86 +0x12b
github.com/rabbitmq/omq/cmd.start.func3()
	/home/ubuntu/go/pkg/mod/github.com/rabbitmq/omq@v0.4.6-0.20240506131709-8bad78b9f771/cmd/root.go:282 +0x18f
created by github.com/rabbitmq/omq/cmd.start in goroutine 1
	/home/ubuntu/go/pkg/mod/github.com/rabbitmq/omq@v0.4.6-0.20240506131709-8bad78b9f771/cmd/root.go:275 +0x3b0

Setting the rate to a low number as as 0.01 is not accepted as input.

Describe the solution you'd like

Support zero rate and below 1 messages per second.

Describe alternatives you've considered

No response

Additional context

Both of them (zero-rate, and below 1/s) are useful for many clients with few messages scenarios ("IoT").

@johanrhodin johanrhodin added the enhancement New feature or request label May 6, 2024
@annieblomgren
Copy link
Contributor

annieblomgren commented May 7, 2024

I have a local branch for adding this but don't have access to push a new branch.
Is it possible to get access?

@lukebakken
Copy link

@annieblomgren - please see GitHub's documentation for creating a pull request:

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request

Thank you for your contribution!

@mkuratczyk
Copy link
Contributor

version 0.5.0 supports --rate 0. It just starts an idle publisher (if you don't want a publisher, use -x 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants