use of org.apache.cxf.jaxrs.ext.Oneway in project cxf by apache.
the class JMSBookStore method onewayRequest.
@PUT
@Path("/oneway")
@Consumes()
@Oneway
public void onewayRequest(Book book) throws Exception {
Context ctx = getContext();
ConnectionFactory factory = (ConnectionFactory) ctx.lookup("ConnectionFactory");
Destination replyToDestination = (Destination) ctx.lookup("dynamicQueues/test.jmstransport.response");
Connection connection = null;
try {
connection = factory.createConnection();
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
postOneWayBook(session, replyToDestination, book);
session.close();
} finally {
try {
if (connection != null) {
connection.stop();
connection.close();
}
} catch (JMSException ex) {
// ignore
}
}
}
use of org.apache.cxf.jaxrs.ext.Oneway in project tesb-rt-se by Talend.
the class JMSHttpBookStore method oneWayRequest.
@PUT
@Oneway
public void oneWayRequest(Book book) throws Exception {
// printRequestTransport();
Connection connection = null;
try {
Context ctx = getContext();
ConnectionFactory factory = (ConnectionFactory) ctx.lookup("ConnectionFactory");
Destination replyToDestination = (Destination) ctx.lookup("dynamicQueues/test.jmstransport.response");
connection = factory.createConnection("tesb", "tesb");
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
postOneWayBook(session, replyToDestination, book);
session.close();
} catch (Exception ex) {
ex.printStackTrace();
throw ex;
} finally {
try {
if (connection != null) {
connection.stop();
connection.close();
}
} catch (JMSException ex) {
// ignore
}
}
}
Aggregations