-
Notifications
You must be signed in to change notification settings - Fork 97
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
Java Thin Client documentation page for 5.5.0 added #1240
Conversation
✅ Deploy Preview for hardcore-allen-f5257d ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Why is the preview not working? Can we restart it? |
There's a current known issue that the preview is generated but it doesn't link correctly. I think I know where the cause is but we have a bundle of build errors and warnings right now that need a proper audit and tidy up - it's planned but that's the workaround right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can say that your new file is based on https://github.com/hazelcast/hz-docs/blob/main/docs/modules/clients/pages/java.adoc but there're a lot of changed words etc. Do you take master branch as reference ? If you copy any text from somewhere, can you add it to the description including the branch/version of it so that we will save time reviewing the PR. ty
In general, can you describe how you write the document? I'll not focus on grammar stuff much (doc team does that) but I need to know what's new that you've written and what's already copied from our documentation
I can already see that you deleted the non-applicable sections for thin-client from the original version
NOTE: If you have a Hazelcast {enterprise-product-name} license, you do not need to set the license key in your clients to use the xref:getting-started:editions.adoc#features-in-hazelcast-enterprise[{enterprise-product-name} features]. It is sufficient to set the license on the member side, and include the `hazelcast-enterprise-java-client-{full-version}.jar` dependency in your classpath. | ||
|
||
If using Maven, add the `hazelcast` dependency | ||
to your `pom.xml`, or to the `hazelcast-enterprise` dependency if you want the client to use {enterprise-product-name} features, and you have the Hazelcast {enterprise-product-name} license), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to your `pom.xml`, or to the `hazelcast-enterprise` dependency if you want the client to use {enterprise-product-name} features, and you have the Hazelcast {enterprise-product-name} license), | |
to your `pom.xml`, or the `hazelcast-enterprise` dependency if you want the client to use {enterprise-product-name} features, and you have the Hazelcast {enterprise-product-name} license), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indded we initially started from java.adoc
and removed all the sections irrelevant to the thin client (and also changed the structure of the document). Since then both sides has been changed. In the java.adoc
it was both functional changes (e.g. Cluster Routing Modes) and stylistic (words, punctuation etc). On the thin client side we've implemented a lot of stuff missing in the very first version and so in the java-thin-client.adoc
we added back respective sections. But we haven't compared the two documents side-by-side and transfer all the stylistic changes. We suggest that we don't do it right now and release the 5.5b with what we currently have. After the release we will either establish some process of continuously merging the changes from java.adoc
(and maintaining two nearly identical versions of the doc) or do something more clever -- we can discuss it then. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, sounds good. lets create a jira for this
If you use a <<client-network,discovery mechanism>> to find the initial member for the connection instead of an address list, | ||
you can use the same property to configure whether the initial member connection uses the private or public address. | ||
|
||
For an example of this scenario, refer to | ||
link:https://docs.hazelcast.com/tutorials/hazelcast-platform-operator-expose-externally[Connect to Hazelcast from Outside Kubernetes, window=_blank] in the Operator documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use the same property to
these two paragprahs are about a property that enables configuring client to use public or private ip to connect to members.
the property is not mentioned before these paragraphs, so which property? These paragraphs should be removed or the property should be mentioned before them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section "Handling Client Connection Failure" updated from java.adoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thin Client does not support routing modes as I know, it's better to modify the copied text, or revert the change and add the public ip property(this is preferred, or remove 2 paragraphs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does thin client not support routing modes?
<<setting-connection-timeout, Setting Connection Timeout section>>. | ||
|
||
[[blue-green-deployment-and-disaster-recovery]] | ||
== Blue-Green Deployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is "Ordering of Clusters When Clients Try to Connect" section missing from thin client? See https://github.com/hazelcast/hz-docs/blob/main/docs/modules/clients/pages/java.adoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this section be added back in then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I don't see the reason of excluding this section. The feature might be missing in the thin client (in this case it's fine to exclude) or it can be forgotten (or the source page was old compared to main branch)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alexey will look at this section soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the section (allow some time to address other changes and commit the changes)
I finished my review by comparing the new doc to https://github.com/hazelcast/hz-docs/blob/main/docs/modules/clients/pages/java.adoc (with the version in the same branch (PR branch)) |
If using the `MULTI_MEMBER` cluster routing mode, and the cluster has multiple partition groups defined | ||
and the client connection to a partition group fails, connectivity is maintained by failing over to an alternative partition group. | ||
If the connection is lost, which occurs only if all members of the partition group become unavailable, there is no attempt to retry the connection before failing over to another partition group. | ||
For further information on client cluster routing modes, see <<client-cluster-routing-modes,Client Cluster Routing Modes>>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the thin client support cluster routing modes? like MULTI_MEMBER etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does but in the newest version. In the verion 5.5 (the one which this doc relates to) it didn't. I have reverted the change and removed the mention of that property. Hope this is OK for now since once this is merged we will submit another PR for the newest version -- in which mentioning MULTI_MEMBER and other cluster routing modes will be valid
This reverts commit 03b6304.
…on Failure section
There're broken links it seems. https://github.com/hazelcast/hz-docs/actions/runs/10681051704/job/29603869724?pr=1240 |
@@ -0,0 +1,1118 @@ | |||
= {java-standard-client-name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a "standalone" client, not standard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created new variables and I'm using these, will highlight when new PR is up
@@ -0,0 +1,1118 @@ | |||
= {java-standard-client-name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove thin
from file names as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also done in my branch
@@ -0,0 +1,1118 @@ | |||
= {java-standard-client-name} | |||
:url-cloud-signup: https://cloud.hazelcast.com/sign-up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing
:page-api-reference: https://docs.hazelcast.org/docs/{page-latest-supported-java-client}/javadoc
but this should change to this new client javadoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependent on API discussions but I have two variables in my branch so we can track compatibility and API links separately if needed.
to your `pom.xml`, or to the `hazelcast-enterprise` dependency if you want the client to use {enterprise-product-name} features, and you have the Hazelcast {enterprise-product-name} license, | ||
which might have been done when starting using Hazelcast. | ||
|
||
The `pom.xml` file is updated as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for os artifact, can you also add the EE jar maven usage example. It can be in tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in my local branch
<version>{full-version}</version> | ||
</dependency> | ||
---- | ||
The {java-standard-client-name} is mostly compatible with the Embed client. However, one notable difference is that methods which threw `UnsupportedOperationException` in the Embed client are not present at all in the {java-standard-client-name}. For example, the following methods from `ClientMapProxy`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this different? Is there a decision log for this? We want 1:1 same with platform client including the exceptions we throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As currently implemented: it is because the embed client shares some common code with the members and it stubs some methods via throwing exceptions in cases when the user decides to call impropriate method on the client side.
In the Standard/Thin client the "member" code was eliminated.
Let's discuss this item with the developers outside the PR's conversation.
NOTE: Currently, using both the {java-standard-client-name} and the Member code (including the Embed client) on the same JVM is not supported. | ||
It will be supported in the future versions. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing this from java.adoc
:
You can find Hazelcast Java client's code samples https://github.com/hazelcast/hazelcast-code-samples/tree/master/clients[here^].
Can you please take a diff and update you PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was taken out deliberately but this is superseded by latest discussions and plans.
|
||
The client API is your gateway to access your Hazelcast cluster, including distributed objects and data pipelines (jobs). | ||
|
||
First, you must configure your client. Currently, the {java-standard-client-name} supports only programmatic configuration, as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The java.adoc refers to a section, can you update this?
# Conflicts: # docs/modules/clients/pages/java-thin-client.adoc
Co-authored-by: ihsan demir <[email protected]>
Co-authored-by: ihsan demir <[email protected]>
Co-authored-by: ihsan demir <[email protected]>
See #1289 for fresh PR with latest changes |
```java | ||
Properties properties = new Properties(); | ||
properties.setProperty("protocol", "TLSv1.2"); | ||
properties.setProperty("trustCertCollectionFile", "/path/server.crt"); | ||
|
||
SSLConfig sslConfig = new SSLConfig().setEnabled(true) | ||
.setProperties(properties); | ||
sslConfig.setFactoryClassName(BasicSSLContextFactory.class.getName()) | ||
.setFactoryImplementation(new BasicSSLContextFactory()); | ||
ClientConfig clientConfig = new ClientConfig(); | ||
clientConfig.getNetworkConfig().setSSLConfig(sslConfig); | ||
``` | ||
Please note that the paths in the properties here are *absolute paths* to the resources in classpath. | ||
|
||
To enable mutual authentication on the client, add to the properties: | ||
```java | ||
properties.setProperty("keyFile", "/path/client.pem"); | ||
properties.setProperty("keyCertChainFile", "/path/client.crt"); | ||
``` | ||
To use the OpenSSL engine instead of the Basic SSL context, | ||
replace the SSL context factory class name and implementation as follows: | ||
```java | ||
sslConfig.setFactoryClassName(OpenSSLEngineFactory.class.getName()) | ||
.setFactoryImplementation(new OpenSSLEngineFactory()); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code sample from the original Cloud section (now removed)?
Closing this PR as we have the replacement PR linked above... |
Based on https://github.com/hazelcast/hz-docs/blob/main/docs/modules/clients/pages/java.adoc