Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12802

TypedProperties::getXProperty should return the value if match the type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 12.1.0.Final
    • 12.0.1.Final
    • Hot Rod
    • None

      While doing a test with

            Properties properties = new Properties();
            properties.put(DEFAULT_EXECUTOR_FACTORY_POOL_SIZE, 25);
      
            ConfigurationBuilder cb = new ConfigurationBuilder().uri("hotrod://admin:admin@localhost:11222");
            cb.asyncExecutorFactory().factory(p -> new NioEventLoopGroup(2));
            cb.withProperties(properties);
      
            String cacheName = "fooCache";
      
            RemoteCacheManager remoteCacheManager = new RemoteCacheManager(cb.build());
            remoteCacheManager.administration().removeCache(cacheName);
            remoteCacheManager.administration().createCache(cacheName, "org.infinispan.DIST_SYNC");
      
            remoteCacheManager.getCache("fooCache").put("foo", "bar");
      

      The code in ChannelFactory is returning the default value

         private int maxAsyncThreads(ExecutorService executorService, Configuration configuration) {
            if (executorService instanceof ThreadPoolExecutor) {
               return ((ThreadPoolExecutor) executorService).getMaximumPoolSize();
            }
            // Note: this is quite dangerous, if someone sets different executor factory and does not update this setting
            // we might deadlock
            return new ConfigurationProperties(configuration.asyncExecutorFactory().properties()).getDefaultExecutorFactoryPoolSize();
         }
      

      This is because in TypedProperties it is waiting for the value as String

         public int getIntProperty(String key, int defaultValue, boolean doStringReplace) {
            String value = this.getProperty(key);
            if (value == null) {
      

            dlovison@redhat.com Diego Lovison
            dlovison@redhat.com Diego Lovison
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: