All Projects โ†’ MarioAriasC โ†’ Lagomkotlin

MarioAriasC / Lagomkotlin

Licence: apache-2.0
An example of Lightbend's Lagom project with Kotlin

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Lagomkotlin

Quickperf
QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
Stars: โœญ 231 (+1183.33%)
Mutual labels:  microservices, microservice
Ganesha
๐Ÿ˜ A Circuit Breaker pattern implementation for PHP applications.
Stars: โœญ 384 (+2033.33%)
Mutual labels:  microservices, microservice
Krakend Ce
KrakenD Community Edition. Make your binary of KrakenD API Gateway
Stars: โœญ 245 (+1261.11%)
Mutual labels:  microservices, microservice
Nxplorerjs Microservice Starter
Node JS , Typescript , Express based reactive microservice starter project for REST and GraphQL APIs
Stars: โœญ 193 (+972.22%)
Mutual labels:  microservices, microservice
Microservices
Microservices from Design to Deployment ไธญๆ–‡็‰ˆ ใ€ŠๅพฎๆœๅŠก๏ผšไปŽ่ฎพ่ฎกๅˆฐ้ƒจ็ฝฒใ€‹
Stars: โœญ 4,637 (+25661.11%)
Mutual labels:  microservices, microservice
Express Gateway
A microservices API Gateway built on top of Express.js
Stars: โœญ 2,583 (+14250%)
Mutual labels:  microservices, microservice
Laravel5 Jsonapi
Laravel 5 JSON API Transformer Package
Stars: โœญ 313 (+1638.89%)
Mutual labels:  microservices, microservice
Tree Gateway
This is a full featured and free API Gateway
Stars: โœญ 160 (+788.89%)
Mutual labels:  microservices, microservice
Graphiti
Stylish Graph APIs
Stars: โœญ 783 (+4250%)
Mutual labels:  microservices, microservice
Turkish Microservice Architecture Book
Open Source Turkish Microservices eBook. Feel free to contribute.
Stars: โœญ 469 (+2505.56%)
Mutual labels:  microservices, microservice
Space Cloud
Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes
Stars: โœญ 3,323 (+18361.11%)
Mutual labels:  microservices, microservice
Vertx Blueprint Microservice
Vert.x Blueprint Project - Micro-Shop microservice application
Stars: โœญ 663 (+3583.33%)
Mutual labels:  microservices, microservice
Cote
A Node.js library for building zero-configuration microservices.
Stars: โœญ 2,180 (+12011.11%)
Mutual labels:  microservices, microservice
Nodejs Microservice Starter
๐ŸŒฑ NodeJS RESTful API Microservice Starter
Stars: โœญ 220 (+1122.22%)
Mutual labels:  microservices, microservice
Tenso
Tenso is an HTTP REST API framework
Stars: โœญ 167 (+827.78%)
Mutual labels:  microservices, microservice
Event Stream Processing Microservices
Using Spring Cloud Stream and Spring State Machine to create event-driven microservices
Stars: โœญ 255 (+1316.67%)
Mutual labels:  microservices, microservice
Kratos
A modular-designed and easy-to-use microservices framework in Go.
Stars: โœญ 15,844 (+87922.22%)
Mutual labels:  microservices, microservice
Event Sourcing Jambo
An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
Stars: โœญ 159 (+783.33%)
Mutual labels:  microservices, microservice
Moleculer
๐Ÿš€ Progressive microservices framework for Node.js
Stars: โœญ 4,845 (+26816.67%)
Mutual labels:  microservices, microservice
Rpcx
Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! ๐‰๐š๐ฏ๐šๆœ‰๐๐ฎ๐›๐›๐จ, ๐†๐จ๐ฅ๐š๐ง๐ ๆœ‰๐ซ๐ฉ๐œ๐ฑ!
Stars: โœญ 6,516 (+36100%)
Mutual labels:  microservices, microservice

lagomkotlin

An example of Lightbend's Lagom project with Kotlin

This is the basic Lagom's Java Hello World example. I duplicated all Java classes to Kotlin with the prefix K, e.g,:

GreetingMessage.java

package org.cakesolutions.hello.api;

import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;

@Immutable
@JsonDeserialize
public final class GreetingMessage {

  public final String message;

  @JsonCreator
  public GreetingMessage(String message) {
    this.message = Preconditions.checkNotNull(message, "message");
  }

  @Override
  public boolean equals(@Nullable Object another) {
    if (this == another)
      return true;
    return another instanceof GreetingMessage && equalTo((GreetingMessage) another);
  }

  private boolean equalTo(GreetingMessage another) {
    return message.equals(another.message);
  }

  @Override
  public int hashCode() {
    int h = 31;
    h = h * 17 + message.hashCode();
    return h;
  }

  @Override
  public String toString() {
    return MoreObjects.toStringHelper("GreetingMessage").add("message", message).toString();
  }
}

KGreetingMessage.kt

package org.cakesolutions.hello.api

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import javax.annotation.concurrent.Immutable

@Immutable
@JsonDeserialize
data class KGreetingMessage @JsonCreator constructor(val message: String)

As you can see, Kotlin code is a lot shorter and readable

Run

Just type

mvn lagom:runAll

And then go to http://localhost:9000/api/hello/Kotlin

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].