Skip to content

Commit

Permalink
[pinpoint-apm#10232] Separated redis property sources
Browse files Browse the repository at this point in the history
  • Loading branch information
smilu97 committed Aug 22, 2023
1 parent 370005a commit 9a9560e
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.navercorp.pinpoint.collector;

import com.navercorp.pinpoint.common.server.util.ServerBootLogger;
import com.navercorp.pinpoint.redis.RedisPropertySources;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
Expand All @@ -22,6 +23,7 @@
})
@Import({
PinpointCollectorModule.class,
RedisPropertySources.class,
})
public class CollectorApp {
private static final ServerBootLogger logger = ServerBootLogger.getLogger(CollectorApp.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.navercorp.pinpoint.collector.starter.multi.application;

import com.navercorp.pinpoint.collector.PinpointCollectorModule;
import com.navercorp.pinpoint.redis.RedisPropertySources;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
Expand All @@ -22,6 +23,9 @@
RedisReactiveAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class
})
@Import({PinpointCollectorModule.class})
@Import({
PinpointCollectorModule.class,
RedisPropertySources.class,
})
public class BasicCollectorApp {
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.navercorp.pinpoint.inspector.web.InspectorWebApp;
import com.navercorp.pinpoint.login.basic.PinpointBasicLoginConfig;
import com.navercorp.pinpoint.metric.web.MetricWebApp;
import com.navercorp.pinpoint.redis.RedisPropertySources;
import com.navercorp.pinpoint.uristat.web.UriStatWebConfig;
import com.navercorp.pinpoint.web.AuthorizationConfig;
import com.navercorp.pinpoint.web.PinpointWebModule;
Expand Down Expand Up @@ -50,6 +51,7 @@
@Import({
PinpointWebModule.class,
MainDataSourcePropertySource.class,
RedisPropertySources.class,
})
public class MetricAndWebApp {
private static final ServerBootLogger logger = ServerBootLogger.getLogger(WebApp.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
import org.springframework.data.redis.connection.RedisClusterConfiguration;
import org.springframework.data.redis.connection.RedisConfiguration;
Expand All @@ -44,7 +43,6 @@
* @author youngjin.kim2
*/
@Configuration(proxyBeanMethods = false)
@Import({ RedisPropertySources.class })
public class RedisBasicConfig {

@Value("${spring.data.redis.username:default}")
Expand All @@ -59,7 +57,7 @@ public class RedisBasicConfig {
@Value("${spring.data.redis.port:6379}")
int port;

@Value("${spring.data.redis.cluster.nodes}")
@Value("${spring.data.redis.cluster.nodes:#{''}}")
List<String> clusterNodes;
@Value("${spring.data.redis.lettuce.client.io-thread-pool-size:8}")
int lettuceIOThreadPoolSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
})
public class RedisPropertySources {

public static final String REDIS_ROOT = "classpath:redis-root.properties";
public static final String REDIS_PROFILE = "classpath:profiles/${pinpoint.profiles.active:local}/redis.properties";
public static final String REDIS_ROOT = "classpath:redis/redis-root.properties";
public static final String REDIS_PROFILE = "classpath:redis/profiles/${pinpoint.profiles.active:local}/redis.properties";

}
2 changes: 2 additions & 0 deletions web/src/main/java/com/navercorp/pinpoint/web/WebApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.navercorp.pinpoint.common.server.util.ServerBootLogger;
import com.navercorp.pinpoint.datasource.MainDataSourcePropertySource;
import com.navercorp.pinpoint.login.basic.PinpointBasicLoginConfig;
import com.navercorp.pinpoint.redis.RedisPropertySources;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
Expand All @@ -43,6 +44,7 @@
@Import({
PinpointWebModule.class,
MainDataSourcePropertySource.class,
RedisPropertySources.class,
})
public class WebApp {
private static final ServerBootLogger logger = ServerBootLogger.getLogger(WebApp.class);
Expand Down

0 comments on commit 9a9560e

Please sign in to comment.