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

Using a predeclared exchange that does not exist creates it #282

Open
gvmw opened this issue Nov 29, 2021 · 5 comments
Open

Using a predeclared exchange that does not exist creates it #282

gvmw opened this issue Nov 29, 2021 · 5 comments
Labels

Comments

@gvmw
Copy link

gvmw commented Nov 29, 2021

Running the following command creates an exchange:

make run ARGS="--producers 1 --rate 1 --consumers 0 --exchange idonotexist --predeclared true"

Since this exchange does not exist, it should not be created since we use the --predeclared true flag.

@acogoluegnes
Copy link
Collaborator

Oh boy, this goes back to fc02da2.

@acogoluegnes
Copy link
Collaborator

So this is the condition:

if (!predeclared || !exchangeExists(connection, exchangeName)) {
  channel.exchangeDeclare(exchangeName, exchangeType);
  topologyRecording.recordExchange(exchangeName, exchangeType);
}

It's been there since the beginning of time, it's been changed, reverted, etc. I don't really know what's the best thing to do here :)

@acogoluegnes
Copy link
Collaborator

So you're in the case when predeclared is true but the exchange does not exist, so PerfTest sees the exchange does not exists and creates it for you, how nice and paternalistic of it.

This is surprising, but we're telling PerfTest to publish to something that does not exist, is it really what we want?

@michaelklishin
Copy link
Member

Arguably --predeclared should mean that at least for exchanges (the less dynamic part of the topology in practice), nothing is declared. I can see how this won't be constructive for queues and consumers, in particular since a single flag
can control the behavior of both producer and consumer sides.

@acogoluegnes
Copy link
Collaborator

So you're suggesting that PerfTest should never create exchanges when --predeclared is set to true?

@acogoluegnes acogoluegnes removed this from the 2.17.0 milestone Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants