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

[Architecture Board] recommendations and consideration for OSGi interoperability #33

Closed
rotty3000 opened this issue Jun 14, 2018 · 27 comments
Labels
Architecture board Issues across more MP specifications

Comments

@rotty3000
Copy link

I know that there is a degree of interest in the MicroProfile community with respect to ensuring OSGi interoperability. I wanted to bring this to attention so that the Architecture Board might clarify the how's and why's of this such that no MP component is implemented in such a way that this becomes a problem for vendors in either direction (by non-OSGi community members equally with OSGi community members)

There are several good recommendations to be made which would both completely satisfy OSGi interop while having zero cost for non-OSGi applications and I would really like if this discussion took place and perhaps a few of these recommendations formalized into Architecture Board recommendations.

Thank you for your consideration.

@smillidge
Copy link

A number of MicroProfile implementations have a foundation on OSGI e.g. Payara Server so +1 for ensuring OSGI interoperability.

@rmannibucau
Copy link

+1

@rinswind
Copy link

rinswind commented Jun 15, 2018

+1 for Software AG

We use OSGi as the basis for a number of our products. We'd like to offer MicroProfile to our customers. We're interested in MicroProfile implementations that are fully deployable as peer bundles to the rest of our OSGi infrastructure.

In fact is very desirable that MicroProfile implementations are built on top of the respective standard OSGi services. E.g. JAX-RS whiteboard, HTTP whiteboard, CDI integration, ServiceLoader mediator, ConfigurationAdmin, etc. In this way other OSGi components bound to the standards can enrich MicroProfile runtimes.

@struberg
Copy link

+1 for being OSGi friendly.

ofc -1 for a mandatory OSGi requirement if that would ever come up ;)

@tjwatson
Copy link
Member

There are several good recommendations to be made which would both completely satisfy OSGi interop while having zero cost for non-OSGi applications and I would really like if this discussion took place and perhaps a few of these recommendations formalized into Architecture Board recommendations.

Do you have examples of the good recommendations? Is there an existing document we should reference that explains the challenges for such interop?

@rotty3000
Copy link
Author

Do you have examples of the good recommendations? Is there an existing document we should reference that explains the challenges for such interop?

Hey @tjwatson, I'd expect you know which I was referring to:

  1. Where semantic versioning can't be applied, use Portable Java Contracts [1] (avoids nasty arbitrary package version imports)
  2. Where the use of ServiceLoader is prescribed, limit the use to ServiceLoader.load(Class) and provide metadata prescribed by the OSGi Service Loader Mediator specification [2].

[1] https://www.osgi.org/portable-java-contract-definitions/
[2] https://osgi.org/specification/osgi.cmpn/7.0.0/service.loader.html

@rotty3000
Copy link
Author

rotty3000 commented Jun 19, 2018

Just to be clear, what I'm mostly talking about is adding OSGi metadata to the API jars.

  • proper package imports that handle Java EE API (CDI, Inject, Common Annotations, etc.) references gracefully (i.e. Portable Java Contracts)
  • use the ServiceLoader in such a way that it's safe for use in both Java Modules AND in OSGi bundles (i.e. Service Loader Mediator)
  • avoid static methods in the API who's pretense is to support OSGi

@OndroMih OndroMih added the Architecture board Issues across more MP specifications label Jul 12, 2018
rotty3000 added a commit to rotty3000/microprofile-config that referenced this issue Aug 21, 2018
rotty3000 added a commit to rotty3000/microprofile-config that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-config that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-fault-tolerance that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-jwt-auth that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-opentracing that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-health that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-opentracing that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-jwt-auth that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-config that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-metrics that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-open-api that referenced this issue Aug 30, 2018
rotty3000 added a commit to rotty3000/microprofile-opentracing that referenced this issue Aug 30, 2018
@rotty3000
Copy link
Author

As you may have observed I've sent a PR to each of the projects with the necessary changes.

As you can see there is not much to it. I am willing to provide support for these details going forward to all projects as they evolve.

rotty3000 added a commit to rotty3000/microprofile-health that referenced this issue Sep 4, 2018
@rotty3000
Copy link
Author

rotty3000 commented Sep 6, 2018 via email

@rotty3000
Copy link
Author

furthermore, I will update the PRs to reflect this shortly.

@kaikreuzer
Copy link
Member

@rotty3000 Please note that #84 actually conflicts with eclipse/microprofile-metrics#286, so it would be nice if you could take that change also into account.

@rotty3000
Copy link
Author

rotty3000 commented Sep 7, 2018 via email

rotty3000 added a commit to rotty3000/microprofile-config that referenced this issue Sep 8, 2018
rotty3000 added a commit to rotty3000/microprofile-fault-tolerance that referenced this issue Sep 8, 2018
rotty3000 added a commit to rotty3000/microprofile-health that referenced this issue Sep 8, 2018
rotty3000 added a commit to rotty3000/microprofile-metrics that referenced this issue Sep 8, 2018
rotty3000 added a commit to rotty3000/microprofile-jwt-auth that referenced this issue Sep 8, 2018
rotty3000 added a commit to rotty3000/microprofile-open-api that referenced this issue Sep 8, 2018
rotty3000 added a commit to rotty3000/microprofile-opentracing that referenced this issue Sep 8, 2018
@rotty3000
Copy link
Author

rotty3000 commented Sep 8, 2018

All the updates are done. I think this is what we'd hope to be the final proposal.

I've struck the limited use of ServiceLoader.load(Class<?>) from the proposal because the OSGi EEG decided that we can solve the issue ourselves avoiding code changes to be needed.

@rotty3000
Copy link
Author

To summarize, the proposal is now:

  • use Portable Java Contracts for packages (imports) that are not semantically versioned (CDI, Inject, Common Annotations, JAX-RS, etc.)
  • apply Service Loader Mediator metadata where ServiceLoader is used

@kenfinnigan
Copy link

Closing as "won't do"

@OndroMih
Copy link
Contributor

Worth noting this was decided in the MP Architecture hangout on 26th March 2019: https://docs.google.com/document/d/1uAKRymdAL5Wj1KADzrYKZzSnAFsq74lBfj8lxKQnI6I/edit#

@rinswind
Copy link

@OndroMih the document you reference does not give an explanation why proper OSGi metadata won't be supported.
@kenfinnigan Can you provide details?

@kaikreuzer
Copy link
Member

I'd be interested in that as well. After the many +1s on this issue and the constructive discussion, it is a bit weird to see the issue closed as "won't do" without any further explanation.

@pilhuhn
Copy link
Contributor

pilhuhn commented Mar 27, 2019

I agree with @kaikreuzer and @rinswind about providing details of the decision (note: I am not questioning the decision itself).

Can we, as followup, now close the linked per-spec issues?

@Emily-Jiang
Copy link
Member

Look at the dependency requirement introduced by some PRs such as in Config repo:
Require-Capability:
osgi.contract;
osgi.contract=JavaCDI;
filter:="(&(osgi.contract=JavaCDI)(version=${cdi.api.version}))",\

In Java EE, there is no CDI bundle to provide this capability. With this change, the config bundle will not be able to resolve unless the runtime consumes some OSGi bundles with the JavaCDI capability provided by non-Java EE ecosystem. This restricts the implementation to depend on a particular technology.
In MicroProfile, we focus on what we can provide for end users and leave a lot of freedom for implementations.

@pilhuhn
Copy link
Contributor

pilhuhn commented Mar 27, 2019

Thank you @Emily-Jiang

@rotty3000
Copy link
Author

I'm sad I missed the architecture discussion for this. I could have offered a solution that would have solved Emily's concerns while getting OSGi its cake.

Thanks for entertaining it at least.

@kaikreuzer
Copy link
Member

I'm sad I missed the architecture discussion for this.

I would have expected that such discussions happen publicly here on the issue as that would be much more in line with the Eclipse principles.

@rotty3000
Copy link
Author

I actually brought up this concern previously [1] where I suspected that decisions were being taken during hangouts rather than publicly over lists.

[1] https://groups.google.com/d/msg/microprofile/eCFXGJ_fpac/pxXIA_WtAAAJ

@rinswind
Copy link

@Emily-Jiang @rotty3000 So the issue as I understand it is that you can't get an official CDI API packaged as a bundle that provides that contract capability?

@rotty3000
Copy link
Author

@rinswind pretty much! A fragment would do it...

Emily-Jiang added a commit to eclipse/microprofile-config that referenced this issue Jun 2, 2020
@Emily-Jiang Emily-Jiang modified the milestone: MicroProfile 4.0 Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture board Issues across more MP specifications
Projects
None yet
Development

No branches or pull requests