5 Replies Latest reply on Jan 7, 2010 4:40 PM by clebert.suconic

    Paging Configuration

      Can I setting values to max-size-bytes and page-size-bytes properties using ConfigurationImpl class?
        • 1. Re: Paging Configuration
          timfox
          No, you need to use AddressSettings
          • 2. Re: Paging Configuration

            Hy Tim, thanks for you response.

             

            Now, I'm trying to set the AddressSettings, but the warning message about the available memory are printed the same way.

            The code below it's correct?

             

            try {
                 configuration.start();
                 server = HornetQ.newHornetQServer(configuration);
                 server.start();

             

                 addressSet = server.getAddressSettingsRepository();
                 queueSetting = new AddressSettings();
                 queueSetting.setMaxSizeBytes(10485760);
                 queueSetting.setPageSizeBytes(1048576);
                 addressSet.setDefault(queueSetting);

             

                 connectionFactory = new HornetQConnectionFactory(new TransportConfiguration(InVMConnectorFactory.class.getName()));
                 clientSession = connectionFactory.getCoreFactory().createSession();

                 try {
                      clientSession.createQueue("queueName", "queueName", true);
                 } catch (HornetQException e) {
                      if (e.getCode() != HornetQException.QUEUE_EXISTS)
                           e.printStackTrace();
                 }

            } catch (Exception e) {
                 e.printStackTrace();
            }

             

            Thanks,

            Julio

            • 3. Re: Paging Configuration
              clebert.suconic

              Did you read this other thread about paging? (next one on the forums)

               

              http://community.jboss.org/thread/146457?tstart=0

              • 4. Re: Paging Configuration

                Hy Clebert,

                 

                Yes I read it.

                Are you asking becouse the ACK?
                Yes, I'm acknowledging the messages.

                 

                My problem is whith this warning:

                Jan 6, 2010 9:43:54 PM org.hornetq.core.logging.Logger warn
                WARNING: Less than 25%
                free memory:      2.80 kiB
                max memory:       63.56 MiB
                total memory:     63.56 MiB
                available memory: 0.00%

                 

                You are in danger of running out of RAM. Have you set paging parameters on your addresses? (See user manual "Paging" chapter)

                • 5. Re: Paging Configuration
                  clebert.suconic

                  Hmmm.. I'm not sure if the setDefault would work on the AddressSettingsRepository for paging. (If that's the case you could maybe open a JIRA?)

                   

                  Can you try this instead?

                   

                   

                        AddressSettings defaultSetting = new AddressSettings();
                        defaultSetting.setPageSizeBytes(pageSize);
                        defaultSetting.setMaxSizeBytes(maxAddressSize);

                   

                        server.getAddressSettingsRepository().addMatch("#", defaultSetting);