java - how to save the messages one by one in jms -
i reading xml jms queue using activemq jms service , saving data database, i'm getting duplicate values in database because multiple xml processed @ time; need save 1 one xml.
@messagedriven (name = "testmessagebean", activationconfig = { @activationconfigproperty(propertyname = "destination",propertyvalue = "jmstestueue?consumer.exclusive=true"), @activationconfigproperty(propertyname = "destinationtype",propertyvalue = "javax.jms.queue"), @activationconfigproperty(propertyname = "acknowledgemode",propertyvalue = "auto-acknowledge"), @activationconfigproperty(propertyname = "maxsession", propertyvalue = "1") }) public class favouritesmdb implements messagelistener { @inject @ejb private testslsb testslsb; public void onmessage(message message) { string xmlmessage = ""; if (message instanceof textmessage) { textmessage msg = (textmessage) message; try { xmlmessage = msg.gettext(); testslsb.saverecords(xmlmessage); } catch (exception e) { } } }
wiki
Comments
Post a Comment