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

PAYARA-223 hazelcast eclipselink cache coordination #2666

Conversation

svendiedrichsen
Copy link
Contributor

@svendiedrichsen svendiedrichsen commented Apr 24, 2018

@smillidge @OndrejM
I have created a first implementation of a HazelcastPublishingTransportManager as @OndrejM suggested in #165. It can be used with Payara 5 Micro which I have started twice using the test app.

I have only manually tested the solution using https://github.com/svendiedrichsen/persistence.git

There are three requests to use for querying by id, creating and updating:

  1. curl http://localhost:8080/persistence/resources/items/1
  2. curl -i -X POST http://localhost:8080/persistence/resources/items/SOME-CONTENT
  3. curl -i -X PUT http://localhost:8080/persistence/resources/items/1/SOME-NEWER-CONTENT

Please review and advise:

  • how to intograte the new module into the full server edition
  • how to create integration tests
  • and surely anything that doesn't work properly because I have no experience in coding for Payara

fixes #165

@lprimak lprimak self-requested a review April 25, 2018 04:42
@lprimak
Copy link
Contributor

lprimak commented Apr 25, 2018

Since I am writing a blog and have experience in 2nd level EclipseLink cache coordination, I will take that on, very timely

@lprimak
Copy link
Contributor

lprimak commented Apr 25, 2018

jenkins test

@lprimak lprimak self-assigned this Apr 25, 2018
@lprimak lprimak added Type: Enhancement Label issue as an enhancement request community-contribution labels Apr 25, 2018
@svendiedrichsen
Copy link
Contributor Author

@lprimak That's very good. Looking forward to reading the cache integration blog and examples.

Cheers
Sven

@lprimak
Copy link
Contributor

lprimak commented Apr 27, 2018

jenkins test

@svendiedrichsen
Copy link
Contributor Author

@lprimak May I push some improvements to the PR?
I have improved on handling of MessageReceivers when the Hazelcast container gets restarted. On restart the existing receivers will be reregistered.
BTW: On undeployment and deployment of an app using HZ coordination the receivers will be un- and reregistered again.

@lprimak
Copy link
Contributor

lprimak commented May 1, 2018

Yes, feel free to do whatever you need. We have some customer issues to deal with this week and next anyway so please make this as good as it can be

@svendiedrichsen
Copy link
Contributor Author

I will do some additional manual testing on Payara Full to make sure it works as expected.

@smillidge
Copy link
Contributor

jenkins test

@payara-ci
Copy link
Contributor

Quick build and test passed!

@svendiedrichsen
Copy link
Contributor Author

svendiedrichsen commented May 3, 2018

@smillidge @lprimak I have successfully tested HZ cluster deregistration and registration with:

  • Application deactivation/activation
  • Application undeployment/deployment
  • Hazelcast Container deactivation/activation

Please let me know if there is anything around this PR I can be of help with.

@svendiedrichsen
Copy link
Contributor Author

svendiedrichsen commented May 7, 2018

@lprimak @smillidge Should I convert the usage of the stream API and Lambdas to backportable Loops and Interfaces? How about a backport to Payara 4?

@smillidge
Copy link
Contributor

We can support JDK 8 in 4 as this is a separate module by excluding it from JDK 7 builds.

@smillidge
Copy link
Contributor

@lprimak do you think you can get this reviewed before code freeze?

@smillidge
Copy link
Contributor

This is good to go from my perspective as Tech Preview for 5.x. I've built the branch and the reference to the dependency in the JPA packager is enough to get this into the Payara Server distribution.

@lprimak
Copy link
Contributor

lprimak commented May 17, 2018

Yea I can review by the end of the wekeend

@svendiedrichsen
Copy link
Contributor Author

I have granted @lprimak and @smillidge push access to the branch repo in case anything needs to be pushed while I'm on vacation next week. I'll be checking sporadically if I can help anyhow.

@lprimak
Copy link
Contributor

lprimak commented May 18, 2018

Great, I should be able to get started in the next few days

@arjantijms arjantijms dismissed smillidge’s stale review May 23, 2018 09:07

change request was on header line

@arjantijms arjantijms self-requested a review May 23, 2018 09:08
Copy link
Contributor

@arjantijms arjantijms left a comment

Choose a reason for hiding this comment

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

Haven't done a deep look at all the intricate details, but a glance is seems to be okay, certainly for tech preview.

@arjantijms arjantijms merged commit 1294bd5 into payara:master May 23, 2018
@svendiedrichsen svendiedrichsen deleted the hazelcast-eclipselink-cache-coordination branch May 23, 2018 09:40
@lprimak
Copy link
Contributor

lprimak commented Jun 13, 2018

@svendiedrichsen I am trying to write the blog about how to use cache coordination, and have a question:

Do you have a simple example on how to use your PR?

or a simple blurb about how to use it?

@svendiedrichsen
Copy link
Contributor Author

svendiedrichsen commented Jun 13, 2018

@lprimak I have a little example project which uses HZ cache coordination under https://github.com/svendiedrichsen/persistence.

In essence you use HZ cache coordination by configuring it in your projects persistence.xml as a protocol implementation class:

<property name="eclipselink.cache.coordination.protocol"
value="fish.payara.persistence.eclipselink.cache.coordination.HazelcastPublishingTransportManager"/>

This will direct Eclipselink to the HZ TransportManager and lead it to instantiate and let it use it. Furthermore you can configure the name of the channel with which Eclipselink will communicate cache changes using a HZ topic of this name. Thus you can partition the communication between different PersistenceUnits:

<property name="eclipselink.cache.coordination.channel" value="<topic name>" />

Does that help in any way?

@lprimak
Copy link
Contributor

lprimak commented Jun 13, 2018

Perfect, thanks!

@svendiedrichsen
Copy link
Contributor Author

svendiedrichsen commented Jun 24, 2018

@smillidge @lprimak Shouldn't this feature be mentioned in the documentation? Maybe somewhere with the public API. https://docs.payara.fish/documentation/payara-server/public-api/
Or added to the Using Hazelcast section https://docs.payara.fish/documentation/payara-server/hazelcast/using-hazelcast.html
Just in case someone doesn't bother to read the blog.

@lprimak
Copy link
Contributor

lprimak commented Jun 25, 2018

It’s in progress. Hasn’t hit the main branch yet

@lprimak
Copy link
Contributor

lprimak commented Jun 29, 2018

@svendiedrichsen
Copy link
Contributor Author

Looks very nice. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: CLA CLA submitted on PR by the contributor Type: Enhancement Label issue as an enhancement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build EclipseLink Cache Interceptor for Hazelcast
6 participants