GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - debuglevel/sparkmicroserviceutils: Utility functions for Spark

This repository was archived by the owner on Jan 6, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
gradle/wrapper
gradle/wrapper
 
 
src/main/kotlin/de/debuglevel/microservices/utils
src/main/kotlin/de/debuglevel/microservices/utils
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Microservices.Utils

Configuration

The MicroserviceConfiguration object provides access to values set in various sources of configurations. As of version 0.0.12, values are read from the following sources, whereas the former override the later:

  1. Java system properties (e.g. java -Dserver.port=1234)
  2. Environment variables (e.g. SERVER_PORT=1234)
  3. configuration.properties file in the working directory (e.g. server.port=1234)
  4. defaults.properties file in the class path (e.g. server.port=1234)

Predefined configuration keys

A few configuration keys are used by Microservices.Utils itself and therefore predefined. Those can be access as read-only properties of the MicroserviceConfiguration object (e.g. MicroserviceConfiguration.port)

Custom configuration keys

Own configuration keys can be access like MicroserviceConfiguration.configuration[Key("port", intType)] or MicroserviceConfiguration.configuration.getOrNull(Key("port", intType)).

Spark

Set port to configured number

Calling configuredPort() sets the port of the web server to the configured port number (port or server.port as of version 0.0.12).

Wait until Spark is shut down

Calling awaitShutdown() waits until Spark is shut down. This is especially useful in tests.

Status endpoint

Calling status() activates a status/health/diagnostics JSON object on <HOST>/status/. The JSON object looks like this as of version 0.0.12:

{
    "status":"up",
    "uptime":"32",
    "jvmName":"6428@puck",
    "jvmSpecName":"Java Virtual Machine Specification",
    "jvmSpecVendor":"Oracle Corporation",
    "jvmSpecVersion":"1.8",
    "vmName":"Java HotSpot(TM) 64-Bit Server VM",
    "vmVendor":"Oracle Corporation",
    "vmVersion":"25.131-b11",
    "compilerName":"HotSpot 64-Bit Tiered Compilers"
}

Build and Publish

Developer's notes on how to publish this artifact on bintray via PowerShell:

  • ensure to increment version in gradle.build
  • $env:BINTRAY_USER = "debuglevel"; $env:BINTRAY_API_KEY = "SUPER_SECRET"; ./gradlew bintrayUpload

About

Utility functions for Spark

Topics

java-sparklibrary

Resources

Readme
WTFPL license
Activity

Stars

1 star

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.