It will only get to the dlq when the redelivery policy retries are exceeded
and this defaults to 6. You would need to configure that to 0 to get it sent
to get a delivery to the DLQ.

Can you try and produce a tests case for this behavior where the ack is
unexpected.
Pulling your code into the JMSConsumerTest does not reproduce. It works as
expected.
Maybe the JmsRollbackRedeliveryTest can give u a good starting point for a
test case or some examples that work:

http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/

On 11 May 2010 20:36, sbuster <stevebuster...@hotmail.com> wrote:

>
> I'm the same probelm as the other user in terms of using a simple
> transacted
> client that tries to call session.rollback and get the following exception
> in the log.  Ultimately I want the message to end up in the DLQ but it
> never
> gets directed there.  attached is a simple client, my activemq config.
>
> ActiveMQ 5.3.1 & 5.3.2
> Using the default activemq.xml configuration file.
>
> Test Case
> public class MessageConsumerA {
>        private String url = ActiveMQConnection.DEFAULT_BROKER_URL;
>        private Session session;
>    private Destination destination;
>    private int ackMode = Session.AUTO_ACKNOWLEDGE;
>    private boolean transacted=true;
>    private String subject = "TOOL.DEFAULT";
>    javax.jms.MessageConsumer consumer = null;
>        /**
>         * @param args
>         * @throws Exception
>         */
>        public static void main(String[] args) throws Exception {
>                MessageConsumerA mc = new MessageConsumerA();
>                mc.run();
>
>        }
>
>        public void run() throws Exception{
>                ActiveMQConnectionFactory connectionFactory = new
> ActiveMQConnectionFactory(url);
>        Connection connection = connectionFactory.createConnection();
>        connection.start();
>        session = connection.createSession(transacted, ackMode);
>        destination = session.createQueue(subject);
>        consumer = session.createConsumer(destination);
>        Message message = consumer.receive(10000);
>        session.rollback();
>        System.out.println("Closing connection");
>        consumer.close();
>        session.close();
>        connection.close();
>        }
>
> }
>
>
> Stack Trace:
>  WARN | Async error occurred: javax.jms.JMSException: Transaction
> 'TX:ID:C001318
> 805-4042-1273606494194-0:0:1' has not been started.
> javax.jms.JMSException: Transaction
> 'TX:ID:C001318805-4042-1273606494194-0:0:1'
> has not been started.
>        at
> org.apache.activemq.broker.TransactionBroker.getTransaction(Transacti
> onBroker.java:270)
>        at
> org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionB
> roker.java:190)
>        at
> org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java
> :74)
>        at
> org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java
> :74)
>        at
> org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBro
> kerFilter.java:85)
>        at
> org.apache.activemq.broker.TransportConnection.processMessageAck(Tran
> sportConnection.java:452)
>        at org.apache.activemq.command.MessageAck.visit(MessageAck.java:205)
>        at
> org.apache.activemq.broker.TransportConnection.service(TransportConne
> ction.java:300)
>        at
> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportC
> onnection.java:178)
>        at
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilt
> er.java:68)
>        at
> org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireForm
> atNegotiator.java:113)
>        at
> org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityM
> onitor.java:216)
>        at
> org.apache.activemq.transport.TransportSupport.doConsume(TransportSup
> port.java:84)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.jav
> a:204)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:
> 186)
>        at java.lang.Thread.run(Thread.java:619)
> --
> View this message in context:
> http://old.nabble.com/javax.jms.JMSException%3A-Transaction-%27TX%3AID...%27-not-started-tp28528467p28528467.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Reply via email to