Necessary basic work in production

We have a requirement when we need to start many async background processes that access the database, Kafka queues, etc. Right now we are using the Spring package with Tomcat (exploded WAR) for the same. However, we encounter some problems that I cannot solve with Spring Batch. I was thinking of other frameworks to use, but could not find any that solves all my problems.

It would be great to know if there is a structure that solves the following problems:

  • Since the Spring Package runs inside the same Tomcat container (1 java process), any small update in any task / step will restart the Tomcat server. This leads to a hard stop of all running tasks, which leads to incomplete / outdated data.

WHAT I WANT: Combine all the banks and start each work as a separate process. The structure must store the PID and must be able to manage (stop / force kill) work on demand. Thus, when we want to update the JAR, the existing process will not be difficult (however, we should be able to stop the existing process from the user interface), and no other work (working or not) will also be affected.

I looked at the hot-update JARs in Tomcat, but I am skeptical about using such a mechanism in production.

Subprocess: will OSGI integrate with Spring Batch? If so, is it possible to run each task as a separate container with all the JARs built into it?

  1. Spring Package does not have master-slave architecture.

: , . (), . , (, , ), . (// , ..), .

, , , , .

  1. Spring / .

: . -, (, ) , .

+4
1

, vertx .

Spring Tomcat (1 java-), / Tomcat. , / .

Vertx . vertx . , - ( , , , )

Vert.x is not an application server. 
There no monolithic Vert.x instance into which you deploy applications. 
You just run your apps wherever you want to.

Spring -

vertx , . , HTTP- vertx .

Spring / .

vertx - .

Sending with timeouts
When sending a message with a reply handler you can specify a timeout in the DeliveryOptions.
If a reply is not received within that time, the reply handler will be called with a failure.
The default timeout is 30 seconds.

Send Failures
Message sends can fail for other reasons, including:
There are no handlers available to send the message to
The recipient has explicitly failed the message using fail
In all cases the reply handler will be called with the specific failure.

java. Dropwizard , .

+4

Source: https://habr.com/ru/post/1617568/


All Articles