-
Notifications
You must be signed in to change notification settings - Fork 74
How to configure the same partitioned cache to be a back cache both for use "in cluster" and with gRPC? #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@javafanboy Do you mean you want to use a NearCache on a Java gRPC client? This should just work as you define things in the client cache config like normal, but instead of an Extend |
I mean that I already have a "near cache" configuration that I use to
efficiently share a lot of data with Java clients that are "regular
members" of the Coherence cluster.
Now I would also some other clients, my first and most important case AWS
Lambda functions written in Java (that since Lambda functions are suspended
when not called cant maintain cluster membership), to both put and get
objects to THE SAME "near cache" allowoing them to interact with the
existing "regular members".
Ideally I would like them to also have a "near" cache tier (but I am not
sure how invalidation would work for this given the "intermittent life" of
the LAmbda functions) but even just access to the back tier of the near
cache with no "front tier" would be a step in the right direction and
potentially as efficient as other popular caching alternatives in the cloud
that only provide access over network....
My question is basically what additional configuration I would need to add
in the cache config file to make this cache (or at least its back tier)
reachable over gRPC from a Java client not part of the cluster?
…On Fri, May 24, 2024 at 3:55 PM Jonathan Knight ***@***.***> wrote:
@javafanboy <https://github.com/javafanboy> Do you mean you want to use a
NearCache on a Java gRPC client? This should just work as you define things
in the client cache config like normal, but instead of an Extend
remote-cache-scheme you define a remote-grpc-cache-scheme as documented
here Defining a Remote gRPC Cache
<https://docs.oracle.com/en/middleware/standalone/coherence/14.1.1.2206/develop-remote-clients/using-coherence-java-grpc-client.html#GUID-8E1B2F97-9784-4204-9B00-92B3222DE043>
—
Reply to this email directly, view it on GitHub
<#126 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADXQF64PJ74JNAW3FIU5JTZD5BELAVCNFSM6AAAAABIHT5M5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZGYYDCNJYHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
OK, if I understand correctly you have a NearCache on the cluster member that is running the proxy that the client connects to. In that case the NearCache will not be used by clients. I am pretty sure both Extend clients and gRPC clients will bypass any NearCache on the proxy and go straight to the back cache. |
That would be just fine - my most heavy processing will still be in
containers or VMs that are regular cluster members.
What additional cache config would be required to make that happen? I have already got the gRPC proxy running but I fail to see what I would need to add in order to make the "near cache" also usable with it. The examples in the documentation assumes I create a new cache configuration for gRPC....
Also what would give best performance today extend or the gRPC proxy (as I
understand it these are two different but "competing" solutions - seemingly
gRPC is the one that seems to have most future potential but if I only use
Java Extend is more well proven as of now)?
…On Fri, May 24, 2024 at 4:24 PM Jonathan Knight ***@***.***> wrote:
OK, if I understand correctly you have a NearCache on the cluster member
that is running the proxy that the client connects to. In that case the
NearCache will not be used by clients. I am pretty sure both Extend clients
and gRPC clients will bypass any NearCache on the proxy and go straight to
the back cache.
—
Reply to this email directly, view it on GitHub
<#126 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADXQF5BXRA3CXIFBJKOSWTZD5ETLAVCNFSM6AAAAABIHT5M5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZGY2TOMRYGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
To make my question more clear I created two minimal test program, one that joins the Coherence cluster and inserts a value in a near cache and another that tries to extract the same value but does not join the coherence cluster and instead tries to use the gRPC client. package com.test;
} package com.test; import com.tangosol.net.*; public class MicroCoherenceRPCTest {
}
|
There seems to be a few things here.
The simplest way to get a session at start-up on a cluster member is
|
Thanks for the quick reply "gridman"! Updating the gRPC test as follows:
results in the following exception: and later when I try to retrieve the session If I remove the line disabling tcmp the program runs but I suspects it then joing the cluster normally rather than use gRPC client/proxy?! |
This is because your code is doing this:
which as the method name suggests is going to start Coherence as a cluster member, but you have this property set
which will disable clustering. If you want this code to start a client then you need to do |
Sorry but now slightly confused here - if I do NOT disable tcmp the client joins the cluster (I can see log messages that I interpret like it jons the cache service etc). So how do I initiate the client so that it will NOT join the cluster but still can access caches using gRPC client/proxy? Do I then need to used another method to find the gRPC proxy (like the fixed IP)? |
If you are starting a client with |
Thanks will create a separate config for the "loosely connected" clients!
…On Mon, May 27, 2024, 17:37 Jonathan Knight ***@***.***> wrote:
If you are starting a client with Coherence.client().start() then you
should be able to use System.setProperty("coherence.tcmp.enabled",
"false"); But if your client cache config is the one you posted above,
then it has services defined with <autostart>true</autostart> that are
clustered services (i.e. distributed-scheme and paged-topic-scheme) and
will attempt to start the cluster. You either need a client config that
only has the client remote-grpc-scheme or do not autostart the clustered
services
—
Reply to this email directly, view it on GitHub
<#126 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADXQFZXUXPJJFPSM3VDACLZENHLRAVCNFSM6AAAAABIHT5M5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZTG4YTEMBTGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Latest try I simplified the program to this (I assume I still need the wka for finding the grpc proxy etc):
and created a separate grpc-custom-cache-config.xml that looks like this:
but still get the exception
Are these things documented somewhere - I tried reading about gRPC but did not find very detailed information about the start of the client etc. |
In your code you are still starting Coherence as a cluster member
This means Coherence will start various "system" services which require the cluster.
|
Thanks very much - now it works!!!! |
I am using Coherence 24.03 and has started to look at using the gRPC prox to allow "dynamically connected clients" (AWS Lambda functions) that be members of a Coherence cluster and client written in other languages than Java.
As we already have a large "near cache" (local front and partitioned back) that is central to our system I would the new clients to also use it rather than create a new cache for use with gRPC.
I always struggle with how to write the XML cache configuration for my systems and this is no exception - can anybody please give me some hints if this is possible and if so how I could go about it?
The text was updated successfully, but these errors were encountered: