New Feature of Interference Cluster Release in Version 2021.1
The 2021.1 version of the interference cluster has been released. In this article, I will discuss the changes and their impacts in this newest version.
Join the DZone community and get the full member experience.Join For Free
The 2021.1 version of the interference cluster has been released. (The previous article, in which I talk about the basic features of this software, can be found here.). Much attention was paid to improving overall performance and stability. In my opinion, an interesting feature has appeared, which I want to talk about in this short article.
Previously, the concept of the interference cluster was kept strictly within the framework of a server-side service that provided persistence and event interaction services to some server-side java applications. Since the concept of the interference as a database did not provide for JDBC connections, we could not access the data from the outside in any way. Any interactions were possible only between applications of the cluster nodes, each of which contains persistent storage.
Now, with the 2021.1 release, you can use a remote client to access interference cluster data from another JVM. To do this, just add the interference-2021.1 library to your project and create a connection to any of the cluster nodes using the
Session.getRemoteSession() method. The remote client uses the same transport mechanism that is used for inter-node communication within the cluster:
How It Works
To create a remote session, you need to specify the host parameters for connecting to the remote cluster node, as well as the parameters of your current host for callbacks from the transport service. The client port on your client connection can be any of the available (unused by other applications):
This method creates a Session object inside the remote cluster and returns its identifier as a local RemoteSession object. The remote application can perform further actions through calls to methods of the RemoteSession object using standard JPA-like methods (
execute()...,) inherent in the interference Session class.
Earlier it was said that for any operations with an entity class object, this class must be registered within the interference service.
To register your @Entity class, we must first perform the following action:
Where class may seem like:
The class must be registered with the cluster only once. If the class has already been registered before, an exception (
class already registered) will be thrown.
Insert or change some object in the table:
Search for an object by an identifier:
Execute an SQL query and an instance of the RemoteResultSet object will be returned:
Poll all objects from a result set:
Opinions expressed by DZone contributors are their own.