Re: Behavior when a message expires while it is processing

2014-04-16 Thread Mike Chao
To get the JUnit test to pass, I created a BrokerFilter that will filter out duplicate messages based on the String property myMessageId. testJMSExpirationWithFilterPlugin.zip The behavior now is that o

Re: Behavior when a message expires while it is processing

2014-04-16 Thread Mike Chao
So I ran testJMSExpirationAsn1 and got the following NPE. java.lang.NullPointerException at com.test.TestJMSExpirationNoCamel$DLQEndQueueConsumer.run(TestJMSExpirationNoCamel.java:188) at java.lang.Thread.run(Thread.java:722) I changed consumer.receive(3000) to consumer.receive(9000

Re: Behavior when a message expires while it is processing

2014-04-15 Thread artnaseef
Here is an updated version of the test without camel, as a JUnit. "mvn test" does the trick. testJMSExpirationAsn1.zip Note it's expecting only 1 DLQ message and fails when it gets 2. I upgraded the version of Ac

Re: Behavior when a message expires while it is processing

2014-04-15 Thread artnaseef
Based on this, http://en.wikipedia.org/wiki/Idempotence, the operation as-described is definitely not idempotent. -- View this message in context: http://activemq.2283324.n4.nabble.com/Behavior-when-a-message-expires-while-it-is-processing-tp4680241p4680319.html Sent from the ActiveMQ - User ma

Re: Behavior when a message expires while it is processing

2014-04-15 Thread artnaseef
Hmm, my understanding of idempotent is that the same message can be processed more than once without causing problems. Keep in mind there are many scenarios with JMS in which you can receive a duplicate message, such as the broker delivers the message and the client processes it, but the broker/cl

Re: Behavior when a message expires while it is processing

2014-04-15 Thread Mike Chao
The impact of having more than 1 message in the DLQ is that the process that reads from the DLQ will need to keep track of which messages it has processed. This introduces state and since there could be multiple processes reading from the DLQ the state would have to be shared. We are trying to avoi

Re: Behavior when a message expires while it is processing

2014-04-15 Thread artnaseef
I don't think there's an easy way to only get one message on the DLQ without changing the expiration handling to prevent expiration of inflight messages. What is the impact of having more than one copy of the message in DLQs? -- View this message in context: http://activemq.2283324.n4.nabble.c

Re: Behavior when a message expires while it is processing

2014-04-15 Thread artnaseef
This is likely why the test isn't working as-expected; the following: should be just this: I believe it is necessary to set the TTL a second time when producing the message again. In the camel case, I believe camel is doing that for you. I'll try to get this working to verify. -- View th

Re: Behavior when a message expires while it is processing

2014-04-14 Thread Mike Chao
I think what you are saying is correct from the broker's perspective. I tried coding up an example without using camel and I do not see the same behavior. The example can be found here http://s000.tinyupload.com/?file_id=62097383795604422204 I am not sure sure I coded up the example correctly.

Re: Behavior when a message expires while it is processing

2014-04-13 Thread artnaseef
Haven't look at the camel code yet, but don't think I need to at this point - it appears to be working as-documented. ActiveMQ is expiring inflight messages. In other words, the following is happening (from the broker's perspecive): camel consumer for queue.start is started message produced t

Re: Behavior when a message expires while it is processing

2014-04-13 Thread artnaseef
Curious example. This actually appears to be more of a camel question than an ActiveMQ question. Wearing my ActiveMQ hat, I see this: * message is produced to queue, queue.start, after manually setting JMSExpiration * message is consumed from queue in a transaction by camel * the camel exchange