How to use an extension libraries' classes only and with our own custom service extension. #4700
-
An extension in connector contains a service implementation and a service extension which registers the service implementation. Let's take an example of this extension jetty-core.
Now assume, I want to use this extension in tractusx-edc, but I want to instantiate JettyService in a different way (e.g I want to pass a customJettyConfiguration). So now I have two questions
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
there is no way to achieve that. Usually |
Beta Was this translation helpful? Give feedback.
-
Thanks @wolf4ood for quick answer, that sounds good. |
Beta Was this translation helpful? Give feedback.
-
just to add an answer to the 2nd question: there is no explicit way to achieve deterministic ordering. the best way would be to inject a service from the extension that should be initialized first. Personally, I am against such exclusion list "features" because it will a) only serve a very small user base, b) complicate extension loading (and its testing!) further and c) goes a bit against the principles of such core extensions. We could possibly look at refactoring this into a |
Beta Was this translation helpful? Give feedback.
-
Thanks @paullatzelsperger, that little hack might be helpful. And just to clarify, I provided just an example of |
Beta Was this translation helpful? Give feedback.
Hi @hemantxpatel
there is no way to achieve that. Usually
*-core
modules contains extensions with default behaviour and if you include those you will also get the services injected. For reusable stuff across extensions we create modules with*-lib
convention and they only exposes classes without extensions. In this case to achieve that a refactor is needed in order to extract the required classes into ajetty-lib
module.