0
votes

Well I have this piece of code, and I wonder if it is possible to receive the message after, I don't now, one minute let´s say, because are a lot of messages getting in the queue. And if yes can you give me an example or say where I can find more information. Thank you in advance.

@MessageDriven( mappedName = "jms/TestJMSQueue", activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }) public class MDBTest implements MessageListener {

@Override
public void onMessage(Message message) {
    try {
        TextMessage tm = (TextMessage) message;
        log.log( Level.FINE, "Consumed message:"+ tm.getText());
    } catch (JMSException jex) {
        log.log(Level.SEVERE,"Exception: " + jex);
    }

}

}

1

1 Answers