On Tue, Mar 19, 2013 at 11:15 AM, Gordon Sim <[email protected]> wrote: > On 03/19/2013 02:55 PM, Rajith Attapattu wrote: >> >> Speaking with Gordon, I came to the conclusion that we first need to >> figure out what we mean by Equals. >> Does equals mean, >> >> If two consumers used the same destination, they should both receive >> the same messages (or share, in a shared queue). >> If two producers use the same destination, they should both send >> messages to the same (queue/exchange ?) > > > The main use of equals I can think of involves a test for equivalence. E.g. > I may have a producer for Destination A and want to know whether I can use > that instead of creating a new producer for Destination B. If A equals B, I > can assume they are equivalent, my existing producer is equivalent to > creating a new one. > > In this case my-queue/subject1 is *not* equivalent to my-queue/subject2 > (neither is my-exchange/subject1 equivalent to my-exchange/subject2). I > would therefore argue that the subject *is* relevant for equality. > > The same applies if we consider consumers rather than producers. > > I would also note that in this sort of use case it is safer to return false > from equals than it is to return true.
I agree with you that it's best to return false negatives instead of false positives as the latter can create issues. I will add the subject to the equals test, at least that will cover some cases, but want be a complete fix. Do you have a suggestion for fanout, xml, headers etc ? Rajith > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
