1 2 3 Previous Next 43 Replies Latest reply on Dec 9, 2007 7:42 PM by claudio_br Go to original post
      • 15. Re: How using message in memory queue with messaging?
        beve

        Sorry, just noticed my typo:

        <jms-bus busid="quickstartGwChannel">
         <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_helloworld_Request_gw"
         persistent="false"
         />
        </jms-bus>
        


        Regards,

        Daniel

        • 16. Re: How using message in memory queue with messaging?

          Hi Daniel,

          I changed my log4j. With my test I got:

          2007-11-14 15:43:58,812 DEBUG [org.jboss.soa.esb.listeners.message.ActionProcessingPipeline] executing processor 1 org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor@f7b8fc
          header: [
          To: JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/teste_queue/>,
          <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>,
          <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost/>,
          <wsa:ReferenceProperties jbossesb:destination-type : queue/>,
          <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>,
          <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>,
          <wsa:ReferenceProperties jbossesb:persistent : false/>,
          <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/> > ]
          ReplyTo: JMSEpr
          [ PortReference < <wsa:Address jms://localhost/queue/teste_queue_reply/>,
          <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost/>,
          <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>,
          <wsa:ReferenceProperties jbossesb:destination-type : queue/>,
          <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>,
          <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>,
          <wsa:ReferenceProperties jbossesb:message-selector : jbossESBresponseUUID='618c3511-c817-4e89-bcad-089c358b293a'/>,
          <wsa:ReferenceProperties jbossesb:persistent : true/>,
          <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/>,
          <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ]
          MessageID: ID:JBM-3560 RelatesTo: jms:correlationID#6d86548f-1d6a-462e-bf57-c1c90b66156d ]


          Note, in To there is persistent: false,
          but in ReplyTo there is persistent: true.

          The send is not persistent, but the return is. The return should be persistent: false. Perhaps because this I did not get performance gain.

          • 17. Re: How using message in memory queue with messaging?

            Im my last post I am using

            Message replyMessage = deliveryAdapter.deliverSync(requestMessage,5000);


            Deliver the request message synchronously

            • 18. Re: How using message in memory queue with messaging?
              marklittle

              Whether or not it's related to your problem, you have identified an issue. Thanks. We'll fix this in the CP release. It's in the trunk now if you feel adventuresome.

              • 19. Re: How using message in memory queue with messaging?

                Ok Mark,

                I will try with trunk version.
                I post my results.
                Thanks

                • 20. Re: How using message in memory queue with messaging?

                  Hi Mark,

                  I got the revision 16676 of svn:

                  http://anonsvn.labs.jboss.com/labs/jbossesb/branches/JBESB_4_2_1_GA_CP

                  With this version I rerun my test and I got:

                  17:37:42,640 INFO [STDOUT] message: [ JBOSS_XML ]
                  header: [
                  To: JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/teste_queue/>,
                  <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>,
                  <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost/>,
                  <wsa:ReferenceProperties jbossesb:destination-type : queue/>,
                  <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>,
                  <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>,
                  <wsa:ReferenceProperties jbossesb:persistent : false/>,
                  <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/> > ]
                  ReplyTo: JMSEpr [ PortReference < <wsa:Address jms://localhost/queue/teste_queue_reply/>,
                  <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost/>,
                  <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>,
                  <wsa:ReferenceProperties jbossesb:destination-type : queue/>,
                  <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>,
                  <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>,
                  <wsa:ReferenceProperties jbossesb:message-selector : jbossESBresponseUUID='7123a235-0501-4e7d-888b-0ba0e3d83571'/>,
                  <wsa:ReferenceProperties jbossesb:persistent : false/>,
                  <wsa:ReferenceProperties jbossesb:acknowledge-mode : 1/>,
                  <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ]
                  MessageID: ID:JBM-30096 RelatesTo: jms:correlationID#de96701a-4519-4b5d-8779-181ff1c9d951 ]
                  context: [ ]
                  body: [ objects: {org.jboss.soa.esb.message.defaultEntry=testing...} ]
                  fault: [ ]
                  attachments: [ Named:{}, Unnamed:[] ]
                  properties: [ {org.jboss.soa.esb.message.time.dod=Mon Nov 19 17:37:42 BRST 2007}
                   ]


                  Now in both case (To and ReplyTo) I got persistent: false, but the performance did not improve.
                  First, I sent 5000 messages (with persistent: true) and I got average time of 26 ms. After I sent 5000 messages (with persistent: false) and I got average time of 25 ms.

                  The persistent: false seems not to make difference.
                  I am using default database (Hypersonic).
                  Is the overhead of esb of 24ms per message (with persistent: false)?
                  Thanks



                  • 21. Re: How using message in memory queue with messaging?
                    marklittle

                    That's interesting. We'll look into this and get back to you.

                    • 22. Re: How using message in memory queue with messaging?
                      beve

                      Hi Claudio,

                      I'm running tests against a postgres database to see if it displays the same results that you've seen.

                      Just wanted to ask how you are running your tests. Are you the quickstarts/load_generator? I'd like to run the same test you are so that the results are comparable.

                      Thanks,

                      Daniel

                      • 23. Re: How using message in memory queue with messaging?

                        Hi Daniel,

                        In esb file I have:

                        jboss-esb.xml:

                        <?xml version = "1.0" encoding = "UTF-8"?>
                        <jbossesb
                         xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
                         parameterReloadSecs="5">
                         <providers>
                         <jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost">
                         <jms-bus busid="testeEsbChannel">
                         <jms-message-filter dest-type="QUEUE" dest-name="queue/teste_queue" persistent="false"/>
                         </jms-bus>
                         </jms-provider>
                         </providers>
                         <services>
                         <service category="Cat" name="Serv" description="Test">
                         <listeners>
                         <jms-listener name="nametesteEsbChannel" busidref="testeEsbChannel" maxThreads="1" />
                         </listeners>
                         <actions>
                         <action name="Log" class="com.esb.TesteEsb" process="log"/>
                         <action name="Executar" class="com.esb.TesteEsb" process="executar"/>
                         </actions>
                         </service>
                         </services>
                        </jbossesb>


                        jbm-queue-service.xml:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <server>
                         <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.esb.quickstart.destination:service=Queue,name=teste_queue" xmbean-dd="xmdesc/Queue-xmbean.xml">
                         <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                         <depends>jboss.messaging:service=PostOffice</depends>
                         </mbean>
                         <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.esb.quickstart.destination:service=Queue,name=teste_queue_reply" xmbean-dd="xmdesc/Queue-xmbean.xml">
                         <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                         <depends>jboss.messaging:service=PostOffice</depends>
                         </mbean>
                        </server>


                        TesteEsb.java:

                        package com.esb;
                        
                        import org.jboss.soa.esb.actions.AbstractActionLifecycle;
                        import org.jboss.soa.esb.helpers.ConfigTree;
                        import org.jboss.soa.esb.message.Message;
                        
                        public class TesteEsb extends AbstractActionLifecycle{
                        
                         protected ConfigTree _config;
                        
                         public TesteEsb(ConfigTree config){
                         _config = config;
                         }
                        
                         public Message noOperation(Message message) {
                         return message;
                         }
                        
                         public Message log(Message message) throws Exception {
                         System.out.println(message);
                         return message;
                         }
                        
                         public Message executar(Message message) throws Exception {
                         String texto = (String)message.getBody().get();
                         texto = texto + " esb";
                         message.getBody().add(texto);
                        
                         return message;
                         }
                        
                        }


                        ------------------------------------------------------------------------------------

                        In my client I have:

                        Teste.java:

                        package com;
                        
                        import org.jboss.soa.esb.client.ServiceInvoker;
                        import org.jboss.soa.esb.couriers.FaultMessageException;
                        import org.jboss.soa.esb.message.Message;
                        import org.jboss.soa.esb.message.format.MessageFactory;
                        import org.jboss.soa.esb.message.format.MessageType;
                        
                        public class Teste {
                        
                         public static void main(String[] args) throws Exception{
                         try{
                         ServiceInvoker deliveryAdapter = new ServiceInvoker("Cat","Serv");
                        
                         MessageFactory mfactory = MessageFactory.getInstance();
                         String teste = "testing...";
                        
                         long tempo_med = 0;
                         final int QT = 5000;
                        
                         for(int i=0; i < QT; i++){
                        
                         long ini = System.currentTimeMillis();
                        
                         System.out.println("send: "+teste);
                         Message requestMessage = mfactory.getMessage(MessageType.JBOSS_XML);
                         requestMessage.getBody().add(teste);
                         Message replyMessage = deliveryAdapter.deliverSync(requestMessage,5000);
                         System.out.println("return: "+(String)replyMessage.getBody().get());
                        
                         long fin = System.currentTimeMillis();
                         fin = fin - ini;
                         System.out.println("time: "+fin+" ms");
                        
                         if (i>=10) tempo_med += fin;
                        
                         System.out.println("-------------------------------------------");
                         }
                        
                         double td = tempo_med / (QT - 10);
                         System.out.println("time medium: "+td+" ms");
                        
                         }
                         catch (FaultMessageException e){
                         e.printStackTrace();
                         }
                         }
                        
                        }


                        Daniel, I sent to your email the projects.
                        Thanks


                        • 24. Re: How using message in memory queue with messaging?

                          Hi Daniel,

                          Did you run my test?
                          Thanks.

                          • 25. Re: How using message in memory queue with messaging?
                            beve

                            Hi Claudio,

                            thanks for sending me the test code. I've run this against postgres 8.1 and I do see a difference when using persistent vs non-persistent.

                            persistent
                            time medium: 52.0 ms
                            time medium: 49.0 ms
                            time medium: 78.0 ms
                            
                            non-persistent
                            time medium: 45.0 ms
                            time medium: 43.0 ms
                            time medium: 47.0 ms
                            


                            I believe that the reason that you were not seeing any difference is that hypersonic is being used. This might have to do with hypersonic being an in-memory database.

                            Are you going to use hypersonic as your production database?

                            Please note that the tests were performed on my laptop with other apps running.

                            Regards,

                            Daniel

                            • 26. Re: How using message in memory queue with messaging?

                              Hi Daniel,

                              I am thinking to use hipersonic in production.
                              The difference with and without persistent is very small. Is the Esb really using the queues in memory? I expected a better result.
                              If was using the queues in memory, the overhead of esb is very large.
                              Thanks

                              • 27. Re: How using message in memory queue with messaging?
                                beve

                                Hi Claudio,

                                well, this is my theory about the performance of hypersonic. By default, hypersonic is configured as an in-process persistent db, which is saved when jboss stops the db upon shutdown.

                                My understanding is that peristent messages will be stored in memory, as will non-persistent messages. Persistent messages will only be stored to disk if jboss is restarted. So, I believe that this is why there is hardly a detectable difference between persistent and non-persistent messages when using an in-memory database configuration. As the test runs it consumes the messages from the response queue and hypersonic never needs to save them to disk.

                                That said, I havn't used hypersonic that much...only for testing and never in a production environment. There might be other faster in-memory databases out there.

                                Thanks,

                                Daniel

                                • 28. Re: How using message in memory queue with messaging?

                                  Hi Daniel,

                                  About hypersonic and postgres I agree, but and about the overhead? My esb service only add a String in message. I think the overhead is high (in memory).
                                  Can I do something to improve the performance of esb?
                                  Thanks

                                  • 29. Re: How using message in memory queue with messaging?
                                    marklittle

                                    BTW, we (JBoss) don't recommend Hypersonic in deployments.