Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [flux-dev] Headless JDT in Spring application?

Hey Yoann,


> I want to build a cloud service with Spring and connect it to Flux.

That alone is definitely not very complicated, since cloud services in Flux are extremely decoupled from each other. Basically all you need is a connection to the messaging bus and you are ready to go.

Of course your service would have to understand those messages (and probably react to them in a meaningful way), but that is part of the job of a cloud service in Flux.
And since Flux doesn’t requite a specific language or environment for cloud services, you can use whatever technology and language you prefer, including Java and Spring, of course.


> I would like to leverage JDT as part of this service (for the incremental compiler, AST, java model, etc.). You already have created a headless version of JDT (or.eclipse.flux.jdt.service) so it seems feasible. However I am not familiar with OSGi and I'm a little bit confused about how I can use JDT in the context of a Spring application. 
> 
> Can I simply add JDT jars as dependencies of my Spring app? I don't think so. Am I missing something? What would you recommend?

Hmm… JDT in the way that we are using it at the moment (for the headless JDT service) is running as a set of OSGi components and requires an OSGi runtime to do so - and it is not that hard to get that working. This is what we have done for the headless JDT service.

Combining that with Spring sounds a lot more complicated, since you would have to use Spring in an OSGi environment, which is not that trivial. It is possible, but it is far from trivial as far as I remember. And it depends a bit on how you would like to use Spring. If you would like to use Spring inside a single OSGi component, embedding everything (all the necessary Spring JARs) into the OSGi bundle that is using that could work, but that would end up being a big chunk of coupled code in the end.


> I think it's fair to say that JDT will be very important to build Java cloud services. It would therefore be nice to make it really easy to reuse.

Flux doesn’t prefer any specific library or component for building language services that are running in the cloud. The Java service that we built is re-using JDT, but theoretically you should also be able to use any other library, depending on that you would like to build.

Maybe sharing some more details about the “why” would shed some light on your problem and help people on this list to provide more guidance.

HTH,
Martin




Back to the top