1 2 3 Previous Next 31 Replies Latest reply on Jan 16, 2012 3:22 AM by markusdöring Go to original post
      • 15. Re: JMS transacted messages not working?
        jaikiran

        Markus Döring wrote:

         

        I have subitted a jira:

        https://issues.jboss.org/browse/AS7-3143

        and added a simple EAR to reproduce the issue.

         

        Thanks.

         

         

        Markus Döring wrote:

         

        BTW if someone is interessted:

        I can't log in to JIRA with this account even after multiple password changes.

        Forum does work without problems.

        I had to create a new account, that worked without problems.

        I have an ö in my username, so this might cause the problem.

        I'll check if someone from the .org team can help with this.

        • 16. Re: JMS transacted messages not working?
          sfcoy

          I can confirm that message delivery behaves as expected when using the connection factory at java:/JmsXa.

           

          We always used java:/ConnectionFactory in older versions of JBoss, but that just seems to behave as a black hole in 7.1.

           

          BTW. I went looking for the HornetQ source code. JBossAS 7.1CR1 is using version 2.2.7, but the HornetQ website only goes up to 2.2.5. Where can I find the right source?

          • 17. Re: JMS transacted messages not working?
            jaikiran

            Stephen Coy wrote:

             

             

            BTW. I went looking for the HornetQ source code. JBossAS 7.1CR1 is using version 2.2.7, but the HornetQ website only goes up to 2.2.5. Where can I find the right source?

            The Maven repo should have it https://repository.jboss.org/nexus/content/repositories/public/org/hornetq/ or the SVN branches of HornetQ http://anonsvn.jboss.org/repos/hornetq/branches/Branch_2_2_AS7/

            • 18. Re: JMS transacted messages not working?
              velias

              Hi Markus,

               

              I patched some records in our authentication database, so now it should be possible to use MarkusDöring username in JIRA (issues.jboss.org). Try it please.

               

              Cheers

               

              Vl.

              • 19. Re: JMS transacted messages not working?
                markusdöring

                Hi Vlastimil,

                 

                sorry, it's still not working.

                Now I always get a

                "Sorry, your userid is required to answer a CAPTCHA question correctly."

                message (I'm pretty sure I typed it correctly at least once).

                 

                Markus

                • 20. Re: JMS transacted messages not working?
                  velias

                  Hi,

                   

                  sorry, I forgot to mention you need to change password for this username once again to be correctly synced in our authentication DB.

                  Then try to login JIRA again.

                   

                  Cheers

                   

                  Vl.

                  • 21. Re: JMS transacted messages not working?
                    markusdöring

                    Now it works.

                    Thanks!

                    • 22. Re: JMS transacted messages not working?
                      wolfc

                      Please replace the zip with one containing the source code.

                      Nobody should be running unknown class files.

                      • 23. Re: JMS transacted messages not working?
                        markusdöring

                        done.

                        • 24. Re: JMS transacted messages not working?
                          wolfc

                          This code has a wrong assumption:

                          //TODO does not work when transactional=true ?
                          session = connect.createSession(true, Session.AUTO_ACKNOWLEDGE);
                          final MessageProducer producer = session.createProducer(this.testQueue);
                          connect.start();
                          final ObjectMessage objectMessage = session.createObjectMessage("Transactional message");
                          producer.send(objectMessage);
                          LOG.info("Transactional message send...");
                          

                           

                          When you use a transactional session, the message is sent when the commit takes place. In this case after the EJB method exists.

                          • 25. Re: JMS transacted messages not working?
                            markusdöring

                            Yes, I know this (at least, it should be like this, but it's not).

                            If you read the complete forum thread, thats what this is all about.

                             

                            The log statements should just show what's the problem.

                            Maybe they should be a bit more detailed like "Transactional message is added to producer for sending when transaction is commited" or something like this, but I think they should work like they are.

                            The main point in the log statements is to the the time when the log statement is written (before or after TestMDB is writing log statements) to show if the message is really send after transaction commit or if the TestMDB is starting message processing before the transaction is commited at all.

                            • 26. Re: JMS transacted messages not working?
                              wolfc

                              AFAIKS there is no bug. The code works as it should be.

                               

                              Can you rephrase the problem you are seeing?

                              • 27. Re: JMS transacted messages not working?
                                wolfc

                                With the latest installment of AS 7 it is now possible to differentiate between having JMS transactions managed by the transaction manager or having JMS local transactions. Using java:/ConnectionFactory instead of java:/JmsXA for a transacted session will activate a JMS local transaction. The JMS local transaction must be explicitly committed via session.commit();

                                 

                                So in the end this is a configuration issue of this new feature.

                                • 28. Re: JMS transacted messages not working?
                                  sfcoy

                                  Please consider changing the names of those connection factories then, because that looks like a significant change in behaviour from (say) the 5.1EAP release.

                                   

                                  When I acquire JMS resources from within an EJB hosted in an application server, I expect them to behave transactionally as per the EJB spec.

                                   

                                  Users (such as me) who have been using java:/ConnectionFactory since the JBoss 3.0 days will be wondering why it stopped working.

                                  • 29. Re: JMS transacted messages not working?
                                    whitingjr

                                    Hi Markus,

                                    As Zufar has pointed out you should be configuring to use the pooled connection factory that is XA transacted.

                                     

                                       <pooled-connection-factory name="hornetq-ra">

                                          <transaction mode="xa"/>

                                          <connectors>

                                             <connector-ref connector-name="in-vm"/>

                                          </connectors>

                                          <entries>

                                    ......

                                     

                                    JMS connections are not handled identically as JDBC connections are. Even though you are getting a JMS connection in an EJB the connection is not committed for you. As it is for JDBC connections.

                                    This is why the messages dissapear.

                                     

                                    If you really are sure you want to use a local transaction connection factory then call commit on the Session object after sending the message. But beware, if a crash occurs in the EJB after Session.commit is called not all the changes will be undone.

                                     

                                    Using the XA connection factory is the best course of action to achive a fault tollerant application in this situation.

                                     

                                    Regards,

                                    Jeremy

                                    1 of 1 people found this helpful