The issue is known in that it was discovered previously and resolved in the 0.23.0 release last year, via https://issues.apache.org/Robbie
jira/browse/QPIDJMS-292. As you also seem to have identified, a workaround is setting the prefetch to 1 (or zero for newer clients). We dont have any plans for more 0.11.x releases.On 10 May 2018 at 15:05, Alessandro Crotti - SMC Consulting <firstname.lastname@example.org> wrote:
Sorry, the version we are using is 0.11.1, not 0.11.0.
Il 10/05/2018 15:41, Alessandro Crotti - SMC Consulting ha scritto:
Using Qpid JMS 0.11.0 AMQP 1.0 client, which is the latest version for Java 7, we experienced an issue when you set prefetch > 1 and start consuming messages from a queue in asynchronous mode, using "onMessage()" method and sessionMode = Session.CLIENT_ACKNOWLEDGE.
Taking prefetch= 10 as example, I noticed that:
- When you open connection/session/listener, the client sends a "flow" performative with linkCredit=10, which is correctly the prefetch value. Prefetched messages = 10
- The client starts to process the first message received using class "MessageDeliverTask" method "run()" (all inside JmsMessageConsumer.java)
- There is a call "ackFromReceive(envelope)" at row 667 which, following sub-calls, will call method "sendFlowIfNeeded()" of class "AmqpConsumer"
- in this method "newCredit" is calculated to send a new "flow" performative. Here the calculation doesn't check how many prefetched messages already are on client side. The currentCredit is 0, for this reason is sent a "flow" performative with linkCredit=10. Prefetched messages =20
- There is a call "messageListener.onMessage(cop
y);" at row 672 which triggers the import of the message. Then the prefetched messages = 19.
- The process starts again from point 2 increasing constantly the prefetched messages collected on client side, causing timeout issues because if they are 1 million of messages, the client can't process them before they expire
I compared code of method "sendFlowIfNeeded()" (see point 3) in version 0.11.0 with the code of version 0.31.0: in version 0.31.0 the code is changed and the calculation considers also "prefetchMessageCount".
Is this a known issue? Will you fix it for 0.11.x version because it is the latest version for Java 7?
tel: +39 342 573 4450
Via dell'industria, 87 41012 Carpi (MO) - Italy
tel: +39 059 664875
CONFIDENTIALITY NOTICE: This message may contain confidential and/or privileged information.
If you are not the intended recipient, please do not use its contents for any purpose, advise
the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.