Example usage for javax.jms Session AUTO_ACKNOWLEDGE

List of usage examples for javax.jms Session AUTO_ACKNOWLEDGE

Introduction

In this page you can find the example usage for javax.jms Session AUTO_ACKNOWLEDGE.

Prototype

int AUTO_ACKNOWLEDGE

To view the source code for javax.jms Session AUTO_ACKNOWLEDGE.

Click Source Link

Document

With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message either when the session has successfully returned from a call to receive or when the message listener the session has called to process the message successfully returns.

Usage

From source file:prodandes.Prodandes.java

@GET
@Path("/inicializarColas")
public String inicializarColas() throws JMSException, NamingException {
    InitialContext init = new InitialContext();
    this.cf = (ConnectionFactory) init.lookup("RemoteConnectionFactory");
    this.d = (Destination) init.lookup("queue/queue1");
    this.c = (javax.jms.Connection) this.cf.createConnection("guest123", "guest");
    ((javax.jms.Connection) this.c).start();
    this.s = ((javax.jms.Connection) this.c).createSession(false, Session.AUTO_ACKNOWLEDGE);
    mc = s.createConsumer(d);/* ww w.  jav a  2s. c  o m*/
    this.mc.setMessageListener(this);
    buzon = new ArrayList<String>();
    return "Inicializo bien";
}