All Projects → hammock-project → Hammock

hammock-project / Hammock

Licence: apache-2.0
CDI Based Microservices

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Hammock

Microservice Patterns
Code to share the knowledge I gained while designing and implementing micro services
Stars: ✭ 87 (-13%)
Mutual labels:  microservices
Dockerfiles
Base Dockerfiles && Amazing Dockerfiles && Microservices Dockerfiles
Stars: ✭ 94 (-6%)
Mutual labels:  microservices
Engineering Blog
📝 We write about our technologies and the problems we handle at scale.
Stars: ✭ 99 (-1%)
Mutual labels:  microservices
Gameon Java Microservices On Kubernetes
This code demonstrates deployment of a Microservices based application Game On! on to Kubernetes cluster. Game On! is a throwback text-based adventure built to help you explore microservice architectures and related concepts.
Stars: ✭ 88 (-12%)
Mutual labels:  microservices
Micromanage
A Micro-services Helpers Framework | Easily manage multiple repositories and projects
Stars: ✭ 93 (-7%)
Mutual labels:  microservices
Api2html
Using the data from your API, generate the HTML on the fly! Server-side rendering of the mustache templates
Stars: ✭ 97 (-3%)
Mutual labels:  microservices
Spring Cloud Cloudfoundry
Integration between Cloudfoundry and the Spring Cloud APIs
Stars: ✭ 83 (-17%)
Mutual labels:  microservices
Quiz
Example real time quiz application with .NET Core, React, DDD, Event Sourcing, Docker and built-in infrastructure for CI/CD with k8s, jenkins and helm
Stars: ✭ 100 (+0%)
Mutual labels:  microservices
My Cheat Sheets
A place to keep all my cheat sheets for the complete development of ASIC/FPGA hardware or a software app/service.
Stars: ✭ 94 (-6%)
Mutual labels:  microservices
Django Th
🐍 Trigger Happy - The bus 🚌 for your internet services
Stars: ✭ 1,356 (+1256%)
Mutual labels:  microservices
Dotnetcore Microservices Poc
Very simplified insurance sales system made in a microservices architecture using .NET Core
Stars: ✭ 1,304 (+1204%)
Mutual labels:  microservices
Resilient Java Microservices With Istio
In this code we demonstrate how to build, deploy, connect resilient Java microservices leveraging Istio service mesh. We show how to configure and use circuit breakers, timeouts/retries, rate limits and other advanced resiliency features from Istio without changing the application code.
Stars: ✭ 92 (-8%)
Mutual labels:  microservices
Microwork
Microwork - simple creation of distributed scalable microservices in node.js with RabbitMQ
Stars: ✭ 97 (-3%)
Mutual labels:  microservices
Microservices Architecture Guidelines
Designing a Microservices Architecture
Stars: ✭ 86 (-14%)
Mutual labels:  microservices
Porcupine
Threading, Resiliency and Monitoring for Java EE 7/8
Stars: ✭ 99 (-1%)
Mutual labels:  microservices
Rabbus
A tiny wrapper over amqp exchanges and queues 🚌 ✨
Stars: ✭ 86 (-14%)
Mutual labels:  microservices
Grpcjsontranscoder
A filter which allows a RESTful JSON API client to send requests to .NET web server over HTTP and get proxied to a gRPC service
Stars: ✭ 97 (-3%)
Mutual labels:  microservices
Dingo
Data access in Go - Code Generator
Stars: ✭ 100 (+0%)
Mutual labels:  microservices
Cadence Python
Python framework for Cadence Workflow Service
Stars: ✭ 100 (+0%)
Mutual labels:  microservices
Kubernetes Ingress Controller
🦍 Kong for Kubernetes: the official Ingress Controller for Kubernetes.
Stars: ✭ 1,347 (+1247%)
Mutual labels:  microservices

Hammock

Gitter chat Build Status Maven Central

Hammock

Building Microservices so easily you're laying in a Hammock!

Hammock is a simple to use framework for bootstrapping CDI, launching a web server and being able to deploy REST APIs. It takes a best practice approach to creating a runtime for you, so that you can focus on the important stuff.

Read through some of the basics to get started, or view the wiki

Getting Started

First, add some dependencies to your project. Easiest way to start is with a Micrprofile Distribution - Standard or Cochise

Using Maven

Containers bring in transitive dependencies to bring up your runtime.

Using Undertow, Weld, Apache Johnzon, CXF

<dependency>
    <groupId>ws.ament.hammock</groupId>
    <artifactId>dist-microprofile</artifactId>
    <version>2.1</version>
</dependency>

Using Apache Tomcat, OpenWebBeans, Johnzon, CXF

<dependency>
    <groupId>ws.ament.hammock</groupId>
    <artifactId>dist-microprofile-cochise</artifactId>
    <version>2.1</version>
</dependency>

Launching your first app

Now that you have your dependencies in order, you can launch your first app.

Using Hammock's Bootstrap

Hammock has a bootstrap class, ws.ament.hammock.Bootstrap which will start CDI for you. It uses implementations of Bootstrapper to start the appropriate container.

Using Your Container's Bootstrap

You can also bootstrap your container directly. Since Hammock is implemented as a suite of CDI components, no extra work is required.

Use your own Bootstrap

You may want your own bootstrap, to do some pre-flight checks. Just make sure you either initialize Hammock or Weld when you're done. Your main might look as simple as

public class CustomBootstrapper implements Bootstrapper {

    public void start() {
        new PreflightChecks().verify();
        new Weld().initialize();
    }

    public void stop() { }
}

Make sure you add this to the ServiceLoader

Executable JARs

You'll likely want to create an executable JAR. Just shade in all dependencies using your favorite build tool, and set the main class to your choice of main class. I recommend using Capsule

Configuration

Configuration is provided via Apache DeltaSpike. The default configuration uses port 8080 for your webserver and /tmp for your static file directory. You'll likely want to configure those for your project.

Security

Basic security support is available. Two CDI interceptors are in use, one for verifying a user is logged in and another for verifying roles. To make use of security, you'll need to implement the Identity interface and make it a bean to represent the user currently be acted upon, usually of RequestScope.

  • @LoggedIn annotate a class or method, and an interceptor will check that the user is logged in for this method invocation.
  • @HasAllRoles() annotate a class or method, and an interceptor will check that the current identity has all of the roles defined.

To add the security runtime to your app, just include this dependency.

<dependency>
    <groupId>ws.ament.hammock</groupId>
    <artifactId>security-spi</artifactId>
    <version>2.1</version>
</dependency>

Issue Tracking

Have a feature request? Or found an issue? Please use github issues to let us know!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].