From 47f3fbb95228d51755869555a1d0b4caa45fcc2e Mon Sep 17 00:00:00 2001 From: Cornelia Davis Date: Mon, 18 Feb 2019 14:34:41 -0800 Subject: [PATCH] Update class name to make clear it is a client of the Posts service. --- .../buildAndPushDockerImages.sh | 15 +++------------ .../ConnectionsPostsController.java | 4 ++-- ...{PostsService.java => PostsServiceClient.java} | 2 +- .../cookbook-deployment-connections.yaml | 2 +- .../cookbook-deployment-connectionsposts.yaml | 2 +- 5 files changed, 8 insertions(+), 17 deletions(-) rename cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/{PostsService.java => PostsServiceClient.java} (98%) diff --git a/cloudnative-requestresilience/buildAndPushDockerImages.sh b/cloudnative-requestresilience/buildAndPushDockerImages.sh index 6cf2b98..e6e1880 100755 --- a/cloudnative-requestresilience/buildAndPushDockerImages.sh +++ b/cloudnative-requestresilience/buildAndPushDockerImages.sh @@ -1,15 +1,6 @@ docker build --build-arg \ jar_file=cloudnative-connectionposts/target/cloudnative-connectionposts-0.0.1-SNAPSHOT.jar \ --t cdavisafc/cloudnative-requestresilience-connectionposts:0.0.1 . +-t cdavisafc/cloudnative-requestresilience-connectionposts:0.0.2 . +# only connections posts has changed for this step # -docker build --build-arg \ -jar_file=cloudnative-connections/target/cloudnative-connections-0.0.1-SNAPSHOT.jar \ --t cdavisafc/cloudnative-requestresilience-connections:0.0.1 . -# -docker build --build-arg \ -jar_file=cloudnative-posts/target/cloudnative-posts-0.0.1-SNAPSHOT.jar \ --t cdavisafc/cloudnative-requestresilience-posts:0.0.1 . -# -docker push cdavisafc/cloudnative-requestresilience-connectionposts:0.0.1 -docker push cdavisafc/cloudnative-requestresilience-connections:0.0.1 -docker push cdavisafc/cloudnative-requestresilience-posts:0.0.1 \ No newline at end of file +docker push cdavisafc/cloudnative-requestresilience-connectionposts:0.0.2 diff --git a/cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/ConnectionsPostsController.java b/cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/ConnectionsPostsController.java index 95c1d3c..29c722d 100644 --- a/cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/ConnectionsPostsController.java +++ b/cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/ConnectionsPostsController.java @@ -100,7 +100,7 @@ public ConnectionsPostsController(StringRedisTemplate template) { RestTemplateBuilder restTemplateBuilder; @Autowired - PostsService postsService; + PostsServiceClient postsServiceClient; @Override public void afterPropertiesSet() { @@ -148,7 +148,7 @@ public Iterable getByUsername(@CookieValue(value = "userToken", req // try getting the Posts for these users try { - postSummaries = postsService.getPosts(ids, restTemplate); + postSummaries = postsServiceClient.getPosts(ids, restTemplate); response.setStatus(200); return postSummaries; } catch (HttpServerErrorException e) { diff --git a/cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/PostsService.java b/cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/PostsServiceClient.java similarity index 98% rename from cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/PostsService.java rename to cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/PostsServiceClient.java index 4bd5dc7..339bde1 100644 --- a/cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/PostsService.java +++ b/cloudnative-requestresilience/cloudnative-connectionposts/src/main/java/com/corneliadavis/cloudnative/connectionsposts/PostsServiceClient.java @@ -15,7 +15,7 @@ import java.util.ArrayList; @Service -public class PostsService { +public class PostsServiceClient { private static final Logger logger = LoggerFactory.getLogger(ConnectionsPostsController.class); diff --git a/cloudnative-requestresilience/cookbook-deployment-connections.yaml b/cloudnative-requestresilience/cookbook-deployment-connections.yaml index c79837e..04aad7d 100644 --- a/cloudnative-requestresilience/cookbook-deployment-connections.yaml +++ b/cloudnative-requestresilience/cookbook-deployment-connections.yaml @@ -30,7 +30,7 @@ spec: spec: containers: - name: connections - image: cdavisafc/cloudnative-requestresilience-connections + image: cdavisafc/cloudnative-requestresilience-connections:0.0.1 livenessProbe: httpGet: path: /healthz diff --git a/cloudnative-requestresilience/cookbook-deployment-connectionsposts.yaml b/cloudnative-requestresilience/cookbook-deployment-connectionsposts.yaml index 86ba538..b56d192 100644 --- a/cloudnative-requestresilience/cookbook-deployment-connectionsposts.yaml +++ b/cloudnative-requestresilience/cookbook-deployment-connectionsposts.yaml @@ -30,7 +30,7 @@ spec: spec: containers: - name: connectionsposts - image: cdavisafc/cloudnative-requestresilience-connectionposts:0.0.1 + image: cdavisafc/cloudnative-requestresilience-connectionposts:0.0.2 # resources: # limits: # memory: "2048Mi"