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
Copy file name to clipboardexpand all lines: README.md
+32-6
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ the network transport.
12
12
* Registration of listeners to be notified of map mutations
13
13
14
14
### Requirements
15
-
* Coherence CE `22.06` or later (or equivalent non-open source editions) with a configured [gRPC Proxy](https://docs.oracle.com/en/middleware/standalone/coherence/14.1.1.2206/develop-remote-clients/using-coherence-grpc-server.html)
15
+
* Coherence CE versions `22.06`, `14.1.2-0-0`, `24.09` or later (or equivalent non-open source editions) with a configured [gRPC Proxy](https://docs.oracle.com/en/middleware/standalone/coherence/14.1.1.2206/develop-remote-clients/using-coherence-grpc-server.html)
16
16
* Node `18.15.x` or later
17
17
* NPM `9.x` or later
18
18
@@ -40,7 +40,7 @@ For more details on the image, see the [documentation](https://github.com/oracle
40
40
41
41
### Declare Your Dependency
42
42
43
-
To use the Coherence gRPC JavaScript Client, simply declare it as a dependency in your
43
+
To use the JavaScript Client for Oracle Coherence, simply declare it as a dependency in your
44
44
project's `package.json`:
45
45
```
46
46
...
@@ -52,8 +52,8 @@ project's `package.json`:
52
52
53
53
### Compatibility with Java Types
54
54
The following table provides a listing of mappings between Java types and Javascript types when working with
55
-
Coherence `23.09` or later. If using Coherence `22.06.x`, these types will be returned as Number. It is recommended
56
-
using `23.09` if intentionally using `java.math.BigInteger` or `java.math.BigDecimal` as part of your application.
55
+
Coherence `24.09` or later. If using Coherence `22.06.x`, these types will be returned as Number. It is recommended
56
+
using `24.09` if intentionally using `java.math.BigInteger` or `java.math.BigDecimal` as part of your application.
57
57
58
58
| Java Type | JavascriptType |
59
59
|----------------------|------------------------|
@@ -68,15 +68,15 @@ using `23.09` if intentionally using `java.math.BigInteger` or `java.math.BigDec
68
68
#### Establishing a Session
69
69
70
70
The Coherence uses the concept of a `Session` to manage a set of related Coherence resources,
71
-
such as maps and/or caches. When using the Coherence JavaScript Client, a `Session` connects to a specific
71
+
such as maps and/or caches. When using the JavaScript Client for Oracle Coherence, a `Session` connects to a specific
72
72
gRPC endpoint and uses a specific serialization format to marshal requests and responses.
73
73
This means that different sessions using different serializers may connect to the same server endpoint. Typically,
74
74
for efficiency the client and server would be configured to use matching serialization formats to avoid
75
75
deserialization of data on the server, but this does not have to be the case. If the server is using a different
76
76
serializer for the server-side caches, it must be able to deserialize the client's requests, so there must be
77
77
a serializer configured on the server to match that used by the client.
78
78
79
-
> NOTE: Currently, the Coherence JavaScript client only supports JSON serialization
79
+
> NOTE: Currently, the JavaScript Client for Oracle Coherence only supports JSON serialization
80
80
81
81
A `Session` is constructed using an `Options` instance, or a generic object with the same keys and values.
82
82
@@ -126,6 +126,32 @@ const opts = new Options({address: 'example.com:4444'})
126
126
let session =newSession(opts)
127
127
```
128
128
129
+
As of v1.2.3 of the JavaScript Client for Oracle Coherence, it's now possible to use the Coherence
130
+
NameService to lookup gRPC Proxy endpoints. The format to enable this feature is
*`coherence:///localhost` will connect to the name service bound to a local coherence cluster on port `7574` (the default Coherence cluster port).
135
+
*`coherence:///localhost:8000` will connect to the name service bound to a local coherence cluster on port `8000`.
136
+
*`coherence:///localhost:remote-cluster` will connect to the name service bound to a local coherence cluster on port `7574` (the default Coherence cluster port) and look up the name service for the given cluster name. Note: this typically means both clusters have a local member sharing a cluster port.
137
+
*`coherence:///localhost:8000:remote-cluster` will connect to the name service bound to a local coherence cluster on port `8000` and look up the name service for the given cluster name. Note: this typically means both clusters have a local member sharing a cluster port.
138
+
139
+
While this is useful for local development, this may have limited uses in a production environment. For example,
140
+
Coherence running within a container with the cluster port (`7574`) exposed so external clients may connect. The
141
+
lookup will fail to work for the client as the Coherence name service return a private network address which
142
+
won't resolve. Lastly, if connecting to a cluster that has multiple proxies bound to different ports, gRPC, by default,
143
+
will use the first address returned by the resolver. It is possible to enable round-robin load balancing by including
144
+
a custom channel option when creating the session:
0 commit comments