aerospike-community / spring-data-aerospike-starters

spring-data-aerospike-starters
https://github.com/aerospike-community/spring-data-aerospike
15 stars 7 forks source link

Help: Setting up Aerospike Cloud #220

Open ind3x opened 11 months ago

ind3x commented 11 months ago

Hi!

I'm trying to perform a database benchmark with Gatling of Aerospike database PoC and is becoming hard to setup the database with spring-boot-starter-data-aerospike-reactive.

As far as I see, aerospike-proxy-client dependency is mandatory to connect with Aerospike Cloud and if I am not wrong, spring-boot-starter-data-aerospike-reactive is not compatible with it, right?

I tried to override aerospikeClient bean to return AerospikeClientProxy with the following example:

Bean(
    name = {"aerospikeClient"},
    destroyMethod = "close"
  )
  @ConditionalOnMissingBean({IAerospikeClient.class})
  public IAerospikeClient aerospikeProxyClient(AerospikeProperties properties, ClientPolicy aerospikeClientPolicy) {
    Host[] hosts = Host.parseHosts(properties.getHosts(), properties.getDefaultPort());
    EventPolicy eventPolicy = new EventPolicy();
    EventLoopGroup group = new NioEventLoopGroup(1);
    aerospikeClientPolicy.eventLoops = new NettyEventLoops(eventPolicy, group, EventLoopType.NETTY_NIO);
    aerospikeClientPolicy.tlsPolicy = new TlsPolicy();

    return AerospikeClientFactory.getClient(aerospikeClientPolicy, true, hosts);
  }

and when I run the Spring Boot app, I got this exception:

com.aerospike.client.AerospikeException: Error -1: Method not supported in proxy client: info

I'm doing something wrong? Maybe I misunderstood something.

Thanks in advance.

Do not hesitate to ask me for more information.

roimenashe commented 11 months ago

Hi @ind3x, thanks for showing interest in Spring Data Aerospike Starters.

At the moment Spring Data Aerospike doesn't support AerospikeProxyClient which was introduced in Aerospike 7.0 (even if you override the aerospike client with your own AerospikeClientProxy custom bean).

We are aware of this and working to support AerospikeClientProxy in the next release of Spring Data Aerospike. Once we release a new version we will comment on this ticket to keep you updated.