Giter Site home page Giter Site logo

Comments (4)

gousiosg avatar gousiosg commented on August 17, 2024

Could you please explain how / why the problems you describe will be solved with Spring?

from fasten.

marcomicera avatar marcomicera commented on August 17, 2024

Could you please explain how / why the problems you describe will be solved with Spring?

Sure, sorry for my brevity.

  1. First things first: the Spring DI. Spring has some dedicated annotations like @Autowired and @Service that already allowed me to have a fully-functional CDI system. This simplifies unit testing a lot #87.
  2. I already noticed that this Spring version of the REST API doesn't suffer from most of the timeouts we had before. I think this is due to Spring's embedded Tomcat Servlet container. I didn't manage to find out why Jetty caused timeouts, so a very dumb solution would be to just get rid of it.
  3. For concurrency, I think this is going to be handled by Spring & Tomcat. I didn't find any simple solution for Jetty rather than spawning threads manually #93 (comment). I think this could be achieved with a simple server.tomcat.max-threads=400 with the Spring's embedded Tomcat. There seem to be lots of other tweaks as well for Spring.

from fasten.

marcomicera avatar marcomicera commented on August 17, 2024

@ilyagrishkov @MihhailSokolov do I have to keep Main.java and RestAPIPlugin.java that implements the PF4J Plugin interface and DBConnector?
It's a bit complicated to launch Spring through such classes.

I'd just use:

@SpringBootApplication
public class RestApplication {

    public static void main(String[] args) {
        SpringApplication.run(RestApplication.class, args);
    }
}

With a Spring @Component that connects to the KnowledgeBase at the beginning:

@Component
public class KnowledgeBaseConnector {

    @PostConstruct
    public void connectToKnowledgeBase() { /* ... */ }
}

So instead of launching it with mvn exec:java it would be: mvn spring-boot:run.
So technically, not a PF4J plugin anymore: is it ok?

from fasten.

marcomicera avatar marcomicera commented on August 17, 2024

Done in #123.

from fasten.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.