How to configure Hazelcast for session caching using spring while limiting it to a set of nodes?

前端 未结 3 1175
花落未央
花落未央 2021-01-03 11:55

I need to set up Hazelcast session caching using Spring. Using the configuration from the hazelcast docs is simple. However, its insufficient. I need to use a different c

3条回答
  •  -上瘾入骨i
    2021-01-03 12:36

    Why dont you jat put in src/main/resources a file per environement. So that you have: dev.properties,qa.properties,prod.properties

    use an environement variable such as ENV. which in my situation i have put ENV=dev and then inside my spring-servlet.xml i have:

    
        
            classpath:/${SERVER_ENV}.hazelcast.properties
        
    
    

    and then in the same file i use properties this way:

    
            
                
                ${hz.instance.name}
                
                
                
                
                
                
                    
                        
                        
                            ${hz.members}
                        
                    
                
                
                
            
        
    

提交回复
热议问题