Использование Aerospike и Redis вместе в Spring BootJAVA

Программисты JAVA общаются здесь
Anonymous
 Использование Aerospike и Redis вместе в Spring Boot

Сообщение Anonymous »

Я хочу использовать Redis и Aerospike вместе, в том смысле, что я хочу использовать Aerospike для кэширования весеннего > Я получаю ошибку в настройке Aerospike, ошибка заключается в том, что когда я настраиваю раздел управления аэроспокором кэша, он получает ошибку со значением по умолчанию для Redis весной. < /P>
Это моя аэрокосмическая конфигурация: < /p>
@Configuration
@EnableConfigurationProperties(AerospikeProperties.class)
@EnableAerospikeRepositories(basePackageClasses = {CacheableFileEntityRepository.class})
public class AerospikeConfig extends AbstractAerospikeDataConfiguration {
@Autowired
private AerospikeProperties aerospikeProperties;

@Override
protected Collection getHosts() {
return aerospikeProperties.getHosts() ;
}

@Override
protected String nameSpace() {
return aerospikeProperties.getNamespace();
}

}
< /code>
И это мои аэрокосмические свойства: < /p>
@Log4j2
@Data
@Profile("aerospike")
@ConfigurationProperties(prefix = "aerospike")
@RequiredArgsConstructor(onConstructor_ ={@Autowired})

public class AerospikeProperties {

@Value("${spring.aerospike.host}")
private String host;

@Value("${spring.aerospike.port}")
private int port;

@Value("${spring.aerospike.namespace}")
private String namespace;

@Value("${spring.aerospike.policies.client.readTimeout}")
private int readTimeout;
@Value("${spring.aerospike.policies.client.writeTimeout}")
private int writeTimeout;
@Value("${spring.aerospike.policies.client.connectionTimeout}")
private int connectionTimeout;
@Value("${spring.aerospike.policies.client.maxSocketIdle}")
private int maxSocketIdle;
@Value("${spring.aerospike.policies.client.totalTimeout}")
private int totalTimeout;

@Bean(destroyMethod = "close")
public AerospikeClient aerospikeClient() {

try {
ClientPolicy clientPolicy = new ClientPolicy();
clientPolicy.readPolicyDefault.replica = Replica.MASTER;
clientPolicy.readPolicyDefault.readModeAP = ReadModeAP.ONE;
clientPolicy.writePolicyDefault.commitLevel = CommitLevel.COMMIT_ALL;
clientPolicy.readPolicyDefault.socketTimeout = readTimeout;
clientPolicy.readPolicyDefault.totalTimeout = totalTimeout;
clientPolicy.writePolicyDefault.socketTimeout = writeTimeout;
clientPolicy.writePolicyDefault.totalTimeout = totalTimeout;
clientPolicy.maxSocketIdle=maxSocketIdle;
clientPolicy.timeout=connectionTimeout;
return new AerospikeClient(clientPolicy, host, port);
} catch (RuntimeException e) {
return null;
}
}

protected Collection getHosts() {
return Collections.singleton(new Host(host, port));
}

protected String getNamespace() {
return namespace;
}
}
< /code>
Я хочу добавить этот код и иметь ошибку: < /p>
@Bean
public AerospikeCacheManager cacheManager(AerospikeClient aerospikeClient) {
AerospikeCacheConfiguration defaultConfiguration = new AerospikeCacheConfiguration("tax_registration");
return new AerospikeCacheManager(aerospikeClient, mappingAerospikeConverter, defaultConfiguration);
}
< /code>
Это ошибка: < /p>
Parameter 1 of constructor in org.springframework.data.aerospike.convert.MappingAerospikeConverter required a single bean, but 2 were found:
- org.springframework.data.aerospike.convert.AerospikeCustomConversions: defined in unknown location
- redisCustomConversions: defined in unknown location
< /code>
Я использую эти аннотации, но не работал < /p>
@Qualifier
@Primary
< /code>
Это моя весенняя загрузка и аэроспольная версия: < /p>

org.springframework.boot
spring-boot-starter-parent
3.2.1




com.aerospike
spring-data-aerospike
$4.8.0



Подробнее здесь: https://stackoverflow.com/questions/792 ... pring-boot

Вернуться в «JAVA»