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

Infinispan client docs #786

Merged
merged 3 commits into from
Feb 7, 2019
Merged

Infinispan client docs #786

merged 3 commits into from
Feb 7, 2019

Conversation

wburns
Copy link
Member

@wburns wburns commented Feb 6, 2019

This contains 2 issues:

  1. Add Shamrock Infinispan Client documentation
  2. Add Infinispan Client to the extensions list

The second one shouldn't be needed if #663 is integrated first.

@Sanne Sanne self-assigned this Feb 6, 2019
Copy link
Member

@Sanne Sanne left a comment

Choose a reason for hiding this comment

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

Great progress, thanks!

I've made several remarks that could be addressed, or not. Up to you.

The one critical issue which should be addressed before merging is the missing "<" in the last XML block.

Some of the other ones make me think we need to improve usability further. Feel free to not address them but open tickets to track them as future enhancements?

= {project-name} - Infinispan Client

Infinispan is an in memory data grid that allows running in a server outside of application processes. This extension
provides functionality to allow the client that can connect to said server when running in protean.
Copy link
Member

Choose a reason for hiding this comment

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

best to try sticking to {project-name} rather than protean .. no biggie though, I guess we'll have to run some search and replace anyway ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I can fix that.

will be automatically picked up during the static initialization time from the `META-INF`
directory and parsed as it would normally.

You can also define some properties in the `microprofile-config.properties` file that can be
Copy link
Member

Choose a reason for hiding this comment

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

I think I'd switch this around: present just a single way to do things, which is to use the Protean configuration.

at the end you can add a note for advanced users pointing out that using hotrod-client.properties is also an option.

Try to keep the language short and to the point? "If you are familiar or noticed in the above client server guide," can all be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I had originally talked with @tristantarrant and @emmanuelbernard about this and they wanted just minimal things in the microprofile config file. I am fine moving these over if we want, but we should have a separate issue for that.

Sure I can remove the extra wording.

Copy link
Member

Choose a reason for hiding this comment

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

+1 we must explain how you do the main things the easy way. And then explain the more and more complex things. If someone can do the job with out having to read the fact that they can use hot rod.propetries then we win.


By default the client will only support keys and values of the type byte[]. This can be configured
through the `hotrod-client.properties` file mentioned above through the `infinispan.client.hotrod.marshaller`
property. You can either supply your own marshaller implementation or use the `ProtoStreamMarshaller` as described
Copy link
Member

Choose a reason for hiding this comment

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

Could we avoid the need for using the hotrod-client.properties ?

I'd welcome the option to either set this directly in the Protean config, or somehow auto-discover such additional marshallers. Remember we have Jandex so that might be possible ;)

The mantra is to try hard to make it all work with the single config file, and if possible at all to not need config. UX to 11 ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, it would be nice - however I think we need to tackle this elsewhere.

I am aware of Jandex :) Although it seems like I should probably refrain from talking about a custom marshaller.

The more I am thinking about this with the comments you guys mentioned, I am thinking I should probably add infinispan-remote-query-client as a dependency to the shamrock infinispan client module and always have the ProtoStreamMarshaller as default.

Copy link
Member

Choose a reason for hiding this comment

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

BTW making microprofile coding having priority over hot rod property file, is that the right thing? I think we do the opposite in Hibernate ORM and even throw exception when there is conflict. @wburns @Sanne thoughts ?

Copy link
Member

@emmanuelbernard emmanuelbernard Feb 7, 2019

Choose a reason for hiding this comment

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

By default the client will only support keys and values of the type byte[].

Soooo, I am scared. I am a web app developer and I don’t understand that. What does that mean? What’s my limitations. What does it means for me as a code usage?

The other thing that scares me is that what you are saying is that by défaut, it sucks and is unusable ? If that’s true, then we don’t make it the default. I want défaut to be the most useful one.

I want loads more concrete code usage examples so I can see what value you provide to me. I don’t know Infinispan. I want lists of use cases and examples

The philosophy of these docs is not to be descriptive but to explain how someone do things.

PS I’m in meeting so apologies if things sound harsh or are just quick directions vs a detailed feedback

Copy link
Member

Choose a reason for hiding this comment

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

+1 right the "custom/more powerful/framework specific" file should have priority.

In Hibernate, you either use one or the other - strict exclusivity.

We'll track this as a separate improvement though, the docs to be merged soon & then we iterate on usability.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good re: config priority.

Also @emmanuelbernard talking over this more, I am planning on making proto stream the default marshaller and add the optional dependency as required. This will allow all the primitive wrappers, String, byte[], Date, Instant to be serialized with no config. And the user can add their own custom classes themselves.

property. You can either supply your own marshaller implementation or use the `ProtoStreamMarshaller` as described
in the user guide linked above.

The recommended approach is to use `ProtoStreamMarshaller` as this provides support for String,
Copy link
Member

Choose a reason for hiding this comment

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

So.. should we register this one by default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually didn't see this until after I wrote my previous comment, but that is what I am leaning towards now.

</dependency>
----

Note that you must exclude `jboss-logging` as this module is currently not supported with shamrock.
Copy link
Member

Choose a reason for hiding this comment

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

s/shamrock/{project-name}/

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

== Security

The Infinispan Client comes already packed with features to allow for security. However to configure
these you may need to slightly tweak them to work within Shamrock.
Copy link
Member

Choose a reason for hiding this comment

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

is something missing here? I have no clue of what I would need doing :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Weird... I must have accidentally deleted this section.

and/or keystore. This is further detailed at
http://infinispan.org/docs/dev/user_guide/user_guide.html#hr_encryption.

The reason that Shamrock is different is that the Native does not come with security
Copy link
Member

Choose a reason for hiding this comment

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

s/the Native/ SubstrateVM ?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 Wasn't sure what naming we wanted here, disregarding the typo in grammar.

</goals>
<configuration>
<enableHttpUrlHandler>true</enableHttpUrlHandler>
<!-- next two are to enable security - If not needed it is recommended not to enable these-->
Copy link
Member

Choose a reason for hiding this comment

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

makes me think: should we autoamtically enable enableJni when enableAllSecurityServices is set? Or at least validate that the dependent is set?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was wondering the same thing, I am not sure who normally handles that.

</configuration>
</execution>
</executions>
/plugin>
Copy link
Member

Choose a reason for hiding this comment

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

There's a missing "<" before "/plugin>"

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

== Additional Features

The Infinispan Client has additional features that were not mentioned here. This means this
feature was not tested in a Shamrock environment and they may or may not work. Please let us
Copy link
Member

Choose a reason for hiding this comment

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

nice touch!

"}");
}
----
User Marshaller::
Copy link
Member

@galderz galderz Feb 7, 2019

Choose a reason for hiding this comment

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

I think the use of protostream could be improved. As it stands, the definition of a type is duplicated in 3 places: the java source file of the type, the proto file and the marshaller. Any changes to any requires modifying all 3. Instead, I find a better approach to annotate the type and let the proto file and marshaller be generated. I did this last year in the streaming data demos I did, e.g. see this train station and related types. Some of the fields are annotated with indexing stuff, but you can skip those for this example. You should try this out yourself.

Copy link
Member Author

Choose a reason for hiding this comment

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

They don't work with SubstrateVM as I was trying to mention at https://github.com/jbossas/protean-shamrock/pull/786/files#diff-656c2d72aa36b0cb773025ff8b46304aR191

This requires more changes from protostream. I was originally going to do something myself with Jandex, but Adrian wanted to fix it directly in protostream.

Copy link
Member

@emmanuelbernard emmanuelbernard Feb 7, 2019

Choose a reason for hiding this comment

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

When can we have it from adrien in a release and integrated in Protean?
If that’s more than 3 weeks, then we do it in the extension first and fix upstream later. We have applied this strategy in a few places like RESTEasy and Hibernate ORM

Copy link
Member Author

Choose a reason for hiding this comment

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

My guess is that 3 weeks is a bit too tight for Adrian to get the proto stream changes and add the changes to this extension. The Jandex/Gizmo version should be doable in < 2 weeks I would think. It is more learning how to use them

NOTE: Annotation based proto stream marshalling is not yet supported in
the shamrock infinispan client.

=== Providing your own Marshaller
Copy link
Member

Choose a reason for hiding this comment

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

Not sure I'd advertise this. Although there are some users for it and some domain-specific implementations can really do fast stuff by adding their own marshaller, I find they're a niche. Proto based marshalling is the best for end users since it paths the way to indexing+querying.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I originally had this section larger, but pared it down. I am fine removing from the documentation.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will take out this section when I change over to have the default proto stream marshaller.


== Querying

The Infinispan client supports both indexed and non indexed querying as long as the
Copy link
Member

Choose a reason for hiding this comment

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

Also: consider to not allow overriding the marshaller? What are the implications?

I've mentioned about this topic above. Overriding the marshaller is not something I'd expose to start with.

=== Authentication

This chart illustrates what mechanisms have been verified to be working properly with
the Shamrock Infinispan Client extension.
Copy link
Member

Choose a reason for hiding this comment

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

shamrock

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@wburns
Copy link
Member Author

wburns commented Feb 7, 2019

I have changed the comments I could and created the following issues to handle the bigger issues with setup.

#798
#800

@Sanne
Copy link
Member

Sanne commented Feb 7, 2019

Added #802

@Sanne
Copy link
Member

Sanne commented Feb 7, 2019

Added also: #804

@Sanne
Copy link
Member

Sanne commented Feb 7, 2019

aand #805 :)

@Sanne Sanne merged commit 37da5c6 into quarkusio:master Feb 7, 2019
@Sanne Sanne deleted the infinispan-client-docs branch February 7, 2019 18:36
@gsmet gsmet added this to the 0.9.0 milestone Feb 11, 2019
maxandersen pushed a commit to maxandersen/quarkus that referenced this pull request Nov 5, 2022
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.

5 participants