unbroken-dome / vertx-spring Goto Github PK
View Code? Open in Web Editor NEWVert.x Spring Tools
License: MIT License
Vert.x Spring Tools
License: MIT License
Is maven repository exist for 'org.unbroken-dome.vertx-spring:vertx-spring?
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.