rabbitmq-java-client icon indicating copy to clipboard operation
rabbitmq-java-client copied to clipboard

An interface for filtering out entities (e.g. queues) from the topology recovery cache

Open michaelklishin opened this issue 9 months ago • 0 comments

See https://github.com/rabbitmq/rabbitmq-java-client/discussions/1311 for background.

This is a very basic proposal that would allow to mark certain entities as "unrecoverable", as in, they won't be stored in the topology recovery cache and thus won't be recovered. But also won't keep accumulating if the queues are deleted via a mechanism such as TTL, or another client.

Topology Filtering Interface

ConnectionFactory can accept a TopologyRecoveryEntityFilter (or something like that) that would accept a new methods similar in spirit to Predicate<T> but potentially with a list of parameters, e.g.

class FilterTemporaryQueues implements TopologyRecoveryEntityFilter {
  public boolean shouldRecoverQueue(String virtualHost, String name, boolean durable, boolean autoDelete, boolean exclusive, Map<String, Object> arguments);

  public boolean shouldRecoverExchange(String virtualHost, String name, String exchangeType, boolean durable, boolean autoDelete, Map<String, Object> arguments);
}

  // ...

By default, an "all-accepting" implementation can be used.

michaelklishin avatar May 13 '24 16:05 michaelklishin