Can use Cluster instead AeronCluster?

52 Views Asked by At

hi what's the difference between below method ? can use Cluster.offer() replace AeronCluster.offer() if offer() operation is on the same JVM process ?

io.aeron.cluster.client.AeronCluster.offer()

io.aeron.cluster.service.Cluster.offer()

I am expect a help, ths

1

There are 1 best solutions below

0
On

AeronCluster.offer is designed for cluster external use from a single threaded client. Cluster.offer is for use within the cluster and only from a service running in the service container. Using either of these from another thread can result in corrupt data. Using Cluster.offer from outside a ClusteredService can additionally cause node divergence in the cluster. If you don't know what that means then simply take that it is bad.