Open shahamit opened 1 year ago
Hi @shahamit
You can configure the capacity of ring buffer at runtime. The question isn't directly related to Helm charts.
Here is an example of your use-case.
var ringBufferConfig = new RingbufferConfig();
ringBufferConfig.setName("ringbuff")
.setCapacity(9000);
hz.getConfig().addRingBufferConfig(ringBufferConfig);
var ringBuffer = hz.getRingbuffer("ringbuff");
You can get more information about ring buffer and its configuration. https://docs.hazelcast.com/hazelcast/5.3/data-structures/ringbuffer#ringbuffer-configuration-examples
We have two clients to hazelcast
- one of them is the data producer and another the data consumer. I assume who ever executes the above code first would create the ring buffer instance with a given capacity.
This would mean we would have to configure the ring buffer capacity at both ends leaving room for human errors.
Is there a way to configure the default capacity of the ring buffer when creating the hazelcast instance so that any new ring buffers created are created with that capacity? Current its 10000.
There is no way to configure default values of any configuration. You can statically configure ringbuffers with their predefined names, or you can dynamically configure ringbuffers using client at runtime.
In Hazelcast config file, you can only configure ringbuffers by their specific names. To configure via Helm charts:
# Hazelcast properties
hazelcast:
yaml:
hazelcast:
ringbuffer:
rb:
capacity: 2000
Ok I understand. So in my case since the ring buffers are created dynamically I would need to configure the capacity in both the producer and consumer code right?
Thanks
On Mon 12 Jun, 2023, 7:50 PM Semih Buyukgungor, @.***> wrote:
There is no way to configure default values of any configuration. You can statically configure ringbuffers with their predefined names, or you can dynamically configure ringbuffers using client at runtime.
— Reply to this email directly, view it on GitHub https://github.com/hazelcast/charts/issues/351#issuecomment-1587444124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJY7BRTNKJX5LWTJDXWYFTXK4QTLANCNFSM6AAAAAAZAWOK7M . You are receiving this because you were mentioned.Message ID: @.***>
You need to configure ringbuffer
only once just before it is created.
If you have a guarantee that the ringbuffer
is created in the producer side before the consumer tries to read data from it. Then you can configure it only in producer side and can use the ringbuffer
in consumer side without configuration.
So, it is totally depends on your application design.
We are deploying hazelcast cluster through helm charts. Our client code (java) creates ring buffers at runtime. The name of the ring buffer is dynamically determined.
How do I configure the capacity of the ring buffer? Is it possible to configure it at runtime? If not is there a default capacity that can be configured?
Thanks.