Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Update profile configuration identifiers for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Jun 7, 2018
1 parent 0b0198f commit b4daded
Show file tree
Hide file tree
Showing 3 changed files with 491 additions and 490 deletions.
113 changes: 57 additions & 56 deletions opensrp-core/src/main/resources/applicationContext-opensrp.xml
Original file line number Diff line number Diff line change
@@ -1,78 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:activemq.properties" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:activemq.properties"/>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>

<import resource="classpath:applicationScheduler.xml" />
<import resource="classpath:applicationPlatformServerAPI.xml" />
<import resource="classpath:applicationSmsHttp.xml" />
<import resource="classpath:applicationSmsAPI.xml" />
<import resource="classpath:applicationSchedulerTrackingAPI.xml" />
<import resource="classpath:applicationScheduler.xml"/>
<import resource="classpath:applicationPlatformServerAPI.xml"/>
<import resource="classpath:applicationSmsHttp.xml"/>
<import resource="classpath:applicationSmsAPI.xml"/>
<import resource="classpath:applicationSchedulerTrackingAPI.xml"/>

<context:property-placeholder location="classpath*:maven.properties" />
<context:property-placeholder location="classpath*:maven.properties"/>

<util:properties id="opensrp" location="classpath:/opensrp.properties" />
<util:properties id="opensrp" location="classpath:/opensrp.properties"/>

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

<bean id="statsdAgent" class="org.motechproject.metrics.impl.LoggingAgentBackendImpl" />
<bean id="statsdAgent" class="org.motechproject.metrics.impl.LoggingAgentBackendImpl"/>

<beans profile="Postgres">
<import resource="persistence_postgres.xml" />
</beans>
<beans profile="postgres">
<import resource="persistence_postgres.xml"/>
</beans>

<beans profile="CoachDB">
<import resource="persistence_couchdb.xml" />
</beans>
<beans profile="couchDb">
<import resource="persistence_couchdb.xml"/>
</beans>

<beans profile="Jedis">
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig"
p:max-total="${redis.pool.max.connections}" p:test-on-borrow="true"
p:test-on-return="true" />
<beans profile="jedis">
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig"
p:max-total="${redis.pool.max.connections}" p:test-on-borrow="true"
p:test-on-return="true"/>

<bean id="jedisConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:host-name="${redis.host}" p:port="${redis.port}" p:password="${redis.password}"
p:use-pool="true">
<constructor-arg ref="jedisPoolConfig" />
</bean>
<bean id="jedisConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:host-name="${redis.host}" p:port="${redis.port}" p:password="${redis.password}"
p:use-pool="true">
<constructor-arg ref="jedisPoolConfig"/>
</bean>

<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"
p:connection-factory-ref="jedisConnectionFactory"
p:enable-transaction-support="true" />
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"
p:connection-factory-ref="jedisConnectionFactory"
p:enable-transaction-support="true"/>

</beans>
</beans>

<beans profile="Lettuce">
<bean id="lettucePool"
class="org.springframework.data.redis.connection.lettuce.DefaultLettucePool">
<property name="hostName" value="${redis.host}" />
<property name="port" value="${redis.port}" />
<property name="password" value="${redis.password}" />
<property name="poolConfig" ref="lettucePoolConfiguration" />
</bean>
<beans profile="lettuce">
<bean id="lettucePool"
class="org.springframework.data.redis.connection.lettuce.DefaultLettucePool">
<property name="hostName" value="${redis.host}"/>
<property name="port" value="${redis.port}"/>
<property name="password" value="${redis.password}"/>
<property name="poolConfig" ref="lettucePoolConfiguration"/>
</bean>

<bean id="lettucePoolConfiguration" class="org.springframework.data.redis.connection.PoolConfig"
p:max-total="${redis.pool.max.connections}" p:test-on-borrow="true"
p:test-on-return="true" />
<bean id="lettucePoolConfiguration" class="org.springframework.data.redis.connection.PoolConfig"
p:max-total="${redis.pool.max.connections}" p:test-on-borrow="true"
p:test-on-return="true"/>

<bean id="lettuceConnectionFactory"
class="org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory">
<constructor-arg index="0" ref="lettucePool" />
</bean>
<bean id="lettuceConnectionFactory"
class="org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory">
<constructor-arg index="0" ref="lettucePool"/>
</bean>

<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"
p:connection-factory-ref="lettuceConnectionFactory"
p:enable-transaction-support="true" />
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"
p:connection-factory-ref="lettuceConnectionFactory"
p:enable-transaction-support="true"/>

</beans>
</beans>
</beans>
8 changes: 4 additions & 4 deletions opensrp-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</properties>
<profiles>
<profile>
<id>Jedis</id>
<id>jedis</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
Expand All @@ -33,7 +33,7 @@
</property>
</activation>
<properties>
<opensrp.redis.client.profile>Jedis</opensrp.redis.client.profile>
<opensrp.redis.client.profile>jedis</opensrp.redis.client.profile>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
Expand All @@ -45,15 +45,15 @@
</dependencies>
</profile>
<profile>
<id>Lettuce</id>
<id>lettuce</id>
<activation>
<property>
<name>opensrp.redis.client.type</name>
<value>lettuce</value>
</property>
</activation>
<properties>
<opensrp.redis.client.profile>Lettuce</opensrp.redis.client.profile>
<opensrp.redis.client.profile>lettuce</opensrp.redis.client.profile>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.lambdaworks/lettuce -->
Expand Down
Loading

0 comments on commit b4daded

Please sign in to comment.