• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Collection of independent libraries on top of Spring Boot to provide a faster setup of jvm microservices

edison-microservice

Collection of independent libraries on top of Spring Boot to provide a faster setup of jvm microservices.

"I never did anything by accident, nor did any of my inventions come by accident; they came by work." - Thomas Edison

Status

Build codecov Known Vulnerabilities Maven Central license

Have a look at the release notes for details about updates and changes.

About

This project contains a number of independent libraries on top of Spring Boot to provide a faster setup of jvm microservices. The libraries are used in different projects at OTTO. It's purpose is to provide a common implementation for cross-cutting requirements like:

  • Health checks that are used to tell the load balancer or mesos platform whether or not a service is healthy.
  • A status page/document that is used to give information about the current state of the service. Status information also include details about sub-components, background jobs like imports, and so on.
  • A simple job handling library that is used to run asynchronous background jobs, which for example can be used to run data imports from other systems.
  • An optional MongoDB-based implementation of a JobRepository
  • Support for MongoDB-based repositories in case you do not like Spring Data
  • Support for feature toggles based on Togglz

... plus all the features of Spring Boot.

Releases

Semantic Versioning v2.0.0 is used to specify the version numbers.

This project maintains its roadmap with issues and milestones.

2.7.x: Edison Microservices for Spring Boot 2.7.x βœ” - Compatible with Java 11 and greater

3.0.x: Edison Microservices for Spring Boot 3.0.x βœ” - Compatible with Java 17 and greater

Migration from Edison 2 to Edison 3

In edison-ldap, whitelisted-paths was replaced with allowlisted-paths. Everything else should be ok if you follow the Spring Boot 2 -> 3 migration guide: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide

Migration from Edison 1.x to Edison 2

Edison 2 has several breaking changes that will make a refactoring of your current application necessary. For a list of the actual changes, please take a look at the Changelog.

When migrating, take care of the following adjustments:

  • Follow the Spring Boot 2.0 Migration Guide to fix the most common problems.

    • If you want to use the behaviour of Edison 1.x, which hosts all management endpoints below /internal, you have to configure management.endpoints.web.base-path=/internal in your application.yml
  • Remove dependencies to the edison-aws Project, which will be deprecated some time in the future. Necessary functionality was transferred to a submodule of edison-microservice (named edison-aws).

  • If you have used gradlew bootRepackage for packaging your application so far, you have to migrate this to gradlew bootJar.

  • Refactor calls made through the AWS SDK, which got updated in the process of the new major version of edison and this will most probably break prior code that relied on the AWS SDK.

  • To use @Timed-Annotations, you need to configure Micrometer accordingly. See the following Example for a configuration that covers the annotation and naming of all metrics:

      @Configuration
      @EnableAspectJAutoProxy
      public class MicrometerConfiguration {
      
          @Bean
          public PrometheusNamingConvention prometheusNamingConvention() {
              return new PrometheusNamingConvention();
          }
      
          @Bean
          public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags(@Value("${service.vertical}") final String vertical,
                                                                          @Value("${service.name}") final String serviceName,
                                                                          final PrometheusNamingConvention prometheusNamingConvention) {
              return registry -> registry
                      .config()
                      .namingConvention(new NamingConvention() { 
                          // Set naming convention that gets applied to all metrics, in this  example explicitly using a Prometheus naming convention
                          @Override
                          public String name(final String name, final Meter.Type type, final String baseUnit) {
                              return prometheusNamingConvention.name(String.format("%s.%s.%s", vertical, serviceName, name), type, baseUnit);
                          }
                      })
                      .meterFilter(new MeterFilter() { // Configure generally applicable configurations, like percentiles
                          @Override
                          public DistributionStatisticConfig configure(final Meter.Id id,
                                                                       final DistributionStatisticConfig config) {
                              return config.merge(DistributionStatisticConfig.builder()
                                      .percentiles(0.5, 0.9, 0.95, 0.98, 0.99, 0.999)
                                      .build());
                          }
                      });
          }
      
          // Create a `TimedAspect` to enable `@Timed`-Annotations
          @Bean
          public TimedAspect timedAspect(final MeterRegistry registry) {
              return new TimedAspect(registry);
          }
      }

Documentation

Edison Modules:

  • edison-aws: AWS related configuration and togglz settings
  • edison-core: Main library of Edison microservices.
  • edison-jobs: Optional module providing a simple job library.
  • edison-mongo: Auto-configuration for MongoDB repositories plus implementation of MongoJobRepository and Togglz StateRepository.
  • edison-oauth: Auto-configuration for OAuth Public Key repositories with autofetching and a simple JWT Token Validation.
  • edison-togglz: Optional support for feature toggles for Edison microservices based on Togglz.
  • edison-testsupport: Test support for feature toggles plus utilities.
  • edison-validation: Optional module for validation in Spring with a specific response format.

Examples:

  • example-status: Service only relying on edison-core to show the usage of health and status features.
  • example-jobs: Edison service using edison-jobs to run background tasks.
  • example-togglz: Example using `edison-togglzΒ΄ to implement feature toggles.
  • example-togglz-mongo: Same edison-toggz, but with a MongoDB configuration to auto-configure persistence of feature toggles.

Setup

Make sure you have Java 11 or later and gradle 6.x installed on your computer.

Testing

Test and create coverage report

gradle check

Dependency Update

Determine possible dependency updates

gradle dependencyUpdates -Drevision=release

Publishing

Publish new releases

gradle uploadArchives

Examples

There are a few examples that may help you to start your first microservice based on Edison and Spring Boot. Because Spring Boot itself has some complexity, it is recommended to first read it's documentation before starting with Edison.

The examples can be started with gradle:

gradle examples:example-status:bootRun
gradle examples:example-jobs:bootRun
gradle examples:example-togglz:bootRun
gradle examples:example-togglz-mongo:bootRun

Open in your browser http://localhost:8080/

Note: Every example is configured to use port 8080, so make sure to run only one example at a time or to reconfigure the ports.

Contributing

Have a look at our contribution guidelines.

More Repositories

1

recsys-dataset

πŸ› A real-world e-commerce dataset for session-based recommender systems research.
Python
307
star
2

tesla-microservice

Common basis for some of otto.de's clojure microservices
Clojure
190
star
3

gitactionboard

GitactionBoard - Ultimate Dashboard for GithubActions.
Java
112
star
4

jlineup

An easy-to-use visual acceptance test tool to automatically detect design changes of your website. Works on the command line or as a web service.
Java
76
star
5

TRON

⚑️ Implementation of TRON: Transformer Recommender using Optimized Negative-sampling, accepted at ACM RecSys 2023.
Python
61
star
6

flummi

Flummi Elastic Search HTTP REST Client
Java
56
star
7

hmac-auth

HMAC authentication for RESTful web applications
Java
53
star
8

api-guidelines

A set of rules to build consistent and high quality REST and Async APIs at OTTO.
TypeScript
46
star
9

tech_manifest

OTTOs Tech Manifest
41
star
10

edison-hal

A library to parse and render application/hal+json documents in Java
Java
40
star
11

PyPruningRadixTrie

PyPruningRadixTrie - Python version of super fast Radix trie for prefix search & auto-complete
Python
36
star
12

TeamDojo

UI fΓΌr verschiedene Reifegrad-Dimensionen
Java
31
star
13

nom

Tools for ignoring anomalies
Clojure
30
star
14

logsmith

trayicon to assume your favorite aws roles
Python
23
star
15

MultiTRON

🀹 MultiTRON: Pareto Front Approximation for Multi-Objective Session-Based Recommender Systems, accepted at ACM RecSys 2024.
Python
23
star
16

traefik-config-validator

Validator for your Traefik Proxy (https://doc.traefik.io/traefik/) configuration
Go
22
star
17

gatekeeper

Manages environments, regulates deploys, advises pipelines and facilitates communication.
JavaScript
16
star
18

synapse

A library to implement event-sourcing microservices
Java
15
star
19

threatmodeling-resources

14
star
20

enhanced-wickettester

Framework for comfortable testing of wicket pages and components.
Java
14
star
21

rstash

r[emote]stash: cli tool to stash your local changes in a temporary remote branch
Shell
14
star
22

tesla-examples

Examples for tesla-microservice
Clojure
12
star
23

b2b-design-system

Otto B2B Design System
TypeScript
11
star
24

trackrdrd

The Tracking Log Reader demon reads from the shared memory log of a running instance of Varnish, aggregates data logged in a specific format for requests and ESI subrequests, and forwards the data to a messaging system (such as ActiveMQ or Kafka).
C
8
star
25

github-actions-wait

github-actions-wait
Shell
8
star
26

leinsync

Plugin to synchronize the shared codebase between clojure projects
Clojure
8
star
27

tesla-xray

Clojure
7
star
28

kafka-messaging-e2ee

Java
6
star
29

esi-include-thymeleaf3-dialect

A Thymeleaf 3 Dialect for ESI Includes
Java
6
star
30

edison-jobtrigger

An application to trigger jobs in 'Edison' Microservices.
Java
6
star
31

edison-aws

Java
6
star
32

goo

A wrapper to the Iapetos clojure binding for the prometheus client
Clojure
5
star
33

terraform-provider-galapagos

Terraform Provider especially for OTTO Galapagos variant
Go
5
star
34

gradle-projectversion

Groovy
4
star
35

dr-test

Dr. Test helps you to generate random test data that satisfy your schema definitions
Go
4
star
36

marketplace-php-sdk

A PHP SDK for the OTTO marketplace APIs
PHP
4
star
37

lein-files-hash

Clojure
3
star
38

status

Simple clojure lib to aggregate status.
Clojure
3
star
39

oauth-token-filter

Java
3
star
40

retail-api-hub-documentation

3
star
41

tesla-httpkit

embedded httpkit server for tesla microservice
Clojure
3
star
42

babbage-microservice

Basic modules that are useful for JVM microservices on top of Spring Boot Webflux
Kotlin
2
star
43

jlineup-action

Dockerfile
2
star
44

purge-deprecated-workflow-runs

Remove github workflow runs from current repository
JavaScript
2
star
45

queuemock

This is a tool to help mocking services that listen to incoming messages and sending a response via SQS.
JavaScript
2
star
46

tesla-jetty

embedded jetty server for tesla-microservice
Clojure
2
star
47

datatables_php_tools

1
star
48

hal-odyssey

Embeddable HAL+JSON browser for Spring Boot applications
Java
1
star
49

gradle-plugin-classycle

A gradle plugin for the classycle dependency checker
Java
1
star