Bug 742150

Summary: MDB receives more messages when qpidd is killed and restarted
Product: Red Hat Enterprise MRG Reporter: Jiri Sedlacek <jsedlace>
Component: qpid-javaAssignee: Rajith Attapattu <rattapat+nobody>
Status: CLOSED CURRENTRELEASE QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 2.0CC: jross, oskutka, wprice
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-12 12:02:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jiri Sedlacek 2011-09-29 09:13:43 UTC
Description of problem: When qpidd is killed and restarted while messages are received by MDB, MDB receives and stores more messages, that was sent.


Steps to Reproduce:
1. checkout https://svn.devel.redhat.com/repos/jboss-qa/mrg/tests/ha
2. fix annotation in
/mdb-ejb/src/main/java/org/jboss/test/mdb/MRGJCAMessageBean.java to point to
your MRG server
3. replace hibernate dialect in /mdb-ejb/src/main/resources/META-INF/persistence.xml (if you use another db then mysql51)
4. compile with mvn -DskipTests clean package
5. configure eap to use mysql51 db for defaultDS and defaultXADS (or another db with xa transactions support)
6. copy ha/mdb-test/target/ha-kill-mrg-test.ear to deploy directory of EAP 5.1.1
(profile production)
7. checkout https://svn.devel.redhat.com/repos/jboss-qa/mrg/qpid-java-jca
8. configure qpid-java-jca/qpid-jca-ds.xml to point to your MRG server and copy it with qpid-ra.rar to deploy directory of eap production profile
9. start mrg enabled to store messages through restart
10. Start EAP
11. Go to http://localhost:8080/servlet/mrgtest?op=send&count=1000 - this sends 1000 messages to queue, that is consumed by mdb
12. while the mdb receives messages, kill qpidd daemon and restart it, eap should reconnect. 
13. after all messages are processed, check number of messages in db by http://localhost:8080/servlet/mrgtest?op=get-count, in db will be more messages that it was sent.
  
Actual results:

Received more messages, that were sent.

Expected results:

To receive exact amount of messages (number, which was sent)

Comment 1 Weston M. Price 2011-10-13 13:01:02 UTC
From my analysis, I believe this is an issue with the JMS client issuing 'extra-credits' on redelivery. As such, I don't believe this will be fixed in time for the 2.0.4 release. Also, I am changing the component to qpid-java as this is a client issue and does not involve the adapter directly.

Comment 2 Weston M. Price 2011-10-13 13:14:30 UTC
*** Bug 742187 has been marked as a duplicate of this bug. ***

Comment 3 Weston M. Price 2013-03-12 12:02:10 UTC
This has been addressed in the latest release. I am closing this as a result.