This is a simple Spring Boot app that’s wrapped up into a Func Bundle

To build a Funcatron deployable JAR file, type:

mvn clean package

The compiled JAR file can be found at target/java_spring_sample-0.1-SNAPSHOT.jar.

To upload the build to your Funcatron cluster running on Mesos:

wget -O - --post-file=target/java_spring_sample-0.1-SNAPSHOT.jar \

This is the command to upload to a Mesos or Kubernetes cluster. This is NOT the command to associate your development-time code with “devmode” or “devshim”. To use “devmode” or “devshim”, you have to use Register.register(…​) to connect to a “devmode”

What do you have to do to wrap a Spring Boot app?

  1. Make sure you annotate you Application class with @EnableSwagger2.

  2. Include a file like that tell Funcatron where to find things.

  3. Include a file like that mocks the HTTP server

  4. Include the following in your Maven file:


That’s about it. Funcatron should find and dispatch requests properly with this information.

So…​ here’s how to run the app with the devshim

What’s “devshim”? It’s the development-time connection between your running app (which can be running in your IDE and have breakpoints) and a very slimmed down Funcatron HTTP front-end. Doing super-fast turn-around (compile and go or even live development) is simple with “devshim”.

You have to do two things…​ fire up a “devmode” version of Funcatron and Register your app with the local, not clustered, version of Funcation.

Add this to your Spring Boot app…​ you start the Spring Boot app normally, then create a Funcatron “Context”, get the Swagger information, and then Register with the “devmode” Funcatron instance.

 * Just a plain old Spring app... but make sure you include the {@code @EnableSwagger2}
 * annotation to hook up SpringFox and generate Swagger
public class Application {

    public static void main(String[] args) throws Exception {
        SpringApplication sa = new SpringApplication(Application.class);;

        // Now that we've got the app running... start the whole funcatron stuff
        ContextImpl.initContext(new HashMap<>(),

        // Using SpringFox, get the Swagger
        Map swagger = ContextImpl.runOperation(Constants.GetSwaggerConst,
                new HashMap<>(),
                Logger.getAnonymousLogger(), Map.class);

        // write it to a temp file
        File tmpFile = File.createTempFile("funcatron_swagger_", ".txt");
        FileOutputStream fos = new FileOutputStream(tmpFile);

        // delete the temp file on exit

        // register with the devshim

Next, fire up a “devmode” Funcatron instance with:

docker run -ti --rm  -e TRON_1=--devmode -p 3001:3001 -p 54657:54657 funcatron/tron:latest

When you run your app and call the Register.register(…​) method, your app will connect to the Funcatron instance and you’ll be able to make http requests on http://localhost:3001/. Those requests will be forwarded to your app. If you run your app in debug mode in your IDE, you can set breakpoints in your running app and see what’s going on.