1 Reply Latest reply on May 10, 2010 12:17 PM by Tim Fox

    HornetQDestination implementing both Topic and Queueu

    Clebert Suconic Master

      It's a common use case on users doing this:

       

       

      if (destination instanceof Queue) ... then it's a queue

       

       

       

      With our latest trunk, every destinations implements both Queue and Topic. Why's that?

        • 1. Re: HornetQDestination implementing both Topic and Queueu
          Tim Fox Master

          Clebert Suconic wrote:

           

          It's a common use case on users doing this:

           

           

          if (destination instanceof Queue) ... then it's a queue

           


          No. That would be user FAIL.

           

          Just because the object implements the Topic interface does not mean the INSTANCE is a topic. It could be a queue too.

           

          It's the same thing with out connection factories. The connection factory class implements all the connection factory instances. That does not mean the connection factory INSTANCE is all of those types.