<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:gfe="http://www.springframework.org/schema/gemfire"
	   xmlns:p="http://www.springframework.org/schema/p"
	   xmlns:util="http://www.springframework.org/schema/util"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:schemaLocation="
	   	http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/gemfire https://www.springframework.org/schema/gemfire/spring-gemfire.xsd
		http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd
">

	<!-- tag::beans[] -->
	<!--1-->
	<util:properties id="applicationProperties"
                     location="classpath:META-INF/spring/application.properties"/>

	<!--2-->
	<context:property-placeholder properties-ref="applicationProperties"/>

	<!--3-->
	<context:annotation-config/>

	<!--4-->
	<bean class="org.springframework.session.data.gemfire.config.annotation.web.http.GemFireHttpSessionConfiguration"
          p:maxInactiveIntervalInSeconds="30"/>

	<!--5-->
	<bean class="sample.GemFireCacheServerReadyBeanPostProcessor"/>

	<!--6-->
	<util:properties id="gemfireProperties">
		<prop key="log-level">${sample.httpsession.gemfire.log-level:warning}</prop>
	</util:properties>

	<gfe:client-cache properties-ref="gemfireProperties"/>

	<!--7-->
	<gfe:pool free-connection-timeout="5000"
              keep-alive="false"
              ping-interval="5000"
              read-timeout="5000"
              retry-attempts="2"
              subscription-enabled="true"
              thread-local-connections="false"
              max-connections="${application.gemfire.client-server.max-connections}">
		<gfe:server host="${application.gemfire.client-server.host}"
                    port="${spring.session.data.gemfire.port:${application.gemfire.client-server.port}}"/>
	</gfe:pool>
	<!-- end::beans[] -->

</beans>
