Giter Club home page Giter Club logo

vertx-spring's People

Contributors

tkrullmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vertx-spring's Issues

Improve documentation for Vertx-managed HA verticles

HA verticles (with multiple instances) need to be instantiated by Vert.x using prototype beans; these cannot use the DeployableVerticle interface because the deployment information must be available without instantiating them. (See #2)
This should be made clearer in the documentation.

DeployableVerticle and multiple instances ...

I've been playing around a bit with this library for integrating Spring and Vertx, and its been a great help, and pretty seamlessly integrates the two.

I'm having on issue I've been messing around with for a bit of time, and haven't figured out. I'm starting to think there isn't a way to do it...

I'm trying to have a code-defined set of deployment options via the DeployableVerticle interface. Although the docs don't say so, as far as I can tell that isn't supported with auto-registered Verticles, they have to be manual. That's fine. However, if I use a @bean annotation on a getMyVerticle() call, DeployableVerticle isn't used. I can put a @VerticleDeployment(instances=4) and get four instances as long as I use @scope("prototype"). To get DeployableVerticle to work, I need to use a VerticleRegistrationBean, but the @scope there gets picked up by Spring for that bean, not the MyVerticle bean created inside of it, so DeployableVerticle is used to configure the deployment, but I can't actually set instances > 1 I get this error:

org.springframework.context.ApplicationContextException: Failed to start bean 'vertx'; nested exception is java.lang.IllegalArgumentException: Can't specify > 1 instances for already created verticle

So is there some "magic" that I'm missing that can get that working together? My specific goal for this is this, however I'm sure it'll come up for other use cases:

@Override public DeploymentOptions getDeploymentOptions() { return new DeploymentOptions() .setHa(true) // highly available .setInstances(Runtime.getRuntime().availableProcessors()) // one instance per CPU ; }

Basically setting the instances at runtime to the number of available cores.

Any tips/suggestions?

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.