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

4.x: programmatically control media providers with Nima WebServer #6278

Closed
barchetta opened this issue Feb 23, 2023 · 2 comments · Fixed by #6412
Closed

4.x: programmatically control media providers with Nima WebServer #6278

barchetta opened this issue Feb 23, 2023 · 2 comments · Fixed by #6412
Assignees
Labels
4.x Version 4.x media-support Media type processing in SE Níma Helidon Níma P3
Projects
Milestone

Comments

@barchetta
Copy link
Member

While working on migrating the Bookstore test application to Nima WebServer I ran into a gap (or maybe it is ignorance on my part).

In 3.x I can add specific media support programmatically:

webserverBuilder.addMediaSupport(JsonpSupport.create());

I can't find a way to do that with Nima WebServer. Maybe I'm missing something but it seems to rely only on service loading of MediaSupportProviders.

Note that this is different than Features which have useSystemServices() to turn on/off auto loading of services and there are ways to programmatically add a feature using addFeature.

@barchetta barchetta added media-support Media type processing in SE 4.x Version 4.x Níma Helidon Níma labels Feb 23, 2023
@github-actions github-actions bot added this to Triage in Backlog Feb 23, 2023
@m0mus m0mus added the P3 label Mar 2, 2023
@m0mus m0mus moved this from Triage to Normal priority in Backlog Mar 2, 2023
@m0mus m0mus added this to the 4.0.0-M1 milestone Mar 2, 2023
@Tomas-Kraus Tomas-Kraus self-assigned this Mar 13, 2023
@Tomas-Kraus
Copy link
Member

I'll have a look at this one.

@Tomas-Kraus
Copy link
Member

Tomas-Kraus commented Mar 14, 2023

Looks like you are right. MediaContextImpl in nima builds media providers using service loader. There is also a way to set your own MediaContext using WebServer builder, but you have to write it yourself.
Also MediaContext in nima and MediaContext in reactive are disjunct classes, they have no common ancestor.
The same with MediaSupport (reactive) vs. MediaSupportProvider (nima/media).

So we have two separate worlds. Fortunately there is a direct conenction between MediaSupport and MediaSupportProvider and looks like I can just add some builder method to manually register MediaSupportProvider during the build process.
But builder API won't be identical to reactive server builder. I'll use the same pattern that I made for content encoders and which was already reviewed and approved for nima.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x media-support Media type processing in SE Níma Helidon Níma P3
Projects
Backlog
  
Closed
Development

Successfully merging a pull request may close this issue.

4 participants