You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java SDK throws error when I try to put 1.2 Mb String value into KV store
Expected behavior
I can put values larger than 1 Mb to KV
Server and client version
Nats is deployed using the latest Docker-compose(Logs: Starting nats-server Version: 2.10.12).
Also, the issue reproduces in Kubernetes cluster. For that, I use the latest helm chart with enabled “jetstream” option.
Nats CLI: v. 0.1.4
I created KV bucket using Nats CLI command nats kv add --max-value-size=9999999999 --storage=file exampleBucket
(I tried with “--storage=memory” option and got the same result)
Output:
Configuration:
Bucket Name: exampleBucket
History Kept: 1
Values Stored: 0
Compressed: false
Backing Store Kind: JetStream
Bucket Size: 0 B
Maximum Bucket Size: unlimited
Maximum Value Size: 1.3 GiB
Maximum Age: unlimited
JetStream Stream: KV_exampleBucket
Storage: File
java.lang.IllegalArgumentException: Message payload size exceed server configuration 1211480 vs 1048576
at io.nats.client.impl.NatsConnection.checkPayloadSize(NatsConnection.java:906)
at io.nats.client.impl.NatsConnection.requestFutureInternal(NatsConnection.java:1182)
at io.nats.client.impl.NatsConnection.requestInternal(NatsConnection.java:1123)
at io.nats.client.impl.NatsJetStreamImpl.makeInternalRequestResponseRequired(NatsJetStreamImpl.java:241)
at io.nats.client.impl.NatsJetStream.publishSyncInternal(NatsJetStream.java:155)
at io.nats.client.impl.NatsJetStream.publish(NatsJetStream.java:83)
at io.nats.client.impl.NatsKeyValue._write(NatsKeyValue.java:237)
at io.nats.client.impl.NatsKeyValue.put(NatsKeyValue.java:141)
at com.nats.kv.app.NatsKeyValueFull.main(NatsKeyValueFull.java:95)
I also tried GO SDK to put the same 1.2 MB String object to KV and this attempt was unsuccessful too.
The large object(large_text.txt) that I use is attached. large_text.txt
P.S.
Java SDK create bucket operation with parameters:
io.nats.client.JetStreamApiException: invalid JSON [10025]
at io.nats.client.api.ApiResponse.throwOnHasError(ApiResponse.java:82)
at io.nats.client.impl.NatsJetStreamImpl.createAndCacheStreamInfoThrowOnError(NatsJetStreamImpl.java:154)
at io.nats.client.impl.NatsJetStreamManagement.addOrUpdateStream(NatsJetStreamManagement.java:68)
at io.nats.client.impl.NatsJetStreamManagement.addStream(NatsJetStreamManagement.java:48)
at io.nats.client.impl.NatsKeyValueManagement.create(NatsKeyValueManagement.java:51)
at com.nats.kv.app.NatsKeyValueFull.main(NatsKeyValueFull.java:68)
The text was updated successfully, but these errors were encountered:
Observed behavior
Java SDK throws error when I try to put 1.2 Mb String value into KV store
Expected behavior
I can put values larger than 1 Mb to KV
Server and client version
Nats is deployed using the latest Docker-compose(Logs: Starting nats-server Version: 2.10.12).
Also, the issue reproduces in Kubernetes cluster. For that, I use the latest helm chart with enabled “jetstream” option.
Nats CLI: v. 0.1.4
Java SDK:
implementation group: 'io.nats', name: 'jnats', version: '2.17.5'
implementation group: 'io.nats', name: 'java-nats-streaming', version: '2.2.3'
Host environment
No response
Steps to reproduce
I created KV bucket using Nats CLI command
nats kv add --max-value-size=9999999999 --storage=file exampleBucket
(I tried with “--storage=memory” option and got the same result)
Output:
Extra bucket details from Java application:
Output:
Code example to put obj:
Error that I got:
I also tried GO SDK to put the same 1.2 MB String object to KV and this attempt was unsuccessful too.
The large object(
large_text.txt
) that I use is attached.large_text.txt
P.S.
Java SDK create bucket operation with parameters:
Fails with error:
The text was updated successfully, but these errors were encountered: