How to enable "scansEnabled" property of org.springframework.data.aerospike.config.AerospikeDataSettings?

578 Views Asked by At

I am using spring-data-aerospike dependency within my spring boot app to interact with Aerospike db. I ran into the follow error while using findAll() method of AerospikeRepository (which is synonymous to the findAll() method provided by CrudRepository).

java.lang.IllegalStateException: Query without a filter will initiate a scan. Since scans are potentially dangerous operations, they are disabled by default in spring-data-aerospike. If you still need to use them, enable them via scansEnabled property in org.springframework.data.aerospike.config.AerospikeDataSettings.

Any leads or pointers is greatly appreciated.

1

There are 1 best solutions below

1
On

Leaving the answer for anyone who runs into the same issue.

Here is what I did to resolve the issue.

Referenced the code in org.springframework.data.aerospike.config.AerospikeDataSettings and overrode the bean in my applications Aerospike config class

  *@Bean
  public AerospikeDataSettings aerospikeDataSettings() {
    return AerospikeDataSettings.builder().scansEnabled(true).sendKey(true).build();
  }*