Skip to content

Commit

Permalink
eventuate-tram#15. Updated swagger-ui, fixed urls in readme, enabled …
Browse files Browse the repository at this point in the history
…actuator mappings.
  • Loading branch information
dartartem committed May 17, 2021
1 parent ace69ca commit 03e580e
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 46 deletions.
6 changes: 3 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ docker-compose composeUp

Once the application has started, you can use the application via the Swagger UI:

* `Customer Service` - `http://localhost:8081/swagger-ui.html`
* `Order Service` - `http://localhost:8082/swagger-ui.html`
* `Order History Service` - `http://localhost:8083/swagger-ui.html`
* `Customer Service` - `http://localhost:8081/swagger-ui/index.html`
* `Order Service` - `http://localhost:8082/swagger-ui/index.html`
* `Order History Service` - `http://localhost:8083/swagger-ui/index.html`

You can also use `curl` to interact with the services.
First, let's create a customer:
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/FtgoServicePlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class FtgoServicePlugin implements Plugin<Project> {

compile "io.eventuate.tram.core:eventuate-tram-spring-cloud-sleuth-integration"

compile "org.springframework.data:spring-data-redis:2.2.0.M1"
compile 'io.lettuce:lettuce-core:5.1.4.RELEASE'
compile "org.springframework.data:spring-data-redis:${project.ext.springBootVersion}"
compile 'io.lettuce:lettuce-core:6.1.2.RELEASE'

}

Expand Down
6 changes: 1 addition & 5 deletions common-swagger/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
dependencies {
compile "io.springfox:springfox-swagger2:2.4.0"
compile "io.springfox:springfox-swagger-ui:2.4.0"

compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"

compile "io.eventuate.util:eventuate-util-spring-swagger:$eventuateUtilVersion"
}
Original file line number Diff line number Diff line change
@@ -1,42 +1,13 @@
package io.eventuate.examples.tram.ordersandcustomers.commonswagger;

import com.fasterxml.classmate.TypeResolver;
import org.springframework.beans.factory.annotation.Autowired;
import io.eventuate.util.spring.swagger.EventuateSwaggerConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.ResponseEntity;
import org.springframework.web.context.request.async.DeferredResult;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.WildcardType;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.concurrent.CompletableFuture;

import static springfox.documentation.schema.AlternateTypeRules.newRule;

@Configuration
@EnableSwagger2
public class CommonSwaggerConfiguration {

@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("io.eventuate.examples.tram.ordersandcustomers"))
.build()
.pathMapping("/")
.genericModelSubstitutes(ResponseEntity.class, CompletableFuture.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class))
)
.useDefaultResponseMessages(false)
;
public EventuateSwaggerConfig eventuateSwaggerConfig() {
return () -> "io.eventuate.examples.tram.ordersandcustomers";
}

@Autowired
private TypeResolver typeResolver;
}
2 changes: 2 additions & 0 deletions customer-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ eventuate.redis.partitions=2
spring.sleuth.enabled=true
spring.sleuth.sampler.probability=1
spring.zipkin.base.url=http://${DOCKER_HOST_IP:localhost}:9411/

management.endpoints.web.exposure.include=*
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ deployUrl=file:///Users/cer/.m2/testdeploy

eventuateMavenRepoUrl=https://dl.bintray.com/eventuateio-oss/eventuate-maven-release/,https://dl.bintray.com/eventuateio-oss/eventuate-maven-milestone/,file:///Users/cer/.m2/testdeploy,https://dl.bintray.com/eventuateio-oss/eventuate-maven-rc,https://snapshots.repositories.eventuate.io/repository

springBootVersion=2.2.5.RELEASE
springBootVersion=2.2.6.RELEASE

eventuatePlatformVersion=2021.3.RELEASE
eventuateUtilVersion=0.10.0.RELEASE
dockerComposePluginVersion=0.4.5
version=0.1.0-SNAPSHOT
springDependencyManagementPluginVersion=1.0.3.RELEASE
springCloudSleuthVersion=2.1.0.RELEASE
springCloudSleuthVersion=2.2.2.RELEASE
eventuateCommonImageVersion=0.14.0.RELEASE
eventuateCdcImageVersion=0.12.0.RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ eventuate.redis.partitions=2

spring.sleuth.enabled=true
spring.sleuth.sampler.probability=1
spring.zipkin.base.url=http://${DOCKER_HOST_IP:localhost}:9411/
spring.zipkin.base.url=http://${DOCKER_HOST_IP:localhost}:9411/

management.endpoints.web.exposure.include=*
2 changes: 2 additions & 0 deletions order-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ eventuate.redis.partitions=2
spring.sleuth.enabled=true
spring.sleuth.sampler.probability=1
spring.zipkin.base.url=http://${DOCKER_HOST_IP:localhost}:9411/

management.endpoints.web.exposure.include=*

0 comments on commit 03e580e

Please sign in to comment.