Skip to content
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

Closed
wants to merge 16 commits into from

Conversation

sergey-serdyukov
Copy link

@sergey-serdyukov sergey-serdyukov commented Aug 2, 2024

Copy link

netlify bot commented Aug 2, 2024

Deploy Preview for hardcore-allen-f5257d ready!

Name Link
🔨 Latest commit 58740ba
🔍 Latest deploy log https://app.netlify.com/sites/hardcore-allen-f5257d/deploys/66e7e050422d0d0008076f5d
😎 Deploy Preview https://deploy-preview-1240--hardcore-allen-f5257d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@oliverhowell oliverhowell self-requested a review August 22, 2024 09:17
@srknzl
Copy link
Member

srknzl commented Aug 22, 2024

Why is the preview not working? Can we restart it?

@ollyhowell
Copy link

Why is the preview not working? Can we restart it?

Try https://deploy-preview-1240--hardcore-allen-f5257d.netlify.app/hazelcast/5.5/clients/java-thin-client

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.

Copy link
Member

@srknzl srknzl left a 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),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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),

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?

Copy link
Member

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

Comment on lines 133 to 137
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.
Copy link
Member

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.

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

Copy link
Member

@srknzl srknzl Sep 3, 2024

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

Copy link
Contributor

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
Copy link
Member

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

Copy link
Contributor

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?

Copy link
Member

@srknzl srknzl Sep 2, 2024

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)

Copy link
Author

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

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)

@srknzl
Copy link
Member

srknzl commented Aug 24, 2024

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>>.
Copy link
Member

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?

Copy link

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

@srknzl
Copy link
Member

srknzl commented Sep 11, 2024

@@ -0,0 +1,1118 @@
= {java-standard-client-name}
Copy link
Member

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

Copy link
Contributor

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}
Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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.

docs/modules/clients/pages/java-thin-client.adoc Outdated Show resolved Hide resolved
docs/modules/clients/pages/java-thin-client.adoc Outdated Show resolved Hide resolved
docs/modules/clients/pages/java-thin-client.adoc Outdated Show resolved Hide resolved
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:
Copy link
Contributor

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.

Copy link
Contributor

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`:
Copy link
Contributor

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.

Copy link
Author

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.


Copy link
Contributor

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?

Copy link
Contributor

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:
Copy link
Contributor

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?

@oliverhowell oliverhowell mentioned this pull request Sep 16, 2024
@oliverhowell
Copy link
Contributor

See #1289 for fresh PR with latest changes

Comment on lines +782 to +806
```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());
```
Copy link
Contributor

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)?

@oliverhowell
Copy link
Contributor

Closing this PR as we have the replacement PR linked above...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants