-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
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.
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. |
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.
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 ;)
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.
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 |
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 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.
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.
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.
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.
+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 |
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.
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 ;)
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 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.
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.
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.
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
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.
+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.
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.
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, |
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.
So.. should we register this one by default?
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.
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. |
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.
s/shamrock/{project-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.
👍
== 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. |
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 something missing here? I have no clue of what I would need doing :)
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.
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 |
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.
s/the Native/ SubstrateVM ?
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.
👍 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--> |
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.
makes me think: should we autoamtically enable enableJni when enableAllSecurityServices is set? Or at least validate that the dependent is set?
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 was wondering the same thing, I am not sure who normally handles that.
</configuration> | ||
</execution> | ||
</executions> | ||
/plugin> |
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.
There's a missing "<" before "/plugin>"
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.
👍
== 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 |
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.
nice touch!
"}"); | ||
} | ||
---- | ||
User Marshaller:: |
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 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.
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.
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.
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.
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
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.
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 |
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.
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.
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.
Yeah I originally had this section larger, but pared it down. I am fine removing from the 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.
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 |
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: 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. |
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.
shamrock
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 #802 |
Added also: #804 |
aand #805 :) |
This contains 2 issues:
The second one shouldn't be needed if #663 is integrated first.