File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question on MessageDriven Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question on MessageDriven Beans" Watch "Question on MessageDriven Beans" New topic
Author

Question on MessageDriven Beans

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

What would a subscriptionDurability mean in an MDB? Why this property is not applicable for Messages that listen to a Queue?


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Sergio Tridente
Ranch Hand

Joined: Mar 22, 2007
Posts: 329

Hi Jothi,

Accordingly to section 5.4.2 of the ejb core specification:


If the message-driven bean class implements more than one interface other than java.io.Serializable, java.io.Externalizable, or any of the interfaces defined by the javax.ejb package, the message listener interface must be specified by the messageListenerInterface element of the MessageDriven annotation or the messaging-type element of the message-driven deployment descriptor element.


SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Sergio,

Your reply does not have a relationship to what I asked originally!
Sergio Tridente
Ranch Hand

Joined: Mar 22, 2007
Posts: 329

Sorry, wrong topic.

(BTW, both topics have the same title.)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

First, the publish/subscribe concept is related to Topics, not to Queue. Many clients subscribe to a topic and are notified when the topic they have subscribed to has arrived. So, the subscriptionDurability is related to Topics, not Queues.

I've never tried the subscriptionDurability attribute, so I can only quote the spec 5.4.16.1 JMS Message-Driven Beans :

The property name used to specify whether a durable or non-durable subscription should be used is subscriptionDurability. The value for this property must be either Durable or NonDurable for a JMS message-driven bean. If a topic subscription is specified and subscriptionDurability is not specified, a non-durable subscription is assumed.
  • Durable topic subscriptions, as well as queues, ensure that messages are not missed even if the EJB server is not running. Reliable applications will typically make use of queues or durable topic subscriptions rather than non-durable topic subscriptions.
  • If a non-durable topic subscription is used, it is the container�s responsibility to make sure that the message driven bean subscription is active (i.e., that there is a message driven bean available to service the message) in order to ensure that messages are not missed as long as the EJB server is running. Messages may be missed, however, when a bean is not available to service them. This will occur, for example, if the EJB server goes down for any period of time.


  • [My Blog]
    All roads lead to JavaRanch
    Joe Harry
    Ranch Hand

    Joined: Sep 26, 2006
    Posts: 9243
        
        1

    Thanks Christophe!
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Question on MessageDriven Beans