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
:description: Hazelcast provides a {java-client} within the standard distribution you can start using right away, and also a lightweight {java-client-new} that is available in Beta.
5
+
:description: Hazelcast provides a {java-client} within the standard distribution you can start using right away.
5
6
[[java-client]]
6
7
7
8
== Overview
8
9
9
-
Hazelcast provides a {java-client} which you can use to connect to a Hazelcast cluster. `hazelcast-<VERSION>.jar` is bundled in the Hazelcast standard package, so just add `hazelcast-<VERSION>.jar` to your classpath and you can start using this client as if you are using the Hazelcast API.
10
+
This topic is aimed at developers and describes basic usage, configuration, and advanced features.
10
11
11
-
If you are interested in using a standalone or lightweight Java client, you can try the {java-client-new}. This client is currently available as Beta functionality but can interact with a Hazelcast cluster without being a full member. Please note that the {java-client-new} doesn't have full feature parity with the {java-client} yet and is not recommended for production environments. For more info, see xref:java#java-client-standalone-beta[].
12
-
13
-
NOTE: Where there are specific differences between {java-client} and {java-client-new}, this documentation will specify the appropriate client. Otherwise you can assume that generic references to client refer to both versions of the Java client.
14
-
15
-
// check production recommendation
16
-
17
-
Both clients enable you to use the Hazelcast API, with this page explaining any differences or technical details that affect usage. This page should be read alongside the respective Javadoc-generated API documentation available from within your IDE and the following links:
18
-
19
-
* https://docs.hazelcast.org/hazelcast-ee-docs/{ee-version}/javadoc[Hazelcast {java-client} {enterprise-product-name} API documentation]
20
-
* https://docs.hazelcast.org/docs/{os-version}/javadoc[Hazelcast {java-client} {open-source-product-name} API documentation]
21
-
* https://docs.hazelcast.org/hazelcast-java-client/{page-latest-supported-java-client-new}/javadoc[Hazelcast {java-client-new} API documentation]
12
+
Hazelcast provides a {java-client} which you can use to connect to a Hazelcast cluster. `hazelcast-<VERSION>.jar` is bundled in the Hazelcast standard package, so you simply add this file to your classpath to begin using the client as if you are using the Hazelcast API.
To get started using the {java-client}, you need to include the `hazelcast.jar` dependency in your classpath. You can then start using this client as if
31
-
you are using the Hazelcast API.
16
+
To get started using the {java-client}, you need to include the `hazelcast.jar` dependency in your classpath. You can then start using this client as if you are using the Hazelcast API.
32
17
33
18
NOTE: If you have a Hazelcast {enterprise-product-name} license, you don't need to set the license key in your Hazelcast Java clients to use the xref:getting-started:editions.adoc#features-in-hazelcast-enterprise[{enterprise-product-name} features]. You only have to set it on the member side, and include the `hazelcast-enterprise-<VERSION>.jar` dependency in your classpath.
34
19
@@ -72,57 +57,6 @@ You can find {java-client} code samples in the https://github.com/hazelcast/haze
72
57
73
58
TIP: For a tutorial on getting started with Java in an embedded topology, see xref:getting-started:get-started-java.adoc[].
74
59
75
-
=== Get started with {java-client-new} (BETA)
76
-
77
-
To get started using the {java-client-new}, you need to add the `hazelcast-java-client` dependency to your pom.xml, as shown below. You can then start using this client as if
If you are using `hazelcast-enterprise-java-client`, you need to add the `hazelcast-enterprise-java-client` dependency and private hazelcast repository to your pom.xml file, as shown below:
To migrate an application from the {java-client} to the {java-client-new}, you only have to update the dependency as described above.
114
-
115
-
[java-client-standalone]
116
-
==== {java-client-new} (BETA)
117
-
118
-
The {java-client-new} is only available as a BETA release and does not have full feature parity with the {java-client}. Please note the following differences and restrictions:
119
-
120
-
* Hazelcast Cloud is not supported
121
-
* You cannot use the {java-client} and the {java-client-new} on the same JVM
122
-
* Any methods that raise the`UnsupportedOperationException` exception are not available e.g. `addLocalEntryListener(@Nonnull MapListener listener)`
123
-
* MultiMap and Set are not supported data structures
124
-
* Some client system properties are not supported (see individual notes)
125
-
126
60
=== Client API
127
61
The Client API is your gateway to access your Hazelcast cluster, including distributed objects and data pipelines (jobs).
For further information on client configuration, see <<configure-java-client, Configure the client>>.
142
75
For further information on client configuration, see <<configure-java-client, Configure the client>>.
143
76
144
-
After completing the client configuration, you must create an `HazelcastClient` instance that will initialize and connect to the client based on the specified configuration:
145
77
After completing the client configuration, you must create an `HazelcastClient` instance that will initialize and connect to the client based on the specified configuration:
You can create a distributed map and populate it with some data as follows:
153
83
You can create a distributed map and populate it with some data as follows:
154
84
155
85
[source,java]
@@ -175,7 +105,7 @@ This command releases all used resources and closes all connections to the clust
175
105
176
106
=== Supported data structures
177
107
178
-
Hazelcast offers distributed implementations of many common data structures, most of which are supported by the {java-client} and {java-client-new}.
108
+
Hazelcast offers distributed implementations of many common data structures, most of which are supported by the {java-client}.
179
109
180
110
When you use clients in other languages, you should review the appropriate client documentation for exceptions and details. As a general rule, you should configure these data structures on the server side and
181
111
access them through a proxy on the client side.
@@ -197,8 +127,6 @@ The `addLocalEntryListener()` and `localKeySet()` methods are not supported beca
197
127
198
128
=== Use MultiMap
199
129
200
-
NOTE: This section is only applicable to the {java-client}.
201
-
202
130
You can use a distributed multiMap object with the {java-client}, as follows:
203
131
204
132
[source,java]
@@ -238,7 +166,7 @@ The logic is the same for both member and client side, so see the specific secti
For more information, see the appropriate API documentation for your client:
511
-
512
-
* https://docs.hazelcast.org/docs/{os-version}/javadoc/com/hazelcast/client/config/ClientSecurityConfig.html[{java-client-new} ClientSecurityConfig API documentation]
513
-
* https://docs.hazelcast.org/hazelcast-java-client/{page-latest-supported-java-client-new}/javadoc/com/hazelcast/client/config/ClientSecurityConfig.html[{java-client} ClientSecurityConfig API documentation]
438
+
For more information, see https://docs.hazelcast.org/docs/{os-version}/javadoc/com/hazelcast/client/config/ClientSecurityConfig.html[ClientSecurityConfig API documentation].
514
439
515
440
[[classloader]]
516
441
=== Configure ClassLoader
@@ -1116,6 +1041,8 @@ When an operation with sync backup is sent by a client to the Hazelcast member(s
1116
1041
the acknowledgment of the operation's backup is sent to the client by the backup
1117
1042
replica member(s). This improves the performance of the client operations.
1118
1043
1044
+
NOTE: Backup acknowledgement is sometimes referred to as _boomerang backups_.
1045
+
1119
1046
If using the `ALL_MEMBERS` cluster routing mode, backup acknowledgement to the client is enabled by default.
1120
1047
However, neither the `MULTI_MEMBER` nor the `SINGLE_MEMBER` cluster routing modes support backup acknowledgement to the client.
1121
1048
@@ -1661,8 +1588,6 @@ For a programmatic example, see this xref:java#programmatic-configuration-5[code
1661
1588
1662
1589
=== Configure Hazelcast {hazelcast-cloud}
1663
1590
1664
-
NOTE: This section is only applicable to the {java-client}.
1665
-
1666
1591
You can connect the {java-client} to a {hazelcast-cloud} Standard cluster which is hosted on link:{url-cloud-signup}[{hazelcast-cloud}].
1667
1592
For this, you need to enable {hazelcast-cloud} and specify the cluster's discovery token provided while creating the cluster; this allows the cluster to discover your clients.
1668
1593
See the following example configurations:
@@ -1988,8 +1913,6 @@ NOTE: You need to restart clients after modifying system properties.
1988
1913
|long
1989
1914
|Token to use when discovering the cluster via {hazelcast-cloud}.
1990
1915
1991
-
NOTE: Not supported by {java-client-new}.
1992
-
1993
1916
|`hazelcast.client.concurrent.window.ms`
1994
1917
|100
1995
1918
|int
@@ -2001,8 +1924,6 @@ Setting it too high effectively disables the optimization because once concurren
2001
1924
it will keep that way. Setting it too low could lead to suboptimal performance because the system
2002
1925
will try to use write-through and other optimizations even though the system is concurrent.
2003
1926
2004
-
NOTE: Not supported by {java-client-new}.
2005
-
2006
1927
|`hazelcast.discovery.enabled`
2007
1928
|false
2008
1929
|bool
@@ -2168,8 +2089,6 @@ increased performance and reduced memory usage.
2168
2089
to the same member when this property is `true`. When it is set to `false`,
2169
2090
the client tries to connect to the members in the given order.
0 commit comments