# Java Client

**URL:** https://discuss.aerospike.com/c/client-libraries/java-client/11.md

[Latest](https://discuss.aerospike.com/latest.md) · [Categories](https://discuss.aerospike.com/categories.md) · [Tags](https://discuss.aerospike.com/tags.md)

---

## [About the Java Client category](https://discuss.aerospike.com/t/about-the-java-client-category/33)

<div class="topic-metadata">

**Author:** [@kporter](https://discuss.aerospike.com/u/kporter)\
**Replies:** 0

</div>

Discuss the Java client.

---

## [Batch Writes Thread Executor Overhead: Worth It for Large or Small Batch Sizes?](https://discuss.aerospike.com/t/batch-writes-thread-executor-overhead-worth-it-for-large-or-small-batch-sizes/12124)

<div class="topic-metadata">

**Author:** [@Tamilarasu](https://discuss.aerospike.com/u/Tamilarasu)\
**Replies:** 5\
**Last updated:** [March 4, 2025, 5:01pm UTC](https://discuss.aerospike.com/t/batch-writes-thread-executor-overhead-worth-it-for-large-or-small-batch-sizes/12124 "2025-03-04T17:01:48Z")

</div>

I’m analyzing the client.operate(BatchPolicy policy, List\<BatchRecord\> records) method in Aerospike and found that it calls BatchExecutor.execute(cluster, policy, commands, status), where a new ExecutorService is created…

---

## [Parameter Error when writing a record using RecordExistsAction.REPLACE](https://discuss.aerospike.com/t/parameter-error-when-writing-a-record-using-recordexistsaction-replace/12059)

<div class="topic-metadata">

**Author:** [@shan.p](https://discuss.aerospike.com/u/shan.p)\
**Replies:** 6\
**Last updated:** [January 29, 2025, 4:05am UTC](https://discuss.aerospike.com/t/parameter-error-when-writing-a-record-using-recordexistsaction-replace/12059 "2025-01-29T04:05:49Z")

</div>

Aerospike server version: 6.3 Aerospike Java client version: 6.1.1 When I create or update a record with 3 bins (two string values and one a Map), with WritePolicy having RecordExistsAction.REPLACE: WritePolicy writePo…

---

## [Possible reasons for error code -8](https://discuss.aerospike.com/t/possible-reasons-for-error-code-8/7578)

<div class="topic-metadata">

**Author:** [@Shashilpi\_Krishan](https://discuss.aerospike.com/u/Shashilpi_Krishan)\
**Replies:** 11\
**Last updated:** [July 19, 2024, 10:23am UTC](https://discuss.aerospike.com/t/possible-reasons-for-error-code-8/7578 "2024-07-19T10:23:51Z")

</div>

Hi all I have 3 node aerospike cluster which is consumed by java application (using Aero client 4.2.3) and suddenly from past 1 week we have started getting socketTimeouts on client side. Checked that we have set Clien…

---

## [Querying for records with a large number of keys](https://discuss.aerospike.com/t/querying-for-records-with-a-large-number-of-keys/11214)

<div class="topic-metadata">

**Author:** [@Brent212](https://discuss.aerospike.com/u/Brent212)\
**Replies:** 7\
**Last updated:** [June 20, 2024, 4:57am UTC](https://discuss.aerospike.com/t/querying-for-records-with-a-large-number-of-keys/11214 "2024-06-20T04:57:09Z")

</div>

I need to query up to 2 million records using a set of keys. Memory restrictions prevent the application from reading them all in at once, so I need to write the record data out to files as it comes in rather than receiv…

---

## [Getting InvalidNamespace: Error 20,1: Partition map empty with java client only, go client is fine](https://discuss.aerospike.com/t/getting-invalidnamespace-error-20-1-partition-map-empty-with-java-client-only-go-client-is-fine/11205)

<div class="topic-metadata">

**Author:** [@bobbyajp](https://discuss.aerospike.com/u/bobbyajp)\
**Replies:** 4\
**Last updated:** [June 13, 2024, 8:10pm UTC](https://discuss.aerospike.com/t/getting-invalidnamespace-error-20-1-partition-map-empty-with-java-client-only-go-client-is-fine/11205 "2024-06-13T20:10:41Z")

</div>

Running a 7.1.0.1 local aero server, the following code in go works (v7 sdk) cp := aero.NewClientPolicy() cp.User = "" cp.Password = "" cp.Timeout = 1 \* time.Second ash := aero.NewHost("127.0.0.1", 3000) client, e…

---

## [Aerospike java object mapper using configuration file approach to read CDT(json) data](https://discuss.aerospike.com/t/aerospike-java-object-mapper-using-configuration-file-approach-to-read-cdt-json-data/11177)

<div class="topic-metadata">

**Author:** [@Darshan\_Hegde](https://discuss.aerospike.com/u/Darshan_Hegde)\
**Replies:** 1\
**Last updated:** [June 10, 2024, 2:19am UTC](https://discuss.aerospike.com/t/aerospike-java-object-mapper-using-configuration-file-approach-to-read-cdt-json-data/11177 "2024-06-10T02:19:09Z")

</div>

I have below container class which holds multiple information about Car stored in aerospike bin. Example: Class Car { String id; BasicInformation information; PartInformation partInfo; CompanyInformation com…

---

## [RecordExistsAction.CREATE\_ONLY and SendKey isnt working on Java Object Mapper](https://discuss.aerospike.com/t/recordexistsaction-create-only-and-sendkey-isnt-working-on-java-object-mapper/11111)

<div class="topic-metadata">

**Author:** [@vamsi.koneru1](https://discuss.aerospike.com/u/vamsi.koneru1)\
**Replies:** 6\
**Last updated:** [May 17, 2024, 4:10pm UTC](https://discuss.aerospike.com/t/recordexistsaction-create-only-and-sendkey-isnt-working-on-java-object-mapper/11111 "2024-05-17T16:10:44Z")

</div>

Hello, We are using Java Object Mapper to save and read the records from the Database. We have Configured our write policy to make sure we store the key in DB by using writePolicy.sendKey = true; and RecordExistsActio…

---

## [Regex is not fully supported with filterExp (java com.aerospike.client.Exp library)](https://discuss.aerospike.com/t/regex-is-not-fully-supported-with-filterexp-java-com-aerospike-client-exp-library/11101)

<div class="topic-metadata">

**Author:** [@noone\_me](https://discuss.aerospike.com/u/noone_me)\
**Replies:** 1\
**Last updated:** [May 14, 2024, 4:30pm UTC](https://discuss.aerospike.com/t/regex-is-not-fully-supported-with-filterexp-java-com-aerospike-client-exp-library/11101 "2024-05-14T16:30:50Z")

</div>

I’m trying to query keys based on regex and it is returning expected results for queries like "^key1.\*" but it is not working in cases such as "^(key1|key2).\*" or "^(key1|key2).\*$". I’ve tried almost all the combinations…

---

## [How to print cachce information in logs](https://discuss.aerospike.com/t/how-to-print-cachce-information-in-logs/11032)

<div class="topic-metadata">

**Author:** [@pinaka](https://discuss.aerospike.com/u/pinaka)\
**Replies:** 1\
**Last updated:** [April 26, 2024, 12:38am UTC](https://discuss.aerospike.com/t/how-to-print-cachce-information-in-logs/11032 "2024-04-26T00:38:34Z")

</div>

I want to see what to see the cache key, namespace and schema details in the logs for every put and evict… What kind of config I need to do here. any help is appreciated.

---

## [Does queryAggregate() return Single or Multiple results or rows from ResultSet](https://discuss.aerospike.com/t/does-queryaggregate-return-single-or-multiple-results-or-rows-from-resultset/10949)

<div class="topic-metadata">

**Author:** [@griffinjm](https://discuss.aerospike.com/u/griffinjm)\
**Replies:** 6\
**Last updated:** [April 11, 2024, 2:20pm UTC](https://discuss.aerospike.com/t/does-queryaggregate-return-single-or-multiple-results-or-rows-from-resultset/10949 "2024-04-11T14:20:47Z")

</div>

Looking for help if anyone can help explain queryAggregate() behaviour in a clustered environment using an aggregation UDF. It’s not exactly clear to me what queryAggregate() returns when multiple nodes are present. The…

---

## [Query fails during migration](https://discuss.aerospike.com/t/query-fails-during-migration/10533)

<div class="topic-metadata">

**Author:** [@darktaiga01](https://discuss.aerospike.com/u/darktaiga01)\
**Replies:** 5\
**Last updated:** [December 18, 2023, 7:00pm UTC](https://discuss.aerospike.com/t/query-fails-during-migration/10533 "2023-12-18T19:00:58Z")

</div>

Hello everyone, I’m new to Aerospike, and I’m currently using the Community Edition. My setup consists of three nodes with a Replication Factor of 2. I use Java Client with Default Query Policy and JDBC to retrieve data…

---

## [Java thread blocked infinite in recordSet.next function after executing query](https://discuss.aerospike.com/t/java-thread-blocked-infinite-in-recordset-next-function-after-executing-query/10604)

<div class="topic-metadata">

**Author:** [@sandeep41](https://discuss.aerospike.com/u/sandeep41)\
**Replies:** 2\
**Last updated:** [November 7, 2023, 10:31am UTC](https://discuss.aerospike.com/t/java-thread-blocked-infinite-in-recordset-next-function-after-executing-query/10604 "2023-11-07T10:31:07Z")

</div>

In java aerospike client 6.0.0, thread blocked for infinite time in records.next() call, however we have set totalTimeout in queryPolicy to 30 seconds. This even happened we don’t have any data in the set for a particula…

---

## [Aerospike Java client Query returns only roughly half the total number of records in each set](https://discuss.aerospike.com/t/aerospike-java-client-query-returns-only-roughly-half-the-total-number-of-records-in-each-set/10477)

<div class="topic-metadata">

**Author:** [@jstumpges](https://discuss.aerospike.com/u/jstumpges)\
**Replies:** 2\
**Last updated:** [October 12, 2023, 4:15pm UTC](https://discuss.aerospike.com/t/aerospike-java-client-query-returns-only-roughly-half-the-total-number-of-records-in-each-set/10477 "2023-10-12T16:15:08Z")

</div>

Hi Aerospike community - I’m running into a perplexing issue where querying for all records in a set (i.e. no filters, etc) I am consistently getting back roughly half the total number of records in the set. The issue i…

---

## [Difference in Total batch\_sub\_read\_success and Total Operations](https://discuss.aerospike.com/t/difference-in-total-batch-sub-read-success-and-total-operations/10514)

<div class="topic-metadata">

**Author:** [@Crazy\_Football](https://discuss.aerospike.com/u/Crazy_Football)\
**Replies:** 4\
**Last updated:** [September 18, 2023, 5:18pm UTC](https://discuss.aerospike.com/t/difference-in-total-batch-sub-read-success-and-total-operations/10514 "2023-09-18T17:18:28Z")

</div>

In our application , we are doing batch reads in a batch of 90. We are observing that when we do “show latencies” in asadm mode , we are getting around 85K Qps consistently for around 30 mins. However , when we checked …

---

## [Atomic map update using java object mapper](https://discuss.aerospike.com/t/atomic-map-update-using-java-object-mapper/10371)

<div class="topic-metadata">

**Author:** [@divik](https://discuss.aerospike.com/u/divik)\
**Replies:** 4\
**Last updated:** [August 22, 2023, 4:44pm UTC](https://discuss.aerospike.com/t/atomic-map-update-using-java-object-mapper/10371 "2023-08-22T16:44:48Z")

</div>

Is it possible to do atomic update on maps stored in aerospike using java object mapper ? I am aware about the atomic updates using java client operate method, wondering if there is a way to do the same using AeroMapper. …

---

## [Recommended way to store a Map\<String, CustomObject\> as bin](https://discuss.aerospike.com/t/recommended-way-to-store-a-map-string-customobject-as-bin/10447)

<div class="topic-metadata">

**Author:** [@divik](https://discuss.aerospike.com/u/divik)\
**Replies:** 0\
**Last updated:** [August 22, 2023, 11:02am UTC](https://discuss.aerospike.com/t/recommended-way-to-store-a-map-string-customobject-as-bin/10447 "2023-08-22T11:02:47Z")

</div>

What is the recommended and performant way to store a Map\<String, CustomObject\> as bin in Aerospike? I need to perform following operations on the bin Fetch the entire map from the record (i.e., fetch the entire bin) u…

---

## [How to perform join on multiple sets](https://discuss.aerospike.com/t/how-to-perform-join-on-multiple-sets/10373)

<div class="topic-metadata">

**Author:** [@Rakesh\_Kumar](https://discuss.aerospike.com/u/Rakesh_Kumar)\
**Replies:** 1\
**Last updated:** [July 27, 2023, 11:25pm UTC](https://discuss.aerospike.com/t/how-to-perform-join-on-multiple-sets/10373 "2023-07-27T23:25:12Z")

</div>

I am trying to join the two tables based on common bins from two sets, not able to perform it, neither I am not able to write a single query to combine two separate query from sets.

---

## [Question about usage of kubernetes headless service and aerospike java client](https://discuss.aerospike.com/t/question-about-usage-of-kubernetes-headless-service-and-aerospike-java-client/10232)

<div class="topic-metadata">

**Author:** [@iandntran](https://discuss.aerospike.com/u/iandntran)\
**Replies:** 1\
**Last updated:** [May 23, 2023, 8:23pm UTC](https://discuss.aerospike.com/t/question-about-usage-of-kubernetes-headless-service-and-aerospike-java-client/10232 "2023-05-23T20:23:55Z")

</div>

Hi, I have a question regarding the client behaviour when I pass in the hostname of a kubernetes headless service. I am using java client version 5.1.11 Since the headless service should resolve to all the backing pod …

---

## [Filtering records with map bins using expressions](https://discuss.aerospike.com/t/filtering-records-with-map-bins-using-expressions/10164)

<div class="topic-metadata">

**Author:** [@Avital\_Shumonov](https://discuss.aerospike.com/u/Avital_Shumonov)\
**Replies:** 1\
**Last updated:** [April 25, 2023, 11:41pm UTC](https://discuss.aerospike.com/t/filtering-records-with-map-bins-using-expressions/10164 "2023-04-25T23:41:59Z")

</div>

Hello, I am using scanAll to filter records with a scan policy that contains a filter expression. My data looks like the following: { "PK":"somePrimaryKey", "someBinName":{ "key1":{ "fields":{ …

---

## [Puts causing memory issues](https://discuss.aerospike.com/t/puts-causing-memory-issues/9884)

<div class="topic-metadata">

**Author:** [@int64max](https://discuss.aerospike.com/u/int64max)\
**Replies:** 3\
**Last updated:** [December 8, 2022, 2:17pm UTC](https://discuss.aerospike.com/t/puts-causing-memory-issues/9884 "2022-12-08T14:17:01Z")

</div>

I have a single Aerospike client, created with the following configuration: ClientPolicy rwPolicy = new ClientPolicy(); rwPolicy.maxConnsPerNode = 300; rwPolicy.maxSocketIdle = 0; rwPolicy.minCon…

---

## [java.lang.OutOfMemoryError: Java heap space](https://discuss.aerospike.com/t/java-lang-outofmemoryerror-java-heap-space/6682)

<div class="topic-metadata">

**Author:** [@Ionut](https://discuss.aerospike.com/u/Ionut)\
**Replies:** 1\
**Last updated:** [October 11, 2022, 5:32pm UTC](https://discuss.aerospike.com/t/java-lang-outofmemoryerror-java-heap-space/6682 "2022-10-11T17:32:42Z")

</div>

Dear Sir, We have a production platform where over low traffic a session dump has been executed. We got the following exception and the customer wants to know its meaning: \[tpaadmin@AVPR-SPS-ME-oame-1 ~\]$ db-list -l se…

---

## [Vert.x aerospike client to use context-bound event loop](https://discuss.aerospike.com/t/vert-x-aerospike-client-to-use-context-bound-event-loop/9704)

<div class="topic-metadata">

**Author:** [@sleshJdev](https://discuss.aerospike.com/u/sleshJdev)\
**Replies:** 2\
**Last updated:** [August 30, 2022, 10:03am UTC](https://discuss.aerospike.com/t/vert-x-aerospike-client-to-use-context-bound-event-loop/9704 "2022-08-30T10:03:41Z")

</div>

Standard java aerospike client’s methods have overloads allowing to provide EventLoop as an argument. When running in vert.x that client is not aware of context-bounded event loop and just fallbacks to if (eventLoop == n…

---

## [CLIENT-1772 client configurations changes, reasons?](https://discuss.aerospike.com/t/client-1772-client-configurations-changes-reasons/9699)

<div class="topic-metadata">

**Author:** [@Laurent\_Perez](https://discuss.aerospike.com/u/Laurent_Perez)\
**Replies:** 1\
**Last updated:** [August 26, 2022, 8:01pm UTC](https://discuss.aerospike.com/t/client-1772-client-configurations-changes-reasons/9699 "2022-08-26T20:01:47Z")

</div>

Hello Migrating from 6.0.x I’d like to ask the rationale behind CLIENT-1772 ? Default values have been changed without explanation in the commit. I found no JIRA or Bugzilla for the key CLIENT-1772. Are the discussions…

---

## [CustomConversions implementation with AS client 5.1.11](https://discuss.aerospike.com/t/customconversions-implementation-with-as-client-5-1-11/9630)

<div class="topic-metadata">

**Author:** [@Badri](https://discuss.aerospike.com/u/Badri)\
**Replies:** 2\
**Last updated:** [August 2, 2022, 4:58am UTC](https://discuss.aerospike.com/t/customconversions-implementation-with-as-client-5-1-11/9630 "2022-08-02T04:58:04Z")

</div>

Hi, I am upgrading Aerospike client 4.1.3 → 5.1.11. 4.1.3 code snippet is : “CustomConversions conversions = new CustomConversions(Arrays.asList(StringToJava8LocalDateConverter.INSTANCE, Java8LocalDateToStringConverte…

---

## [Interaction of List operation (getByValue) and more complex data types](https://discuss.aerospike.com/t/interaction-of-list-operation-getbyvalue-and-more-complex-data-types/9518)

<div class="topic-metadata">

**Author:** [@iandntran](https://discuss.aerospike.com/u/iandntran)\
**Replies:** 1\
**Last updated:** [June 20, 2022, 8:13pm UTC](https://discuss.aerospike.com/t/interaction-of-list-operation-getbyvalue-and-more-complex-data-types/9518 "2022-06-20T20:13:15Z")

</div>

Hi, I had a question about the “get by value” list operation, and how it works with more complex types of data. For context, I have a bin that is structured similarly to: { “binA”: \[{“key1”: ”val1”, “key2”:”val2”}…

---

## [Java Client Error Message : Error -3,1,0,30000,0,2: Cluster is empty](https://discuss.aerospike.com/t/java-client-error-message-error-3-1-0-30000-0-2-cluster-is-empty/9289)

<div class="topic-metadata">

**Author:** [@paras](https://discuss.aerospike.com/u/paras)\
**Replies:** 3\
**Last updated:** [March 21, 2022, 9:33pm UTC](https://discuss.aerospike.com/t/java-client-error-message-error-3-1-0-30000-0-2-cluster-is-empty/9289 "2022-03-21T21:33:40Z")

</div>

Reading record from aerospike gives cluster is empty exception.Also the error occurs for few requests. Some records passes and give the result but few gives this exception : com.aerospike.client.AerospikeException$Invali…

---

## [Handling multiple counters in against a Key](https://discuss.aerospike.com/t/handling-multiple-counters-in-against-a-key/9177)

<div class="topic-metadata">

**Author:** [@Atul](https://discuss.aerospike.com/u/Atul)\
**Replies:** 6\
**Last updated:** [February 18, 2022, 8:37pm UTC](https://discuss.aerospike.com/t/handling-multiple-counters-in-against-a-key/9177 "2022-02-18T20:37:18Z")

</div>

Hi All, I am new to this forum. We need help for one of our use case. We are stuck with one of our use case and trying to solve it without UDF or LUA, .i.e through single client call. Application on which we are current…

---

## [Java client read throws "Error Code -2: Unexpected batch key returned: null,,0"](https://discuss.aerospike.com/t/java-client-read-throws-error-code-2-unexpected-batch-key-returned-null-0/9218)

<div class="topic-metadata">

**Author:** [@shan.p](https://discuss.aerospike.com/u/shan.p)\
**Replies:** 3\
**Last updated:** [February 16, 2022, 12:39am UTC](https://discuss.aerospike.com/t/java-client-read-throws-error-code-2-unexpected-batch-key-returned-null-0/9218 "2022-02-16T00:39:21Z")

</div>

I am seeing an Aerospike Java client read error when reading a record from Aerospike Enterprise server. Aerospike Java client: 4.0.4 (I agree this is an old version. I will upgrade to later version, but I still want to …

---

## [What is the lowest compatible Java Client version for Aerospike Enterprise server 5.7?](https://discuss.aerospike.com/t/what-is-the-lowest-compatible-java-client-version-for-aerospike-enterprise-server-5-7/9217)

<div class="topic-metadata">

**Author:** [@shan.p](https://discuss.aerospike.com/u/shan.p)\
**Replies:** 3\
**Last updated:** [February 14, 2022, 9:18pm UTC](https://discuss.aerospike.com/t/what-is-the-lowest-compatible-java-client-version-for-aerospike-enterprise-server-5-7/9217 "2022-02-14T21:18:45Z")

</div>

I am upgrading Aerospike enterprise servers from 4.5 version to 5.7 version. I am planning to upgrade the Java client version used by the application also. What is the lowest compatible client version for Aerospike Ent…

[Next page](https://discuss.aerospike.com/c/client-libraries/java-client/11.md?page=1)
