8 Replies Latest reply on Jul 9, 2010 10:35 AM by wiktorowski maximilien

    Netty vs InVM

    wiktorowski maximilien Novice

      Hi,

       

      by default the ressource adapter is configured to use netty as transport type.

      i'm using jboss with hornetq embedded so i'd prefer use invm one.

       

      In my application i'm queing 10 000 messages in a single transaction. It works using netty but with invm it blocks.

      I think it's a max bytesize problem but i don't know how this can be configure.

       

      thanks

      Maximilien

        • 1. Re: Netty vs InVM
          wiktorowski maximilien Novice

          This happens only when using MDB.

          I've just try using invm with core and i'm not limited.

          • 2. Re: Netty vs InVM
            Andy Taylor Master

            could you provide an easily runnable test that someone could take a look at. Also make sure you have tested with trunk.

            • 3. Re: Netty vs InVM
              wiktorowski maximilien Novice

              hi,

               

              this this a simple example

               

              i have a stateless session bean that just try to send 10000 messages in a queue

               

               

              public void send(String text) throws Exception
              {
                   ...
                   QueueConnectionFactory cf = (QueueConnectionFactory)ic.lookup("java:/JmsXA");
                   jmsConnection = cf.createQueueConnection();
                   Session session = jmsConnection.createQueueSession(true,Session.SESSION_TRANSACTED);
                   MessageProducer messageProducer = session.createProducer(queue);
              
                   for(int i=0;i<10000;i++)
                   {
                        TextMessage message = session.createTextMessage(text + i);
                        message.setStringProperty("target", "essai");
                        message.setStringProperty("id", "id-"+i);
                        messageProducer.send(message);
                   }
                   ...
              }

               

              it works configuring netty as transport type in ra.xml

               

               

                   ...
                   <config-property>
                       <description>The transport type</description>
                       <config-property-name>ConnectorClassName</config-property-name>
                       <config-property-type>java.lang.String</config-property-type>
                       <config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>
                    </config-property>
                    <config-property>
                       <description>The transport configuration. These values must be in the form of key=val;key=val;</description>
                       <config-property-name>ConnectionParameters</config-property-name>
                       <config-property-type>java.lang.String</config-property-type>
                       <config-property-value>host=localhost;port=5445</config-property-value>
                    </config-property>
                   ...
              

               

              but not using invm

               

                   ...
                   <config-property>
                       <description>The transport type</description>
                       <config-property-name>ConnectorClassName</config-property-name>
                       <config-property-type>java.lang.String</config-property-type>
                       <config-property-value>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</config-property-value>
                    </config-property>
                    <config-property>
                       <description>The transport configuration. These values must be in the form of key=val;key=val;</description>
                       <config-property-name>ConnectionParameters</config-property-name>
                       <config-property-type>java.lang.String</config-property-type>
                       <config-property-value>server-id=0</config-property-value>
                    </config-property>
                   ...
              

               

              with invm after 5517 messages the call to producer.send hangs

               

              Thanks,

              Maximilien

              • 4. Re: Netty vs InVM
                Andy Taylor Master

                can you post a thread dump?

                • 5. Re: Netty vs InVM
                  wiktorowski maximilien Novice

                  i got it, it's just a problem of producer window size

                   

                  Thanks,

                  Maximilien

                  • 6. Re: Netty vs InVM
                    wiktorowski maximilien Novice

                    is it normal there is no method setProducerWindowSize at ResourceAdapter level ?

                    • 7. Re: Netty vs InVM
                      wiktorowski maximilien Novice

                      no luck using producerWindowSize, producer.send still hang on semaphore.acquire(credits) when setting producerWindowSize to -1

                       

                       

                      package org.hornetq.core.client.impl;
                      ...
                      public class ClientProducerCreditsImpl implements ClientProducerCredits
                      ...
                      public void acquireCredits(final int credits) throws InterruptedException
                         {
                            checkCredits(credits);
                      
                            semaphore.acquire(credits);
                         }
                      
                      • 8. Re: Netty vs InVM
                        wiktorowski maximilien Novice

                        got it, it was just the default address-settings wildcard in  hornetq-configuration.xml that fixes a max-size-bytes with a BLOCK  policy

                         

                        Have a good weekend ;-)