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
@@ -184,7 +184,35 @@ This chapter provides information on how to get started with your Hazelcast C++
184
184
185
185
## 1.1. Installing
186
186
187
-
### 1.1.1. Conan Users
187
+
### 1.1.1. Vcpkg Users (Recommended)
188
+
Hazelcast C++ client package is available for [Vcpkg](https://github.com/microsoft/vcpkg) users. The package name is `hazelcast-cpp-client`.
189
+
190
+
Please see [getting started](https://github.com/microsoft/vcpkg#getting-started) on how to use Vcpkg package manager with your application. In summary,
The above code snippet will install `hazelcast-cpp-client` with its `boost` and `openssl` dependencies.
208
+
209
+
After the installation, the library is available for usage. For example, if you are using CMake for your builds, you can use the following cmake build command with the `CMAKE_TOOLCHAIN_FILE` cmake option to be the `vcpkg.cmake`.
210
+
```bat
211
+
cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
212
+
cmake --build [build directory]
213
+
```
214
+
215
+
### 1.2.1. Conan Users
188
216
Hazelcast C++ client package is indexed at [Conan Center Index](https://conan.io/center/hazelcast-cpp-client). You can use [Conan package manager](https://conan.io/) to install Hazelcast C++ client. The package name is `hazelcast-cpp-client`.
189
217
190
218
Please see [example instructions](https://docs.conan.io/en/latest/getting_started.html#an-md5-hash-calculator-using-the-poco-libraries) on how to use conan package manager with your application. In summary,
@@ -204,32 +232,6 @@ $ conan install ..
204
232
```
205
233
This generates the `conanbuildinfo.cmake` file to be included in your CMakeLists.txt. Please follow the instructions at the [example page](https://docs.conan.io/en/latest/getting_started.html#an-md5-hash-calculator-using-the-poco-libraries) and build your application.
206
234
207
-
### 1.1.2. Vcpkg Users
208
-
Hazelcast C++ client package is available for [Vcpkg](https://github.com/microsoft/vcpkg) users. The port name is `hazelcast-cpp-client`.
209
-
210
-
Please see [Getting Started](https://github.com/microsoft/vcpkg#getting-started) on how to use Vcpkg package manager with your application. In summary,
211
-
212
-
```bat
213
-
> git clone https://github.com/microsoft/vcpkg
214
-
> .\vcpkg\bootstrap-vcpkg.bat
215
-
> .\vcpkg\vcpkg install hazelcast-cpp-client
216
-
```
217
-
The above code snippet will install `hazelcast-cpp-client` with its `boost` dependencies.
218
-
219
-
After the installation, the library is available for usage. For example, if you are using CMake for your builds, you can use the following cmake build command with the `CMAKE_TOOLCHAIN_FILE` cmake option to be the `vcpkg.cmake`.
220
-
```bat
221
-
> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
222
-
> cmake --build [build directory]
223
-
```
224
-
225
-
You can find more details on using a Vcpkg installed package from different IDEs in your projects from the [Vcpkg Official Getting Started](https://github.com/microsoft/vcpkg#getting-started) documentation.
226
-
227
-
If you need to use `openssl` feature, then you need to install using the following command:
If your enviroment could not find openssl library, you could define it like below (As an example: `-L/opt/homebrew/Cellar/[email protected]/1.1.1t/lib`)
If a custom installation directory was used during installation, then you may also need to use the `-L` and `-I` options to add the library and include paths to the compiler's search path.
@@ -710,8 +726,8 @@ auto personnel = hz.get_map("personnel_map").get();
710
726
for (const auto &entry : personnel.entry_set().get()) {
711
727
std::cout << entry.first << " is in " << entry.second << " department." << std::endl;
712
728
}
713
-
714
-
return 0;
729
+
hz.shutdown().get();
730
+
return 0;
715
731
}
716
732
```
717
733
@@ -1253,7 +1269,7 @@ The following are configuration element descriptions:
1253
1269
*`initial_backoff_duration`: Specifies how long to wait (backoff) after the first failure before retrying.
1254
1270
*`max_backoff_duration`: Specifies the upper limit for the backoff between each cluster connect tries.
1255
1271
*`multiplier`: Factor to multiply the backoff after a failed retry.
1256
-
*`cluster_connect)timeout`: Timeout value for the client to give up to connect to the current cluster. If the client can not connect during this time, then it shuts down and it can not be re-used.
1272
+
*`cluster_connect_timeout`: Timeout value for the client to give up to connect to the current cluster. If the client can not connect during this time, then it shuts down and it can not be re-used.
1257
1273
*`jitter`: Specifies by how much to randomize backoffs.
1258
1274
1259
1275
## 5.6. Enabling Client TLS/SSL
@@ -1265,7 +1281,7 @@ As explained in the [TLS/SSL section](#61-tlsssl), Hazelcast members have key st
1265
1281
1266
1282
## 5.7. Enabling Hazelcast AWS Discovery
1267
1283
1268
-
The C++ client can discover the existing Hazelcast servers in the Amazon AWS environment. The client queries the Amazon AWS environment using the [describe-instances](http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) query of AWS. The client finds only the up and running instances and filters them based on the filter config provided at the `client_aws_config` configuration.
1284
+
The C++ client can discover the existing Hazelcast servers in the Amazon AWS environment. The client queries the Amazon AWS environment using the [describe-instances](http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) query of AWS. The client finds only the up and running instances and filters them based on the filter config provided at the `client_aws_config` configuration.
1269
1285
1270
1286
The following is an example configuration:
1271
1287
@@ -1287,7 +1303,7 @@ and [the AWS examples directory](https://github.com/hazelcast/hazelcast-cpp-clie
1287
1303
for more details.
1288
1304
1289
1305
## 5.8. Enabling Hazelcast Cloud Discovery
1290
-
If you are using [Hazelcast Cloud Service](https://cloud.hazelcast.com) and you want to write an application that will utilize the Hazelcast cloud database service, you can use the C++ client. The configuration is very simple, you just need to set the cluster name, discovery token and enable the cloud discovery on network settings. Here is an example configuration:
1306
+
If you are using [Hazelcast Viridian](https://viridian.hazelcast.com/) and you want to write an application that will utilize the Hazelcast cloud database service, you can use the C++ client. The configuration is very simple, you just need to set the cluster name, discovery token and enable the cloud discovery on network settings. Here is an example configuration:
1291
1307
1292
1308
```c++
1293
1309
hazelcast::client::client_config config;
@@ -1544,7 +1560,7 @@ If you want to enable the validation of server certificate on the client side an
1544
1560
auto hz = hazelcast::new_client(std::move(config)).get();
1545
1561
```
1546
1562
1547
-
The client will connect if the server has a certificate which is properly signed by well known Certificate Authorities(CA). On Windows, you may need to set the well known CA Authorities file path since OpenSSL may not find the well known certifite authorities file. This can be solved by providing the [SSL_CERT_FILE](https://www.openssl.org/docs/man1.1.0/man3/SSL_CTX_set_default_verify_paths.html) environment variable set to point a file path that has all the needed well known certificate authorities. For example, you can get such a file maintained by Mozilla at https://curl.se/docs/caextract.html.
1563
+
The client will connect if the server has a certificate which is properly signed by well known Certificate Authorities(CA). On Windows, you may need to set the well known CA Authorities file path since OpenSSL may not find the well known certifite authorities file. This can be solved by providing the [SSL_CERT_FILE](https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_default_verify_paths.html) environment variable set to point a file path that has all the needed well known certificate authorities. For example, you can get such a file maintained by Mozilla at https://curl.se/docs/caextract.html.
1548
1564
1549
1565
If the server is using a user generated certificate file which is not signed by the well known CA authorities, then you can use the public certificate of the server to configure the client to connect and verify the server. Here is an example configuration for this:
1550
1566
@@ -1593,7 +1609,6 @@ In some cases, you may want to limit the cipher suites allowed for a client whil
1593
1609
```c++
1594
1610
config.get_network_config().get_ssl_config().
1595
1611
set_cipher_list("HIGH"); // optional setting (values for string are described at
1596
-
// https://www.openssl.org/docs/man1.0.2/apps/ciphers.html and
@@ -3482,6 +3506,7 @@ for (auto itr = result->iterator(); itr.has_next();)
3482
3506
<< '\n';
3483
3507
}
3484
3508
}
3509
+
hz.shutdown().get();
3485
3510
```
3486
3511
3487
3512
**Note-1**: First call to `sql_result::page_iterator::next()` function will return `ready` future because first page is already loaded as a result of the sql_service::execute call.
@@ -3525,6 +3550,7 @@ auto itr = result->iterator();
3525
3550
auto page = itr.next().get();
3526
3551
3527
3552
std::cout << page.row_count() << std::endl; // This may print zero if no data is yet generated at the server side.
3553
+
hz.shutdown().get();
3528
3554
```
3529
3555
**Note-5**: `boost::future<std::shared_ptr<sql_result>>` is returned from `sql_service::execute` and `boost::future<std::shared_ptr<sql_page>>` is returned from `sql_result::page_iterator::next()`.
0 commit comments