Skip to content

Instantly share code, notes, and snippets.

View sabbarmehdi's full-sized avatar
🎯
Focusing

EL MEHDI SABBAR sabbarmehdi

🎯
Focusing
View GitHub Profile
spring.application.name=ApiConfigurationServer
server.port=8888
@sabbarmehdi
sabbarmehdi / application.properties
Created July 15, 2021 15:11
Configure properties to fetch configuration from Github repo
spring.cloud.config.server.git.uri=https://github.com/sabbarmehdi/ApiConfigurationServer
spring.cloud.config.server.git.username=sabbarmehdi
spring.cloud.config.server.git.password=Your_Github_Password
spring.cloud.config.server.git.clone-on-start=true
spring.cloud.config.server.git.default-label=main
@sabbarmehdi
sabbarmehdi / application.properties
Created July 15, 2021 15:15
Configure properties to fetch configuration from a local folder
spring.cloud.config.server.native.search-locations=file://${user.home}/Desktop/
@sabbarmehdi
sabbarmehdi / application.properties
Created July 15, 2021 15:21
Prioritize the local configurations
spring.profiles.active=native
@sabbarmehdi
sabbarmehdi / pom.xml
Created July 16, 2021 14:05
Jasypt encrepty
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
@sabbarmehdi
sabbarmehdi / pom.xml
Last active July 16, 2021 15:19
Jasypt encrepty plugin
<build>
<plugins>
...
<plugin>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-maven-plugin</artifactId>
<version>3.0.3</version>
</plugin>
</plugins>
</build>
@EnableFeignClients
@SpringBootApplication
@EnableEurekaClient
public class UserApplication {
public static void main(String[] args) {
SpringApplication.run(UsersApplication.class, args);
}
}
@RestController
@RequestMapping("/item")
@RepositoryRestController
@RequiredArgsConstructor
public class ItemController {
@Autowired
ItemService itemService;
@GetMapping(value = "/user-items")
public ResponseEntity<List<Item>> getItemByUserId(@RequestParam(value = "userId") Long userId){
@FeignClient(name = "item-service")
public interface ItemsServiceClient {
@GetMapping(value = "/item/user-items")
public List<Item> getItems(@RequestParam Long userId);
}
spring.application.name=item-service