Giter Club home page Giter Club logo

actionloop-quarkus's Introduction

ActionLoop Implementation for Quarkus

This is an OpenWhisk ActionLoop implementation for Quarkus. It implements a container that bundles Quarkus 1.4.2 libraries and allows easy deployment of Quarkus applications for OpenWhisk. Some notes:

  • The Quarkus application is using Command Mode - not a standard http Quarkus application (lower overhead, memory usage, and faster startup time)
  • Jackson is the JSON helper lib utilized

This is currently BETA software!

To get started:

cd quarkus

mvn package

ibmcloud fn action create QCLITest1 target/quarkus-openwhisk-action-1.0.0-SNAPSHOT-runner.jar --docker actionloop-quarkus-1.4.2:latest

ibmcloud fn action invoke QCLITest1 --result

To update or build the base container

cd quarkus

Update the pom.xml to add your libs:

mvn package

Edit the Makefile with your Docker prefix & image name

make push

Test locally

make start

make test-bin-zip

Creating your own project from the template Quarkus project

Again, this project uses Quarkus Command Mode. Go into
quarkus/src/main/java/org/openwhisk/sample/GreetingMain.java to see an example.

You can use another class for your application, just go to: OWQuarkusActionLoop.java and inject in your class - it should have a method with the following signature and return a ObjectNode or JsonNode:

public JsonNode run(JsonNode rootNode) throws Exception {
    String name = rootNode.at("/message").asText();
    ObjectNode response = JsonNodeFactory.instance.objectNode();
    response.put("greeting", "GreetingMain: " + service.greeting(name));
    return response;
}

Remember to do a mvn package to update the JAR file when you get ready to deploy into OpenWhisk!

actionloop-quarkus's People

Contributors

prpatel avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.