Skip to content

Files

35 lines (28 loc) · 2.13 KB

File metadata and controls

35 lines (28 loc) · 2.13 KB

#Overview

This application provides the comments related functionality and serves as one component. It defines the REST endpoints that are used to provide comment functionality.

Note that this component is only used internally by the "task" microservice and is NOT actually exposed at the API gateway level.

##Pre-requisites

Projects that need to be started before

  • config server - For pulling the configuration information
  • webserver-registry - For starting the Eureka server since the authorization server also is a micro-service that needs to be registered with Eureka server.

Running the application

  • Build the application by running the ./gradlew clean build gradle command at the "comments-webservice" project root folder on the terminal.
  • If you want to run the application as jar file, then run java -jar build/libs/basic-comments-webservice-0.0.1.jar command at the terminal.

External Configuration

Please refer to user webservice for details on how the external configuration works. Note that there is separate configuration file for each Spring application; the application should refer to it's own .yml file for configuration.

Consumer Driven Contracts

  • The comments webservice is consumed by the task-webservice and hence needs to adhere to the contract which is provided to the consumer.
  • We use consumer driven contracts to create the producer contracts and auto-generate tests. The implementation of CDC is Spring Cloud Contract Verifier that provides the following
    • Contract Definition Language (DSL)
      • Definition either in groovy or pact format
    • Used to produce following resources
      • JSON stub definitions
    • Used by client side
      • Test written by hand, test data provided by Spring
    • Server tests
      • Test generated by Spring
  • The contract and associated class is defined under the src/test folder.
  • To publish the contract stubs to the local maven repository, run the following gradle task
./gradlew clean build publishToMavenLocal