Resolve RED-6686 "2"
This commit is contained in:
parent
79b70f75d6
commit
e763750efa
@ -17,7 +17,7 @@
|
||||
<bucket4j.version>6.4.1</bucket4j.version>
|
||||
<bucket4j.spring.version>0.4.0</bucket4j.spring.version>
|
||||
<swagger-commons.version>0.5.0</swagger-commons.version>
|
||||
<keycloak-commons.version>0.14.0</keycloak-commons.version>
|
||||
<keycloak-commons.version>0.18.0</keycloak-commons.version>
|
||||
<jobs-commons.version>0.6.0</jobs-commons.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package com.iqser.red.service.persistence.management.v1.processor.cache;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
||||
@Configuration
|
||||
public class RedisConfiguration {
|
||||
|
||||
@Bean
|
||||
RedisStandaloneConfiguration redisStandaloneConfiguration(Environment environment) {
|
||||
|
||||
var configuration = new RedisStandaloneConfiguration();
|
||||
configuration.setHostName(environment.getProperty("REDIS_HOST", "localhost"));
|
||||
configuration.setPort(environment.getProperty("REDIS_PORT", Integer.class, 6379));
|
||||
configuration.setPassword(environment.getProperty("REDIS_PASSWORD"));
|
||||
configuration.setUsername(environment.getProperty("REDIS_USERNAME"));
|
||||
|
||||
return configuration;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
LettuceConnectionFactory lettuceConnectionFactory(RedisStandaloneConfiguration redisStandaloneConfiguration) {
|
||||
|
||||
return new LettuceConnectionFactory(redisStandaloneConfiguration);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<String, Object> redisTemplate(RedisStandaloneConfiguration redisStandaloneConfiguration) {
|
||||
|
||||
RedisTemplate<String, Object> template = new RedisTemplate<>();
|
||||
template.setConnectionFactory(lettuceConnectionFactory(redisStandaloneConfiguration));
|
||||
return template;
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,13 +31,7 @@ spring:
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant-path-matcher
|
||||
redis:
|
||||
host: ${REDIS_HOST:localhost}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PASSWORD:}
|
||||
|
||||
profiles:
|
||||
active: kubernetes
|
||||
rabbitmq:
|
||||
host: ${RABBITMQ_HOST:localhost}
|
||||
port: ${RABBITMQ_PORT:5672}
|
||||
@ -54,11 +48,6 @@ spring:
|
||||
prefetch: 1
|
||||
application:
|
||||
name: persistence-service
|
||||
data:
|
||||
redis:
|
||||
host: ${REDIS_HOST:localhost}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PASSWORD:}
|
||||
|
||||
management:
|
||||
endpoint:
|
||||
@ -109,19 +98,20 @@ bucket4j:
|
||||
unit: seconds
|
||||
|
||||
|
||||
springdoc.packages-to-scan: [ 'com.iqser.red.persistence.service.v1.external.api' ]
|
||||
|
||||
fforesight:
|
||||
keycloak:
|
||||
ignored-endpoints: [ '/redaction-gateway-v1','/actuator/health/**', '/redaction-gateway-v1/async/download/with-ott/**',
|
||||
'/internal-api/**',
|
||||
'/redaction-gateway-v1/docs/**','/redaction-gateway-v1/docs','/redaction-gateway-v1/tenants/simple' ]
|
||||
'/internal-api/**', '/redaction-gateway-v1/docs/swagger-ui',
|
||||
'/redaction-gateway-v1/docs/**','/redaction-gateway-v1/docs', ]
|
||||
enabled: true
|
||||
springdoc:
|
||||
base-path: '/redaction-gateway-v1'
|
||||
auth-server-url: ${keycloak.auth-server-url}
|
||||
enabled: true
|
||||
default-client-id: 'swagger-ui-client'
|
||||
packages-to-scan: [ 'com.iqser.red.persistence.service.v1.external.api' ]
|
||||
default-tenant: 'redaction'
|
||||
tenant-exchange:
|
||||
name: 'tenants-exchange'
|
||||
user-exchange:
|
||||
@ -137,3 +127,16 @@ fforesight:
|
||||
tenants:
|
||||
remote: true
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
path: ${fforesight.springdoc.base-path}/docs/swagger-ui
|
||||
operations-sorter: alpha
|
||||
tags-sorter: alpha
|
||||
oauth:
|
||||
client-id: swagger-ui-client
|
||||
doc-expansion: none
|
||||
config-url: ${fforesight.springdoc.base-path}/docs/swagger-config
|
||||
api-docs:
|
||||
path: ${fforesight.springdoc.base-path}/docs?tenantId=${fforesight.springdoc.default-tenant}
|
||||
enabled: ${fforesight.springdoc.enabled}
|
||||
pre-loading-enabled: true
|
||||
|
||||
@ -417,10 +417,8 @@ public abstract class AbstractPersistenceServerServiceTest {
|
||||
|
||||
log.info("Hosts are - Redis: {}, Postgres: {}", redisContainer.getHost(), postgreSQLContainerMaster.getHost());
|
||||
|
||||
TestPropertyValues.of("spring.redis.port=" + redisContainer.getFirstMappedPort(),
|
||||
"spring.redis.host=" + redisContainer.getHost(),
|
||||
"spring.data.redis.port=" + redisContainer.getFirstMappedPort(),
|
||||
"spring.data.redis.host=" + redisContainer.getHost(),
|
||||
TestPropertyValues.of("REDIS_PORT=" + redisContainer.getFirstMappedPort(),
|
||||
"REDIS_HOST=" + redisContainer.getHost(),
|
||||
"fforesight.jobs.enabled=false",
|
||||
"fforesight.keycloak.enabled=false").applyTo(configurableApplicationContext.getEnvironment());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user