java - JMS - Redelivery flow in a queue -
java - JMS - Redelivery flow in a queue -
configuration
i´m using ejb 3 in oc4j 10.1.3.x
the problem
i create queue producer client_acknowledge orientation, like:
queueconnection = queueconnectionfactory.createqueueconnection(); queuesession = queueconnection.createqueuesession(false, session.client_acknowledge); queuesender = queuesession.createsender(queue); objectmessage objmessage = queuesession.createobjectmessage(); mail service info = new mail(); data.setmessage("some random message."); objmessage.setobject(data); queuesender.send(objmessage); what understand of consumer should handle ack of message, in other words, if consumer do not phone call message.acknowledge() method, message should redelivery. right?
what happen is, when mdb read message (by listener onmessage) message off queue (independent if phone call or not message.acknowledge() method).
public void onmessage(message message) { seek { if (message instanceof objectmessage) { objectmessage objectmessage = (objectmessage) message; mail service mail = (mail) objectmessage.getobject(); system.out.println(mail.getmessage()); throw new runtimeexception("error"); } } grab (jmsexception e) { } what doing wrong?
well, did lots of research , found container ignores client command on session creation. in case: queueconnection.createqueuesession(false, session.client_acknowledge); so, if need handle message process in mdb acknowledge or not need work ejb transaction.
java java-ee jms message-queue message-driven-bean
Comments
Post a Comment