java - JMS publish to topic takes really long time and gets killed by the transaction reaper -
so have code publishes jms topic:
public void notifycreatelisteners(mycreatedobject payload) { logger.trace("serviceimpl.notifycreatelisteners"); topicconnection conn = null; topicsession session = null; topic topic = null; try { properties props = new properties(); props.setproperty("java.naming.factory.initial", "org.jnp.interfaces.namingcontextfactory"); props.setproperty("java.naming.factory.url.pkgs","org.jboss.naming"); props.setproperty("java.naming.provider.url", "jnp://localhost:49227"); context context = new initialcontext(props); topicconnectionfactory tcf = (topicconnectionfactory) context.lookup("/connectionfactory"); conn = tcf.createtopicconnection(jbossjaasauthenticator.principal, jbossjaasauthenticator.credentials); topic = (topic)context.lookup("topic/create_notify_topic"); session = conn.createtopicsession(false, topicsession.auto_acknowledge); conn.start(); topicpublisher send = session.createpublisher(topic); objectmessage message = session.createobjectmessage(); message.setobject(payload); send.publish(message); conn.close(); } catch (exception e) { logger.error("an exception occurred notifying create listeners", e); } }
i'm calling code through soap, , executes rather fast, taking not more 1-2 seconds. however, problem have is, code hangs on "send.publish(message)", , can take long time, 5 15 minutes, , complete or killed transaction reaper:
[2015-04-01 11:38:00,198] warn com.arjuna.ats.arjuna.logging.arjloggeri18n [com.arjuna.ats.arjuna.coordinator.basicaction_40] - abort called on aborted atomic action -6ec596b6:e039:551a4e56:ff03b [2015-04-01 11:38:00,206] error org.jboss.ws.core.jaxws.soapfaulthelperjaxws soap request exception javax.ejb.ejbtransactionrolledbackexception: transaction rolled
.....
caused by: javax.transaction.rollbackexception: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] transaction not active!
the strange part not use transaction method, confirmed method preceeding one, "mycreatedobject" created in db, don't know transaction reaper killing.
question 1: how can determine transaction reaper killing? enabled trace on "com.arjuna", nothing useful printed out.
question 2: how can cause timeout send method? tried setting timetolive on topicpublisher 120000 (2 minutes), seems has no effect.
eventually, ideal me determine why there delays on publishing topic, , how can interfere setting kind of timeout publishing, because part not important, meaning not want overall soap call end in error if publishing fails, want log error , let finish successfully. i'm thinking of calling "notifycreatelisteners" method in thread, i'll killing after period of time (if still active). viable solution, or can recommend else?
Comments
Post a Comment