•The class must be annotated with @MessageDriven annotation if it does not use the deployment descriptor.
•The class must be public
•The class cannot be defined as abstract or final
•It must contain public constructor with no args
•It must not define the finalize method
It is recommended, but not required, that a message-driven bean class implement the message listener interface (MessageListener)
Clients cannot call MDB directly, there is no interface.
MessageDrivenContext can be injected to the MDB as it provides a setRollbackOnly method
If we used @MessageDriven then we can specify the mappedName that specifies the name of the JNDI name of the destination from which the bean will consume messages. @ActivationConfigProperty can used for more complex MDB configuration
No comments:
Post a Comment