modules/andes-core/broker/src/main/java/org/wso2/andes/store/rdbms/RDBMSMessageStoreImpl.java
private void initializeQueueMappingCache() {

        // The size of the queue mappings cache in MegaBytes
        final int QUEUE_CACHE_SIZE = 2;

        // Expected concurrency for the cache (4 is guava default)
        final int QUEUE_CACHE_CONCURRENCY_LEVEL = 4;

        queueMappings = CacheBuilder.newBuilder().concurrencyLevel(QUEUE_CACHE_CONCURRENCY_LEVEL)
                .maximumWeight(QUEUE_CACHE_SIZE * 1024 * 1024).weigher(new Weigher<String, Integer>() {

                    @Override
                    public int weigh(String s, Integer integer) {
                        return s.length();
                    }
                }).build(new CacheLoader<String, Integer>() {
                    public Integer load(String queueName) throws AndesException {
                        try {
                            Integer queueID = getQueueID(queueName);
                            if (log.isDebugEnabled()) {
                                log.debug("Loaded queue: " + queueName + " to the cache from database");
                            }
                            return queueID;
                        } catch (SQLException e) {
                            throw new AndesException("Error retrieving queue id for queue: " + queueName, e);
                        }
                    }
                });
    }
/**
     * Method to initialize the queue mapping cache.
     * <p>
     * The queue mapping cache is what holds the queue mappings(queue name to queue id) in memory. The cache is
     * initialized with a loader so that a queue name which is not present in the cache is loaded from the database
     * upon a query for a queue name.
     */
Method to initialize the queue mapping cache.

The queue mapping cache is what holds the queue mappings(queue name to queue id) in memory. The cache is
initialized with a loader so that a queue name which is not present in the cache is loaded from the database
upon a query for a queue name.
Method to initialize the queue mapping cache . The queue mapping cache is what holds the queue mappings ( queue name to queue id ) in memory . The cache is initialized with a loader so that a queue name which is not present in the cache is loaded from the database upon a query for a queue name .
private void initializeQueueMappingCache() {
        final int QUEUE_CACHE_SIZE = 2;
        final int QUEUE_CACHE_CONCURRENCY_LEVEL = 4;
        queueMappings = CacheBuilder.newBuilder().concurrencyLevel(QUEUE_CACHE_CONCURRENCY_LEVEL)
                .maximumWeight(QUEUE_CACHE_SIZE * 1024 * 1024).weigher(new Weigher<String, Integer>() {
                    @Override
                    public int weigh(String s, Integer integer) {
                        return s.length();
                    }
                }).build(new CacheLoader<String, Integer>() {
                    public Integer load(String queueName) throws AndesException {
                        try {
                            Integer queueID = getQueueID(queueName);
                            if (log.isDebugEnabled()) {
                                log.debug("Loaded queue: " + queueName + " to the cache from database");
                            }
                            return queueID;
                        } catch (SQLException e) {
                            throw new AndesException("Error retrieving queue id for queue: " + queueName, e);
                        }
                    }
                });
    }
private void initializeQueueMappingCache ( ) { final int QUEUE_CACHE_SIZE = 2 ; final int QUEUE_CACHE_CONCURRENCY_LEVEL = 4 ; queueMappings = CacheBuilder . newBuilder ( ) . concurrencyLevel ( QUEUE_CACHE_CONCURRENCY_LEVEL ) . maximumWeight ( QUEUE_CACHE_SIZE * 1024 * 1024 ) . weigher ( new Weigher < String , Integer > ( ) { @ Override public int weigh ( String s , Integer integer ) { return s . length ( ) ; } } ) . build ( new CacheLoader < String , Integer > ( ) { public Integer load ( String queueName ) throws AndesException { try { Integer queueID = getQueueID ( queueName ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Loaded queue: " + queueName + " to the cache from database" ) ; } return queueID ; } catch ( SQLException e ) { throw new AndesException ( "Error retrieving queue id for queue: " + queueName , e ) ; } } } ) ; }
Method to initialize the queue mapping cache.
Method to initialize the queue mapping cache .
// The size of the queue mappings cache in MegaBytes // Expected concurrency for the cache (4 is guava default)