3 Replies Latest reply on Apr 11, 2011 6:17 AM by Andy Taylor

    Message Driven Beans as anti-pattern

    Esteve Aviles Newbie

      Hi,

      After reading the great HornetQ documentation I have found that at the begining they recommend the usage of MDB when using messaging in JEE environement, but at the end of the documents, in the anti-patters section they write:

       

      Don't use Message-Driven Beans for the sake of it. As soon as you start using                     MDBs you are greatly increasing the codepath for each message received compared                     to a straightforward message consumer, since a lot of extra application server                     code is executed. Ask yourself do you really need MDBs? Can you accomplish the                     same task using just a normal message consumer?

       

      I am not very prone to EJBs and I agree with the anti-pattern, but there is a complete section on this matter.

       

       

      Any opinion?