Bug 907537

Summary: session.createConsumer do not start session
Product: Red Hat Enterprise MRG Reporter: ppecka <ppecka>
Component: qpid-jcaAssignee: Rajith Attapattu <rattapat+nobody>
Status: CLOSED NOTABUG QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.2CC: csuconic, esammons, iboverma, jross, lzhaldyb, vhubeika
Target Milestone: 2.3Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-14 09:38:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
simple war with servlet
none
EAP6 config none

Description ppecka 2013-02-04 16:25:43 UTC
Created attachment 692869 [details]
simple war with servlet

Description of problem:
session.createConsumer(queue) is not switching session's _started attribute, this causes receiver.receive() method to return null object everytime.



Version-Release number of selected component (if applicable):
EAP6


Steps to Reproduce:
1. start and configure EAP6
2. build webapp-war (attached)
3. access servlet http://localhost:8080/webapp-war/MyServlet
  
Actual results:
Servlet does not read messages from queue mrg_mrg_jca_mdb_transactions_in


Expected results:
Servlet reads all messages from mrg_mrg_jca_mdb_transactions_in

Additional info:
here is where i believe it should be corrected

--- ./qpid-0.18/java/jca/src/main/java/org/apache/qpid/ra/QpidRASessionFactoryImpl.java
+0100
@@ -858,7 +858,7 @@
 
                session.setQpidSessionFactory(this);
-               if (_started){
+               if (!_started){
                   session.start();
                }

Comment 1 ppecka 2013-02-04 16:26:31 UTC
Created attachment 692870 [details]
EAP6 config

Comment 2 Justin Ross 2013-02-11 14:36:44 UTC
Rajith, please evaluate the patch.

Comment 3 Rajith Attapattu 2013-02-11 20:37:50 UTC
This patch is does not seem to be correct from a behavior pov.

Looking at the code, the start() method in QpidRASessionFactoryImpl is responsible for starting the sessions it has created.

Subsequently any newly created sessions will be started, provided the start method had been called before.

This patch is causing sessions to be started as soon as they are created. This may not be desirable for certain applications.

I'm not too familiar with JCA, but I wonder why the start() method is not called explicitly ?

(In JMS the application is responsible for starting the connections, in JCA I'm not sure if it's the application or the App Server who's responsible for that.)

Comment 4 Clebert Suconic 2013-02-12 00:18:43 UTC
The test seems broken to me... I think the test was supposed to call start on the sessionReceiver... otherwise consumer.receive() wouldn't return anything.


I think this is a rejection. Or am I missing anything here?

Comment 5 ppecka 2013-02-14 09:38:49 UTC
ok, clebert is right. but i wonder why this "if" statement is there.