Skip to content

Instantly share code, notes, and snippets.

@thinkmicroservices
thinkmicroservices / AccountProfileService:Docker-Compose dc-09-account-history.yml
Created March 31, 2020 04:30
AccountProfileService:Docker-Compose dc-09-account-history.yml
## docker-compose -f ./dc-09-account-history.yml up -d
version: "3.7"
services:
##############################################################
# INFRASTRUCTURE SERVICES
################
@thinkmicroservices
thinkmicroservices / ApplicationProfileService:application.yml
Created March 31, 2020 04:18
ApplicationProfileService:application.yml
server:
port: 8080
info:
app:
name: Account Profile Service
description: Provides access to account profile information
version: 1.0.0
spring:
@thinkmicroservices
thinkmicroservices / AccountProfileService: bootstrap.yml
Created March 31, 2020 04:15
AccountProfileService: bootstrap.yml
spring:
application:
name: ACCOUNT-PROFILE-SERVICE
cloud:
config:
fail-fast: true
retry:
max-attempts: 10
initial-interval: 1500
multiplier: 1.5
@thinkmicroservices
thinkmicroservices / AccountProfileService:AccountProfileImageController.java
Created March 31, 2020 04:07
AccountProfileService:AccountProfileImageController.java
package com.thinkmicroservices.ri.spring.account.profile.controller;
import com.thinkmicroservices.ri.spring.account.profile.model.ProfileImage;
import com.thinkmicroservices.ri.spring.account.profile.service.ProfileService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@thinkmicroservices
thinkmicroservices / AccountProfileService:AccountProfileController.java
Created March 31, 2020 04:05
AccountProfileService:AccountProfileController.java
/**
*
*/
package com.thinkmicroservices.ri.spring.account.profile.controller;
import com.thinkmicroservices.ri.spring.account.profile.model.Profile;
import com.thinkmicroservices.ri.spring.account.profile.service.ProfileDeleteException;
import com.thinkmicroservices.ri.spring.account.profile.service.ProfileService;
import com.thinkmicroservices.ri.spring.account.profile.service.ProfileUpdateException;
@thinkmicroservices
thinkmicroservices / AccountProfileService: ProfileService.java
Created March 31, 2020 02:35
AccountProfileService: ProfileService.java
package com.thinkmicroservices.ri.spring.account.profile.service;
import com.thinkmicroservices.ri.spring.account.profile.messaging.ProfileQueueManager;
import com.thinkmicroservices.ri.spring.account.profile.messaging.events.ProfileCreatedEvent;
import com.thinkmicroservices.ri.spring.account.profile.messaging.events.ProfileImageCreatedEvent;
import com.thinkmicroservices.ri.spring.account.profile.messaging.events.ProfileImageUpdatedEvent;
import com.thinkmicroservices.ri.spring.account.profile.messaging.events.ProfileUpdatedEvent;
import com.thinkmicroservices.ri.spring.account.profile.model.Profile;
import com.thinkmicroservices.ri.spring.account.profile.model.ProfileImage;
@thinkmicroservices
thinkmicroservices / AccountProfileService: QueueEventListener.java
Last active March 31, 2020 02:23
AccountProfileService: QueueEventListener.java
package com.thinkmicroservices.ri.spring.account.profile.messaging;
import com.thinkmicroservices.ri.spring.account.profile.messaging.events.AccountRegisteredEvent;
import com.thinkmicroservices.ri.spring.account.profile.model.Profile;
import com.thinkmicroservices.ri.spring.account.profile.service.ProfileCreateException;
import com.thinkmicroservices.ri.spring.account.profile.service.ProfileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
@thinkmicroservices
thinkmicroservices / AccountProfileService: ProfileImageRepository.java
Created March 30, 2020 23:16
AccountProfileService: ProfileImageRepository.java
package com.thinkmicroservices.ri.spring.account.profile.repository;
import com.thinkmicroservices.ri.spring.account.profile.model.ProfileImage;
import java.util.Optional;
import org.springframework.data.mongodb.repository.MongoRepository;
/**
*
* @author cwoodward
*/
@thinkmicroservices
thinkmicroservices / AccountProfileService: ProfileRepository.java
Created March 30, 2020 23:08
AccountProfileService: ProfileRepository.java
package com.thinkmicroservices.ri.spring.account.profile.repository;
import com.thinkmicroservices.ri.spring.account.profile.model.Profile;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
/**
@thinkmicroservices
thinkmicroservices / AccountProfileService: maven pom.xml
Created March 25, 2020 01:54
AccountProfileService: maven pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>