Giter Club home page Giter Club logo

profiles-blog's Introduction

gradle-profiles

Example of how to use Gradle profiles for multi-project Spring Boot applications.

The Profiles-Blog-Sender project sends simple HTTP POST requests to a Profiles-Blog-Receiver project running on the same host. Both projects share a common database with one table that records the number of requests sent and received for each payload type. Two payload types are available, TEST1 and TEST2.

The location of the database can be changed by using the following three profiles:

  • test
  • dev
  • prod

Run gradle bootRun tasks with the -P argument to utilize a profile.
For example, within a subproject's directory, use:
gradle -Pdev bootRun

Or, if in the parent project's directory, individual projects can be targeted using their name:
gradle -Pdev Profiles-Blog-Sender:bootRun

See common_test_application.properties and common_dev_application.properties for information about where each database is located.

The prod profile requires database credentials to be passed using -P arguments as follows:
gradle -Pprod -Pspring.datasource.url=value -Pspring.datasource.username=value -Pspring.datasource.password=value bootRun

Profiles-Blog-Sender supports two HTTP GET commands:

http://localhost:9001/TEST1/send
Sends a payload of the type specified in the URL to the Profiles-Blog-Sender project.
Sample Response" {"payloadType":"TEST1","timesSent":1}

http://localhost:9001/TEST1/count
Displays the current number of times the specified payload type has been sent.
Sample Response: {"payloadType":"TEST1","timesSent":1}

Profiles-Blog-Receiver supports one HTTP GET command:

http://localhost:9002/TEST1/count
Displays the current number of times the specified payload type has been received.
Sample Response: {"payloadType":"TEST1","timesReceived":1}

TEST1 can be replaced with TEST2 for all of the aforementioned URLs.

profiles-blog's People

Contributors

jdwilson11 avatar

Watchers

Akosh Pinter 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.