mvnw spring-boot:run<\/code><\/p>\n\n\n\n\u0421\u0430\u043c\u044b\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435\u043c Spring Boot \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c Main-\u043a\u043b\u0430\u0441\u0441\u0430 \u0432 IntelliJ IDEA.<\/p>\n\n\n\n
\u0412 \u0444\u0430\u0439\u043b\u0435 BlockedSite.java \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u0448 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n\n\n\n
package ru.otus.demoserver.domain;\n\nimport<\/strong> javax.persistence.Entity;\nimport<\/strong> javax.persistence.GeneratedValue;\nimport<\/strong> javax.persistence.Id;\n\n@Entity\npublic class<\/strong> BlockedSite<\/strong> {\n\n @Id\n @GeneratedValue\n private int id;\n\n private String url;\n<\/code><\/pre>\n\n\n\n\u0410 \u0432\u043e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 BlockedSitesController.java:<\/p>\n\n\n\n
package ru.otus.demoserver.rest;\n@RestController\npublic class<\/strong> BlockedSitesController<\/strong> {\n \tprivate final Logger logger = LoggerFactory.getLogger(BlockedSitesController.class);\n \tprivate final BlockedSitesRepository repository;\n \tpublic BlockedSitesController<\/strong>(BlockedSitesRepository repository) {\n\t \tthis.repository = repository;\n \t}\n \t@GetMapping(\"\/blocked-sites\")\n \tpublic List<BlockedSite> blockedSites<\/strong>() {\n\t \tlogger.info(\"Request has been performed\");\n\t \treturn<\/strong> repository.findAll();\n \t}\n}<\/code><\/pre>\n\n\n\n\u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0411\u0414 \u0432 pom.xml:<\/p>\n\n\n\n
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project<\/strong> xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\">\n <modelVersion<\/strong>>4.0.0<\/modelVersion<\/strong>>\n <parent<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-starter-parent<\/artifactId<\/strong>>\n <version<\/strong>>2.1.2.RELEASE<\/version<\/strong>>\n <relativePath<\/strong>\/> <!-- lookup parent from repository -->\n <\/parent<\/strong>>\n <groupId<\/strong>>ru.otus<\/groupId<\/strong>>\n <artifactId<\/strong>>demo-server<\/artifactId<\/strong>>\n <version<\/strong>>0.0.1-SNAPSHOT<\/version<\/strong>>\n <url<\/strong>>demo-server<\/url<\/strong>>\n <description<\/strong>>Demo project for Spring Boot<\/description<\/strong>>\n\n <properties<\/strong>>\n <java.version<\/strong>>1.8<\/java.version<\/strong>>\n <\/properties<\/strong>>\n\n <dependencies<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-starter-web<\/artifactId<\/strong>>\n <\/dependency<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-starter-data-jpa<\/artifactId<\/strong>>\n <\/dependency<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>com.h2database<\/groupId<\/strong>>\n <artifactId<\/strong>>h2<\/artifactId<\/strong>>\n <\/dependency<\/strong>>\n\n <dependency<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-starter-test<\/artifactId<\/strong>>\n <scope<\/strong>>test<\/scope<\/strong>>\n <\/dependency<\/strong>>\n <\/dependencies<\/strong>>\n\n <build<\/strong>>\n <plugins<\/strong>>\n <plugin<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-maven-plugin<\/artifactId<\/strong>>\n <\/plugin<\/strong>>\n <\/plugins<\/strong>>\n <\/build<\/strong>>\n\n<\/project<\/strong>>\n <\/code><\/pre>\n\n\n\n\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043d\u0435\u0437\u0430\u0442\u0435\u0439\u043b\u0438\u0432\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043d\u0430\u0448\u0443 \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u0432\u0430 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 (DemoServerApplication.java):<\/p>\n\n\n\n
package ru.otus.demoserver;\n@SpringBootApplication\npublic class<\/strong> DemoServerApplication<\/strong> {\n \tpublic static<\/strong> void<\/strong> main<\/strong>(String[] args) {\n\t \tApplicationContext ctx = SpringApplication.run(DemoServerApplication.class, args);\n\t \tBlockedSitesRepository repository = ctx.getBean(BlockedSitesRepository.class);\n \t \trepository.save(new<\/strong> BlockedSite(\"https:\/\/telegram.org\/\"));\n \t \trepository.save(new<\/strong> BlockedSite(\"https:\/\/azure.microsoft.com\/\"));\n \t}\n}<\/code><\/pre>\n\n\n\n\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spring Boot \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0443\u0440\u043b \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435 (localhost:8080\/blocked-sites)<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043c\u0438 \u0441\u0430\u0439\u0442\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0435 \u0441\u0430\u0439\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0411\u0414.<\/p>\n\n\n\n\u0427\u0442\u043e \u0436\u0435, \u043f\u0440\u0438\u0448\u043b\u0430 \u043f\u043e\u0440\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443. \u041d\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043a \u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0439\u0442\u0438, \u043d\u0443\u0436\u043d\u043e \u043a\u043e\u0435-\u0447\u0442\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c.<\/p>\n\n\n\n
\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/strong><\/p>\n\n\n\n\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 HTTP-\u043c\u0435\u0442\u043e\u0434\u044b (\u0433\u043b\u0430\u0433\u043e\u043b\u044b):<\/p>\n\n\n\n
\n- GET \u2014 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 entity \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043a\u0430;<\/li>\n\n\n\n
- POST \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 entity;<\/li>\n\n\n\n
- PUT \u2014 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 entity;<\/li>\n\n\n\n
- PATCH \u2014 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 entity (RFC-…);<\/li>\n\n\n\n
- DELETE \u2014 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 entity;<\/li>\n\n\n\n
- HEAD, OPTIONS \u2014 \u00ab\u0445\u0438\u0442\u0440\u044b\u0435\u00bb \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 HTTP-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 REST-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432;<\/li>\n\n\n\n
- TRACE \u2014 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/li>\n<\/ul>\n\n\n\n
\u041d\u0435\u043b\u044c\u0437\u044f \u043d\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438 \u043f\u0440\u043e \u0442\u0430\u043a\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u0430\u043a \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c<\/strong>. \u0413\u043e\u0432\u043e\u0440\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b \u0440\u0430\u0437 \u0432\u044b \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u0435\u0451 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u0432\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u0435\u0451 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043f\u043e\u0437\u0434\u043e\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0443\u0442\u0440\u0430 \u0441 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c, \u0441\u043a\u0430\u0437\u0430\u0432 \u0435\u043c\u0443 \u00ab\u041f\u0440\u0438\u0432\u0435\u0442!\u00bb \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u0430\u0448 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u00ab\u043f\u043e\u0437\u0434\u043e\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439\u00bb :-). \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043d\u044f \u0435\u043c\u0443 \u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u00ab\u041f\u0440\u0438\u0432\u0435\u0442!\u00bb, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f, \u043e\u043d \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0436\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n\n\n\n\u0410 \u0442\u0435\u043f\u0435\u0440\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 HTTP-\u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b? \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u044c, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 26-\u0439 \u043c\u0438\u043d\u0443\u0442\u044b \u0432\u0438\u0434\u0435\u043e.<\/p>\n\n\n\n
REST<\/strong><\/p>\n\n\n\n\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c REST-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 REST:<\/p>\n\n\n\n
\n- REST \u2014 REpresentational State Transfer;<\/li>\n\n\n\n
- \u044d\u0442\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c, \u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442;<\/li>\n\n\n\n
- \u044d\u0442\u043e, \u043f\u043e \u0441\u0443\u0442\u0438, \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432-\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439;<\/li>\n\n\n\n
- REST \u0431\u044b\u043b \u0434\u0430\u0432\u043d\u043e, \u043d\u043e \u0442\u0435\u0440\u043c\u0438\u043d \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e;<\/li>\n\n\n\n
- Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0438\u043b\u0435 REST \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f RESTful, \u0435\u0433\u043e API \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 RESTful API (\u0430\u043d\u0442\u043e\u043d\u0438\u043c \u2014 Stateful);<\/li>\n\n\n\n
- REST-\u043e\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u0441\u0451 \u0447\u0442\u043e \u0445\u043e\u0442\u044f\u0442\u2026<\/li>\n<\/ul>\n\n\n\n
\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0435\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440, \u0442\u043e \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0437\u0430\u043f\u0440\u043e\u0441-\u043e\u0442\u0432\u0435\u0442. \u0414\u0430, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u0430\u043a \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0442\u0430\u043a\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043e, \u0430 \u0434\u043b\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0447\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u0410 \u0432\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0435\u0431-\u0441\u043e\u043a\u0435\u0442\u044b \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0435 REST.<\/p>\n\n\n\n
\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0441\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0432 REST \u2014 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0438 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n\n\n\n
\u041a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 Spring<\/h3>\n\n\n\n
\u0414\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439):<\/p>\n\n\n\n
git clone git@github.com:ydvorzhetskiy\/sb-client.git<\/code><\/pre>\n\n\n\nmvnw spring-boot:run<\/code><\/pre>\n\n\n\n\u042d\u0442\u043e \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u043d\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n\n\n\n
\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n\n\n\n
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project<\/strong> xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\">\n <modelVersion<\/strong>>4.0.0<\/modelVersion<\/strong>>\n <parent<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-starter-parent<\/artifactId<\/strong>>\n <version<\/strong>>2.1.2.RELEASE<\/version<\/strong>>\n <relativePath<\/strong>\/> <!-- lookup parent from repository -->\n <\/parent<\/strong>>\n <groupId<\/strong>>ru.otus<\/groupId<\/strong>>\n <artifactId<\/strong>>demo-client<\/artifactId<\/strong>>\n <version<\/strong>>0.0.1-SNAPSHOT<\/version<\/strong>>\n <url<\/strong>>demo-client<\/url<\/strong>>\n <description<\/strong>>Demo project for Spring Boot<\/description<\/strong>>\n\n <properties<\/strong>>\n <java.version<\/strong>>1.8<\/java.version<\/strong>>\n <\/properties<\/strong>>\n\n <dependencies<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-starter<\/artifactId<\/strong>>\n <\/dependency<\/strong>>\n <!-- \u042d\u0442\u043e \u0434\u043b\u044f RestTemplate, \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 -->\n <dependency<\/strong>>\n <groupId<\/strong>>org.springframework<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-web<\/artifactId<\/strong>>\n <version<\/strong>>5.1.4.RELEASE<\/version<\/strong>>\n <\/dependency<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>com.fasterxml.jackson.core<\/groupId<\/strong>>\n <artifactId<\/strong>>jackson-annotations<\/artifactId<\/strong>>\n <version<\/strong>>2.9.8<\/version<\/strong>>\n <\/dependency<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>com.fasterxml.jackson.core<\/groupId<\/strong>>\n <artifactId<\/strong>>jackson-core<\/artifactId<\/strong>>\n <version<\/strong>>2.9.8<\/version<\/strong>>\n <\/dependency<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>com.fasterxml.jackson.core<\/groupId<\/strong>>\n <artifactId<\/strong>>jackson-databind<\/artifactId<\/strong>>\n <version<\/strong>>2.9.8<\/version<\/strong>>\n <\/dependency<\/strong>>\n\n <!-- Cache -->\n <dependency<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-starter-cache<\/artifactId<\/strong>>\n <\/dependency<\/strong>>\n\n <!-- Retry -->\n <dependency<\/strong>>\n <groupId<\/strong>>org.springframework.retry<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-retry<\/artifactId<\/strong>>\n <\/dependency<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>org.aspectj<\/groupId<\/strong>>\n <artifactId<\/strong>>aspectjweaver<\/artifactId<\/strong>>\n <\/dependency<\/strong>>\n\n <!-- Hystrix -->\n <dependency<\/strong>>\n <groupId<\/strong>>org.springframework.cloud<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-cloud-starter-netflix-hystrix<\/artifactId<\/strong>>\n <version<\/strong>>2.0.2.RELEASE<\/version<\/strong>>\n <\/dependency<\/strong>>\n <dependency<\/strong>>\n <groupId<\/strong>>com.netflix.hystrix<\/groupId<\/strong>>\n <artifactId<\/strong>>hystrix-javanica<\/artifactId<\/strong>>\n <version<\/strong>>1.5.12<\/version<\/strong>>\n <\/dependency<\/strong>>\n <\/dependencies<\/strong>>\n\n <build<\/strong>>\n <plugins<\/strong>>\n <plugin<\/strong>>\n <groupId<\/strong>>org.springframework.boot<\/groupId<\/strong>>\n <artifactId<\/strong>>spring-boot-maven-plugin<\/artifactId<\/strong>>\n <\/plugin<\/strong>>\n <\/plugins<\/strong>>\n <\/build<\/strong>>\n\n<\/project<\/strong>><\/code><\/pre>\n\n\n\n\u0423 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f:<\/p>\n\n\n\n
1. RestTemplateConfig.java<\/p>\n\n\n\n
package ru.otus.democlient.config;\n@Configuration\npublic class<\/strong> RestTemplateConfig<\/strong> {\n \t@Bean\n \tpublic RestTemplate restTemplate<\/strong>(RestTemplateBuilder restTemplateBuilder) {\n\t \treturn<\/strong> restTemplateBuilder\n .setConnectTimeout(Duration.ofSeconds(2))\n \t \t.setReadTimeout(Duration.ofSeconds(3))\n \t \t.build();\n \t}<\/code><\/pre>\n\n\n\n2. CacheConfig.java<\/p>\n\n\n\n
package ru.otus.democlient.config;\n@Configuration\npublic class<\/strong> CacheConfig<\/strong> {\n \t@Bean\n \tpublic CacheManager cacheManager<\/strong>() {\n\t \treturn<\/strong> new<\/strong> ConcurrentMapCacheManager(\"sites\");\n \t}\n}<\/code><\/pre>\n\n\n\n\u0410 \u0432\u043e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 SiteServiceRest.java:<\/p>\n\n\n\n
package ru.otus.democlient.service;\n