infinispan 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +1 -1
  2. package/lib/protostream/query.proto +1 -1
  3. package/package.json +9 -9
  4. package/.eslintrc +0 -25
  5. package/.flowconfig +0 -6
  6. package/Jenkinsfile +0 -50
  7. package/Jenkinsfile-release +0 -63
  8. package/documentation/asciidoc/stories/assembly_client_usage_examples.adoc +0 -10
  9. package/documentation/asciidoc/stories/assembly_installation_configuration.adoc +0 -20
  10. package/documentation/asciidoc/titles/js_client.asciidoc +0 -28
  11. package/documentation/asciidoc/titles/stories.adoc +0 -5
  12. package/documentation/asciidoc/topics/attributes/community-attributes.adoc +0 -9
  13. package/documentation/asciidoc/topics/attributes/downstream-attributes.adoc +0 -2
  14. package/documentation/asciidoc/topics/code_examples/authentication-digest.js +0 -12
  15. package/documentation/asciidoc/topics/code_examples/authentication-external.js +0 -15
  16. package/documentation/asciidoc/topics/code_examples/authentication-oauthbearer.js +0 -10
  17. package/documentation/asciidoc/topics/code_examples/authentication-plain.js +0 -11
  18. package/documentation/asciidoc/topics/code_examples/authentication-scram.js +0 -11
  19. package/documentation/asciidoc/topics/code_examples/await-multiple-entries.js +0 -36
  20. package/documentation/asciidoc/topics/code_examples/await-single-entries.js +0 -29
  21. package/documentation/asciidoc/topics/code_examples/conditional-operations.js +0 -57
  22. package/documentation/asciidoc/topics/code_examples/connection-multiple-servers.js +0 -23
  23. package/documentation/asciidoc/topics/code_examples/connection-xsite-cluster-switch.js +0 -39
  24. package/documentation/asciidoc/topics/code_examples/connection-xsite.js +0 -13
  25. package/documentation/asciidoc/topics/code_examples/data-types.js +0 -30
  26. package/documentation/asciidoc/topics/code_examples/encryption-crypto-store.js +0 -11
  27. package/documentation/asciidoc/topics/code_examples/encryption-private-key.js +0 -13
  28. package/documentation/asciidoc/topics/code_examples/encryption-sni-hostname.js +0 -9
  29. package/documentation/asciidoc/topics/code_examples/encryption-trust-certs.js +0 -8
  30. package/documentation/asciidoc/topics/code_examples/ephemeral-data.js +0 -52
  31. package/documentation/asciidoc/topics/code_examples/hello-world.js +0 -42
  32. package/documentation/asciidoc/topics/code_examples/key-value-converter.js +0 -67
  33. package/documentation/asciidoc/topics/code_examples/logging-configuration.js +0 -2
  34. package/documentation/asciidoc/topics/code_examples/multiple-entries.js +0 -64
  35. package/documentation/asciidoc/topics/code_examples/queries.js +0 -92
  36. package/documentation/asciidoc/topics/code_examples/register-event-listener.js +0 -64
  37. package/documentation/asciidoc/topics/code_examples/sample-script-execute.js +0 -33
  38. package/documentation/asciidoc/topics/code_examples/sample-script.js +0 -3
  39. package/documentation/asciidoc/topics/code_examples/single-entries.js +0 -49
  40. package/documentation/asciidoc/topics/config_examples/logging.json +0 -14
  41. package/documentation/asciidoc/topics/proc_configuring_authentication.adoc +0 -16
  42. package/documentation/asciidoc/topics/proc_configuring_connections.adoc +0 -25
  43. package/documentation/asciidoc/topics/proc_configuring_connections_xsite.adoc +0 -18
  44. package/documentation/asciidoc/topics/proc_configuring_data_formats.adoc +0 -30
  45. package/documentation/asciidoc/topics/proc_configuring_encryption.adoc +0 -15
  46. package/documentation/asciidoc/topics/proc_configuring_logging.adoc +0 -28
  47. package/documentation/asciidoc/topics/proc_installing_clients.adoc +0 -58
  48. package/documentation/asciidoc/topics/proc_switching_clusters.adoc +0 -17
  49. package/documentation/asciidoc/topics/ref_authentication_mechanisms.adoc +0 -68
  50. package/documentation/asciidoc/topics/ref_client_usage.adoc +0 -128
  51. package/documentation/asciidoc/topics/ref_encryption.adoc +0 -71
  52. package/gen-jsdoc.sh +0 -6
  53. package/make-ssl.sh +0 -335
  54. package/memory-profiling/helper.js +0 -9
  55. package/memory-profiling/infinispan_memory_many_get.js +0 -50
  56. package/memory-profiling/infinispan_memory_one_get.js +0 -56
  57. package/release.sh +0 -19
  58. package/run-servers.sh +0 -156
  59. package/run-testsuite.sh +0 -6
  60. package/server/.keep +0 -0
  61. package/set-npm-auth-token.sh +0 -4
  62. package/smoke-tests.sh +0 -21
  63. package/spec/codec_spec.js +0 -224
  64. package/spec/configs/clean/infinispan.xml +0 -55
  65. package/spec/configs/infinispan-clustered.xml +0 -63
  66. package/spec/configs/infinispan-ssl.xml +0 -115
  67. package/spec/configs/infinispan-xsite-EARTH.xml +0 -191
  68. package/spec/configs/infinispan-xsite-MOON.xml +0 -193
  69. package/spec/configs/infinispan.xml +0 -77
  70. package/spec/functional_spec.js +0 -73
  71. package/spec/infinispan_auth_spec.js +0 -19
  72. package/spec/infinispan_cluster_spec.js +0 -176
  73. package/spec/infinispan_expiry_spec.js +0 -218
  74. package/spec/infinispan_failover_listener_spec.js +0 -52
  75. package/spec/infinispan_failover_spec.js +0 -63
  76. package/spec/infinispan_json_spec.js +0 -182
  77. package/spec/infinispan_local_spec.js +0 -354
  78. package/spec/infinispan_ssl_spec.js +0 -441
  79. package/spec/infinispan_stress_spec.js +0 -32
  80. package/spec/infinispan_xsite_spec.js +0 -99
  81. package/spec/protocols_spec.js +0 -82
  82. package/spec/protostream_spec.js +0 -237
  83. package/spec/tests.js +0 -28
  84. package/spec/utils/test-log4js.json +0 -14
  85. package/spec/utils/testing.js +0 -790
  86. package/spec/utils/typed-cachemanager-put-get.js +0 -3
  87. package/spec/utils/typed-null-return-dist.js +0 -2
  88. package/spec/utils/typed-null-return.js +0 -2
  89. package/spec/utils/typed-put-get-dist.js +0 -3
  90. package/spec/utils/typed-put-get-unicode.js +0 -3
  91. package/spec/utils/typed-put-get.js +0 -3
  92. package/spec/utils/typed-size.js +0 -2
  93. package/spec/utils_spec.js +0 -154
  94. package/spec-manual/infinispan_manual_stress_get_spec.js +0 -50
  95. package/spec-manual/infinispan_manual_stress_iterate_spec.js +0 -86
@@ -1,52 +0,0 @@
1
- var infinispan = require('infinispan');
2
-
3
- var connected = infinispan.client(
4
- {port: 11222, host: '127.0.0.1'}
5
- {
6
- // Configure client connections with authentication and encryption here.
7
- }
8
- );
9
-
10
- connected.then(function (client) {
11
-
12
- var clientPutExpiry = client.put('expiry', 'value', {lifespan: '1s'});
13
-
14
- var clientGetMetaAndSize = clientPutExpiry.then(
15
- function() {
16
- // Compute getWithMetadata and size in parallel.
17
- return Promise.all([client.getWithMetadata('expiry'), client.size()]);
18
- });
19
-
20
- var showGetMetaAndSize = clientGetMetaAndSize.then(
21
- function(values) {
22
- console.log('Before expiration:');
23
- console.log('getWithMetadata(expiry)=' + JSON.stringify(values[0]));
24
- console.log('size=' + values[1]);
25
- });
26
-
27
- var clientContainsAndSize = showGetMetaAndSize.then(
28
- function() {
29
- sleepFor(1100); // Sleep to force expiration.
30
- return Promise.all([client.containsKey('expiry'), client.size()]);
31
- });
32
-
33
- var showContainsAndSize = clientContainsAndSize.then(
34
- function(values) {
35
- console.log('After expiration:');
36
- console.log('containsKey(expiry)=' + values[0]);
37
- console.log('size=' + values[1]);
38
- });
39
-
40
- return showContainsAndSize.finally(
41
- function() { return client.disconnect(); });
42
-
43
- }).catch(function(error) {
44
-
45
- console.log("Got error: " + error.message);
46
-
47
- });
48
-
49
- function sleepFor(sleepDuration){
50
- var now = new Date().getTime();
51
- while(new Date().getTime() < now + sleepDuration){ /* Do nothing. */ }
52
- }
@@ -1,42 +0,0 @@
1
- var infinispan = require('infinispan');
2
-
3
- // Connect to {brandname} Server.
4
- // Use an existing cache named "myCache".
5
- var connected = infinispan.client(
6
- {port: 11222, host: '127.0.0.1'},
7
- {
8
- cacheName: 'myCache',
9
- clientIntelligence: 'BASIC',
10
- authentication: {
11
- enabled: true,
12
- saslMechanism: 'DIGEST-MD5',
13
- userName: 'username',
14
- password: 'changeme'
15
- }
16
- }
17
- );
18
-
19
- connected.then(function (client) {
20
-
21
- console.log('Connected to `myCache`');
22
-
23
- // Add an entry to the cache.
24
- var clientPut = client.put('hello', 'world');
25
-
26
- // Retrieve the entry you added.
27
- var clientGet = clientPut.then(
28
- function() { return client.get('hello'); });
29
-
30
- // Print the value of the entry.
31
- var showGet = clientGet.then(
32
- function(value) { console.log('get(hello)=' + value); });
33
-
34
- // Disconnect from {brandname} Server.
35
- return client.disconnect();
36
-
37
- }).catch(function(error) {
38
-
39
- // Log any errors.
40
- console.log("Got error: " + error.message);
41
-
42
- });
@@ -1,67 +0,0 @@
1
- var infinispan = require('infinispan');
2
-
3
- var connected = infinispan.client(
4
- {port: 11222, host: '127.0.0.1'}
5
- , {
6
- dataFormat : {
7
- keyType: 'application/json',
8
- valueType: 'application/json'
9
- }
10
- }
11
- );
12
-
13
- connected.then(function (client) {
14
- // Include the remote event converter to avoid unnecessary roundtrips.
15
- var opts = {
16
- converterFactory : {
17
- name: "key-value-with-previous-converter-factory"
18
- }
19
- };
20
-
21
- var clientAddListenerCreate = client.addListener('create', logEvent("Created"), opts);
22
-
23
- var clientAddListeners = clientAddListenerCreate.then(
24
- function(listenerId) {
25
- // Associate multiple callbacks with a single client-side listener.
26
- // To do this, register listeners with the same listener ID.
27
- var clientAddListenerModify =
28
- client.addListener('modify', logEvent("Modified"), {opts, listenerId: listenerId});
29
-
30
- var clientAddListenerRemove =
31
- client.addListener('remove', logEvent("Removed"), {opts, listenerId: listenerId});
32
-
33
- return Promise.all([clientAddListenerModify, clientAddListenerRemove]);
34
- });
35
-
36
- var clientCreate = clientAddListeners.then(
37
- function() { return client.putIfAbsent('converted', 'v0'); });
38
-
39
- var clientModify = clientCreate.then(
40
- function() { return client.replace('converted', 'v1'); });
41
-
42
- var clientRemove = clientModify.then(
43
- function() { return client.remove('converted'); });
44
-
45
- var clientRemoveListener =
46
- Promise.all([clientAddListenerCreate, clientRemove]).then(
47
- function(values) {
48
- var listenerId = values[0];
49
- return client.removeListener(listenerId);
50
- });
51
-
52
- return clientRemoveListener.finally(
53
- function() { return client.disconnect(); });
54
-
55
- }).catch(function(error) {
56
-
57
- console.log("Got error: " + error.message);
58
-
59
- });
60
-
61
- function logEvent(prefix) {
62
- return function(event) {
63
- console.log(prefix + " key: " + event.key);
64
- console.log(prefix + " value: " + event.value);
65
- console.log(prefix + " previous value: " + event.prev);
66
- }
67
- }
@@ -1,2 +0,0 @@
1
- var log4js = require('log4js');
2
- log4js.configure('path/to/my-log4js.json');
@@ -1,64 +0,0 @@
1
- var infinispan = require('infinispan');
2
-
3
- var connected = infinispan.client(
4
- {port: 11222, host: '127.0.0.1'},
5
- {
6
- cacheName: 'myCache',
7
- authentication: {
8
- enabled: true,
9
- saslMechanism: 'DIGEST-MD5',
10
- userName: 'username',
11
- password: 'changeme'
12
- }
13
- }
14
- );
15
-
16
- connected.then(function (client) {
17
- var data = [
18
- {key: 'multi1', value: 'v1'},
19
- {key: 'multi2', value: 'v2'},
20
- {key: 'multi3', value: 'v3'}];
21
-
22
- var clientPutAll = client.putAll(data);
23
-
24
- var clientGetAll = clientPutAll.then(
25
- function() { return client.getAll(['multi2', 'multi3']); });
26
-
27
- var showGetAll = clientGetAll.then(
28
- function(entries) {
29
- console.log('getAll(multi2, multi3)=%s', JSON.stringify(entries));
30
- }
31
- );
32
-
33
- var clientIterator = showGetAll.then(
34
- function() { return client.iterator(1); });
35
-
36
- var showIterated = clientIterator.then(
37
- function(it) {
38
- function loop(promise, fn) {
39
- // Simple recursive loop over the iterator's next() call.
40
- return promise.then(fn).then(function (entry) {
41
- return entry.done
42
- ? it.close().then(function () { return entry.value; })
43
- : loop(it.next(), fn);
44
- });
45
- }
46
-
47
- return loop(it.next(), function (entry) {
48
- console.log('iterator.next()=' + JSON.stringify(entry));
49
- return entry;
50
- });
51
- }
52
- );
53
-
54
- var clientClear = showIterated.then(
55
- function() { return client.clear(); });
56
-
57
- return clientClear.finally(
58
- function() { return client.disconnect(); });
59
-
60
- }).catch(function(error) {
61
-
62
- console.log("Got error: " + error.message);
63
-
64
- });
@@ -1,92 +0,0 @@
1
- const infinispan = require('infinispan');
2
- const protobuf = require('protobufjs');
3
- // This example uses async/await paradigma
4
- (async function () {
5
- // User data protobuf definition
6
- const cacheValueProtoDef = `package awesomepackage;
7
- /**
8
- * @TypeId(1000044)
9
- */
10
- message AwesomeUser {
11
- required string name = 1;
12
- required int64 age = 2;
13
- required bool isVerified =3;
14
- }`
15
- try {
16
- // Creating clients for two caches:
17
- // - ___protobuf_metadata for registering .proto file
18
- // - queryCache for user data
19
- const connectProp = { port: 11222, host: '127.0.0.1' };
20
- const commonOpts = {
21
- version: '3.0',
22
- authentication: {
23
- enabled: true,
24
- saslMechanism: 'DIGEST-MD5',
25
- userName: 'admin',
26
- password: 'pass'
27
- }
28
- };
29
- const protoMetaClientOps = {
30
- cacheName: '___protobuf_metadata',
31
- dataFormat: { keyType: "text/plain", valueType: "text/plain" }
32
- }
33
- const clientOps = {
34
- dataFormat: { keyType: "text/plain", valueType: "application/x-protostream" },
35
- cacheName: 'queryCache'
36
- }
37
- var protoMetaClient = await infinispan.client(connectProp, Object.assign(commonOpts, protoMetaClientOps));
38
- var client = await infinispan.client(connectProp, Object.assign(commonOpts, clientOps));
39
-
40
- // Registering protobuf definition on server
41
- await protoMetaClient.put("awesomepackage/AwesomeUser.proto", cacheValueProtoDef);
42
-
43
- // Registering protobuf definition on protobufjs
44
- const root = protobuf.parse(cacheValueProtoDef).root;
45
- const AwesomeUser = root.lookupType(".awesomepackage.AwesomeUser");
46
- client.registerProtostreamRoot(root);
47
- client.registerProtostreamType(".awesomepackage.AwesomeUser", 1000044);
48
-
49
- // Cleanup and populating the cache
50
- await client.clear();
51
- for (let i = 0; i < 10; i++) {
52
- const payload = { name: "AwesomeName" + i, age: i, isVerified: (Math.random() < 0.5) };
53
- const message = AwesomeUser.create(payload);
54
- console.log("Creating entry:", message);
55
- await client.put(i.toString(), message)
56
- }
57
- // Run the query
58
- const queryStr = `select u.name,u.age from awesomepackage.AwesomeUser u where u.age<20 order by u.name asc`;
59
- console.log("Running query:", queryStr);
60
- const query = await client.query({ queryString: queryStr });
61
- console.log("Query result:");
62
- console.log(query);
63
- } catch (err) {
64
- handleError(err);
65
- } finally {
66
- if (client) {
67
- await client.disconnect();
68
- }
69
- if (protoMetaClient) {
70
- await protoMetaClient.disconnect();
71
- }
72
- }
73
- })();
74
-
75
- function handleError(err) {
76
- if (err.message.includes("'queryCache' not found")) {
77
- console.log('*** ERROR ***');
78
- console.log(`*** This example needs a cache 'queryCache' with the following config:
79
- {
80
- "local-cache": {
81
- "statistics": true,
82
- "encoding": {
83
- "key": {
84
- "media-type": "text/plain"
85
- },
86
- "value": {
87
- "media-type": "application/x-protostream"
88
- }}}}`)
89
- } else {
90
- console.log(err);
91
- }
92
- }
@@ -1,64 +0,0 @@
1
- var infinispan = require('infinispan');
2
-
3
- var connected = infinispan.client(
4
- {port: 11222, host: '127.0.0.1'}
5
- {
6
- // Configure client connections with authentication and encryption here.
7
- }
8
- );
9
-
10
- connected.then(function (client) {
11
-
12
- var clientAddListenerCreate = client.addListener('create', onCreate);
13
-
14
- var clientAddListeners = clientAddListenerCreate.then(
15
- function(listenerId) {
16
- // Associate multiple callbacks with a single client-side listener.
17
- // To do this, register listeners with the same listener ID.
18
- var clientAddListenerModify =
19
- client.addListener('modify', onModify, {listenerId: listenerId});
20
-
21
- var clientAddListenerRemove =
22
- client.addListener('remove', onRemove, {listenerId: listenerId});
23
-
24
- return Promise.all([clientAddListenerModify, clientAddListenerRemove]);
25
- });
26
-
27
- var clientCreate = clientAddListeners.then(
28
- function() { return client.putIfAbsent('eventful', 'v0'); });
29
-
30
- var clientModify = clientCreate.then(
31
- function() { return client.replace('eventful', 'v1'); });
32
-
33
- var clientRemove = clientModify.then(
34
- function() { return client.remove('eventful'); });
35
-
36
- var clientRemoveListener =
37
- Promise.all([clientAddListenerCreate, clientRemove]).then(
38
- function(values) {
39
- var listenerId = values[0];
40
- return client.removeListener(listenerId);
41
- });
42
-
43
- return clientRemoveListener.finally(
44
- function() { return client.disconnect(); });
45
-
46
- }).catch(function(error) {
47
-
48
- console.log("Got error: " + error.message);
49
-
50
- });
51
-
52
- function onCreate(key, version) {
53
- console.log('[Event] Created key: ' + key +
54
- ' with version: ' + JSON.stringify(version));
55
- }
56
-
57
- function onModify(key, version) {
58
- console.log('[Event] Modified key: ' + key +
59
- ', version after update: ' + JSON.stringify(version));
60
- }
61
-
62
- function onRemove(key) {
63
- console.log('[Event] Removed key: ' + key);
64
- }
@@ -1,33 +0,0 @@
1
- var infinispan = require('infinispan');
2
- var readFile = Promise.denodeify(require('fs').readFile);
3
-
4
- var connected = infinispan.client(
5
- {port: 11222, host: '127.0.0.1'}
6
- {
7
- // Configure client connections with authentication and encryption here.
8
- }
9
- );
10
-
11
- connected.then(function (client) {
12
-
13
- var addScriptFile = readFile('sample-script.js').then(
14
- function(file) {
15
- return client.addScript('sample-script', file.toString());
16
- });
17
-
18
- var clientExecute = addScriptFile.then(
19
- function() {
20
- return client.execute('sample-script', {k: 'exec-key', v: 'exec-value'});
21
- });
22
-
23
- var showExecute = clientExecute.then(
24
- function(ret) { console.log('Script execution returned: ' + ret); });
25
-
26
- return showExecute.finally(
27
- function() { return client.disconnect(); });
28
-
29
- }).catch(function(error) {
30
-
31
- console.log("Got error: " + error.message);
32
-
33
- });
@@ -1,3 +0,0 @@
1
- // mode=local,language=javascript,parameters=[k, v],datatype='text/plain; charset=utf-8'
2
- cache.put(k, v);
3
- cache.get(k);
@@ -1,49 +0,0 @@
1
- var infinispan = require('infinispan');
2
-
3
- var connected = infinispan.client(
4
- {port: 11222, host: '127.0.0.1'},
5
- {
6
- cacheName: 'myCache',
7
- authentication: {
8
- enabled: true,
9
- saslMechanism: 'DIGEST-MD5',
10
- userName: 'username',
11
- password: 'changeme'
12
- }
13
- }
14
- );
15
-
16
- connected.then(function (client) {
17
-
18
- var clientPut = client.put('key', 'value');
19
-
20
- var clientGet = clientPut.then(
21
- function() { return client.get('key'); });
22
-
23
- var showGet = clientGet.then(
24
- function(value) { console.log('get(key)=' + value); });
25
-
26
- var clientRemove = showGet.then(
27
- function() { return client.remove('key'); });
28
-
29
- var showRemove = clientRemove.then(
30
- function(success) { console.log('remove(key)=' + success); });
31
-
32
- var clientStats = showRemove.then(
33
- function() { return client.stats(); });
34
-
35
- var showStats = clientStats.then(
36
- function(stats) {
37
- console.log('Number of stores: ' + stats.stores);
38
- console.log('Number of cache hits: ' + stats.hits);
39
- console.log('All statistics: ' + JSON.stringify(stats, null, " "));
40
- });
41
-
42
- return showStats.finally(
43
- function() { return client.disconnect(); });
44
-
45
- }).catch(function(error) {
46
-
47
- console.log("Got error: " + error.message);
48
-
49
- });
@@ -1,14 +0,0 @@
1
- {
2
- "appenders": {
3
- "test": {
4
- "type": "fileSync",
5
- "filename": "my-log-file.log"
6
- }
7
- },
8
- "categories": {
9
- "default": {
10
- "appenders": ["test"],
11
- "level": "trace"
12
- }
13
- }
14
- }
@@ -1,16 +0,0 @@
1
- [id='configuring-authentication_{context}']
2
- = Configuring authentication
3
-
4
- {brandname} Server uses different SASL mechanisms to authenticate {hr_js} client connections.
5
-
6
- .Prerequisites
7
-
8
- * Create {brandname} users.
9
- * Add the SASL authentication mechanism to the Hot Rod connector in your {brandname} Server configuration.
10
-
11
- .Procedure
12
-
13
- . Open the {hr_js} client configuration for editing.
14
- . Add an `authentication` method that sets the `enabled: true` flag.
15
- . Specify a value for the `saslMechanism` parameter that matches the SASL authentication mechanism for the Hot Rod connector.
16
- . Configure any parameters specific to the SASL authentication mechanism as appropriate.
@@ -1,25 +0,0 @@
1
- [id='configuring-connections_{context}']
2
- = Configuring {brandname} connections
3
- Configure {hr_js} clients to connect to {brandname} Server.
4
-
5
- If you add multiple server addresses to the configuration, the {hr_js} client loops through them until it finds a node to which it can connect.
6
-
7
- However, you only need to add one {brandname} Server address for the client to receive the entire cluster topology.
8
- If the {hr_js} client connects to a single server instance that is a member of a cluster, the client gets the address information for all nodes.
9
-
10
- Because {hr_js} clients are topology aware, if a connection to one {brandname} Server breaks, the client retries any incomplete operations on other nodes in the cluster.
11
- Likewise, if client listener that is registered on one {brandname} Server fails or leaves the cluster, the client transparently migrates the listener registration to another node in the cluster so that it can continue receiving events.
12
-
13
- .Prerequisites
14
-
15
- * Install the {hr_js} client.
16
- * Have at least one running {brandname} Server instance.
17
-
18
- .Procedure
19
-
20
- * Specify hostnames and ports for {brandname} Server in the client configuration.
21
- +
22
- [source,javascript,options="nowrap",subs=attributes+]
23
- ----
24
- include::code_examples/connection-multiple-servers.js[]
25
- ----
@@ -1,18 +0,0 @@
1
- [id='configuring-connections-cross-site_{context}']
2
- = Defining {brandname} clusters in client configuration
3
- When you set up {brandname} clusters in separate data centers to perform cross-site replication, you can add connection details for the different sites to the client configuration.
4
-
5
- .Prerequisites
6
-
7
- * Install the {hr_js} client.
8
- * Configure {brandname} for cross-site replication.
9
-
10
- .Procedure
11
-
12
- . Add a `clusters` definition to your configuration.
13
- . Add `name` and `servers` definitions for each {brandname} cluster.
14
- +
15
- [source,javascript,options="nowrap",subs=attributes+]
16
- ----
17
- include::code_examples/connection-xsite.js[]
18
- ----
@@ -1,30 +0,0 @@
1
- [id='configuring-data-formats_{context}']
2
- = Configuring data formats
3
- {hr_js} clients can handle keys and values as native JavaScript Object Notation (JSON) objects or as String objects.
4
- By default, clients handle entries as String objects.
5
- If you want to transmit data to {brandname} Server in JSON format, then you must configure the {hr_js} client.
6
-
7
- //Community content
8
- ifdef::community[]
9
- Starting at version 0.6, {hr_js} clients support native JSON objects as keys and values.
10
- Earlier versions of the client support keys and values as String only.
11
- endif::community[]
12
-
13
- [NOTE]
14
- ====
15
- Script operations support String key/value pairs and String parameters only.
16
- ====
17
-
18
- .Procedure
19
-
20
- . Add a `dataFormat` configuration to your client.
21
- . Set the data format for keys and values as appropriate with the `keyType` and `valueType` parameters.
22
-
23
- Keys and values can have different media types.
24
- For JSON objects, specify `application/json`.
25
- For String objects, specify `text/plain` or omit the parameter to use the default.
26
-
27
- [source,javascript,options="nowrap",subs=attributes+]
28
- ----
29
- include::code_examples/data-types.js[]
30
- ----
@@ -1,15 +0,0 @@
1
- [id='configuring-encryption_{context}']
2
- = Configuring encryption
3
-
4
- {brandname} Server can enforce different types of SSL/TLS encryption to secure {hr_js} client connections.
5
-
6
- .Prerequisites
7
-
8
- * Create a trust store that {hr_js} clients can use to verify {brandname} Server identities.
9
- * If you configure {brandname} Server to validate or authenticate client certificates, create a keystore as appropriate.
10
-
11
- .Procedure
12
-
13
- . Open the {hr_js} client configuration for editing.
14
- . Add an `ssl` method that sets the `enabled: true` flag.
15
- . Provide any other configuration specific to the type of encryption you use.
@@ -1,28 +0,0 @@
1
- [id='configuring-logging_{context}']
2
- = Configuring logging
3
-
4
- {hr_js} clients use `log4js`, which you can modify by providing configuration in JSON format.
5
-
6
- .Procedure
7
-
8
- . Create a logging configuration in JSON format.
9
- +
10
- For example, the following JSON configures an appender that writes TRACE level log events to file:
11
- +
12
- [source,json,options="nowrap",subs=attributes+]
13
- ----
14
- include::config_examples/logging.json[]
15
- ----
16
- +
17
- . Add the `var log4js = require('log4js')` statement to the {hr_js} client configuration.
18
- . Specify the path to your JSON logging configuration with the `log4js.configure()` method, as in the following example:
19
- +
20
- [source,javascript,options="nowrap",subs=attributes+]
21
- ----
22
- include::code_examples/logging-configuration.js[]
23
- ----
24
-
25
- [role="_additional-resources"]
26
- .Additional resources
27
- * link:https://www.npmjs.com/package/log4js[log4js]
28
- * link:https://github.com/log4js-node/log4js-node/tree/master/examples[log4js-node examples]