Open gvmw opened 3 years ago
PerfTest declares it as transient:
PRECONDITION_FAILED - inequivalent arg 'durable' for exchange 'amq.direct' in vhost '/': received 'false' but current is 'true'
That's right. How can PerfTest be configured to declare the exchange as durable?
I don't see a way. Exchanges are declared like so:
channel.exchangeDeclare(exchangeName, exchangeType);
but you don't have to declare amq.direct
, you can avoid this by passing --predeclared
since it's always there.
While that is a nice workaround, it is not currently possible to declare a durable exchange with PerfTest. Not sure if we want to add this feature, but it's a limitation that I've hit today.
PerfTest should not try to declare an exchange that starts with amq.
anyway, I'll change this.
We can add yet another flag to create durable exchanges. I think it's not there because the durability of exchanges is not critical for benchmarks, but this is not a reason not to add it.
@gerhard any suggestions for the flag?
I'm thinking --durable true
.
I don't want to make this bigger than it needs to be, but it would make sense if this new flag applied to queues too. --auto-delete true --flag persistent
always felt like a long way of achieving this with queues.
--durable true
(or just --durable
I don't remember how PerfTest handles flags off the top of my head) for the whole chain (exchange, queue, messages) is opinionated but handy indeed. Are you sure want to go down this path? :)
The presence of the --durable
flag will work too.
My use-case is declaring and publishing into a durable exchange. As long as I can do that with PerfTest, I'm good.
The context is https://github.com/knative-sandbox/eventing-rabbitmq/pull/522 and the requirement is to generate some load on RabbitMQ that the RabbitmqSource
(a Knative Eventing primitive) can consume and send to a Sink (another Knative Eventing primitive) as CloudEvents. While this used to be done differently before I joined - https://github.com/knative-sandbox/eventing-rabbitmq/blob/f36e482a04fcbe91108ce5b984a71e1abe9e6ac9/samples/source/example/simple_producer.go - there is no reason to not use the official benchmarking tool for this purpose. It would also work for this durable Exchange to be declared via https://github.com/rabbitmq/messaging-topology-operator - https://github.com/rabbitmq/rabbitmq-perf-test/issues/282 blocks this - so either option will work.
From a K8s perspective, declaring an Exchange
via the topology operator that PerfTest will then use would be ideal, so #282 would be sufficient, but I think that PerfTest should support the declaration of durable exchanges.
Now you have all the context 🙂
@gerhard I fixed #281, so it should work in your case, as PerfTest will not try to create the amq.direct
exchange. You can try the pivotalrabbitmq/perf-test:dev
Docker image, it contains the fix.
Even though it won't help for your case until we decide to change PerfTest behavior in #282, I think we can add the --durable
flag if you think it'll help, but we need to define the semantics.
My suggestion is that it does the same as --auto-delete true --flag persistent
AND makes PerfTest create everything it creates durable (exchange and queues).
Note the --quorum-queue
flag does the same thing as --auto-delete true --flag persistent
(queues are durable, messages are persistent).
Basically --auto-delete true
and --flag persistent
are independent: you can have durable queues and persistent messages without --auto-delete true
, and the --durable
flag would "reunite" them.
Note also the durable
terminology is not clear here, because it applies to resources usually, but we choose here to apply it to the whole chain. Just saying but, we could use --persistent
instead (not to be confused with --flag persistent
), that would make more sense I think.
I needed a single producer publishing into
amq.direct
exchange. I do not have any queues or consumers. I was not expecting this to fail:How can I configure PerfTest to publish into a durable exchange?