{"id":414820,"date":"2024-06-29T23:59:35","date_gmt":"2024-06-29T23:59:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=414820"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=414820","title":{"rendered":"<span>\u041a\u0430\u043a \u043c\u044b Neo4j \u043a Helidon \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043b\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7b0\/b2d\/29a\/7b0b2d29a30b7bdc467cbd7e24071ca9.png\" width=\"1400\" height=\"704\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b0\/b2d\/29a\/7b0b2d29a30b7bdc467cbd7e24071ca9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0434\u0435\u044f \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 Neo4j \u0441 Helidon \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e. <\/p>\n<blockquote>\n<p><em>Neo4j \u2014 \u0433\u0440\u0430\u0444\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 Java. \u041f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043d\u0430 2015 \u0433\u043e\u0434 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u043e\u0432\u043e\u0439 \u0421\u0423\u0411\u0414. (\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044f, 21.10.2021) <\/em><\/p>\n<\/blockquote>\n<p>Neo4j \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Java \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438\u0437 \u041f\u041e, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044f\u0437\u044b\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 Cypher, \u0447\u0435\u0440\u0435\u0437 HTTP endpoint \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u00abbolt\u00bb. Neo4j \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u043e\u0432\u044b\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u0442\u0440\u0430\u0441\u043b\u044f\u0445. <\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u0432 \u0441\u0435 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430 \u0441 Michael Simonis, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 Spring Data Neo4j 6 \u0438 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u044e\u0449\u0438\u043c Neo4j-OGM. \u041c\u044b \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u041c\u0438\u0445\u0430\u0435\u043b\u044f, \u0447\u0442\u043e \u043e\u043d \u0434\u0443\u043c\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a Helidon \u0438 Neo4J \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435. \u041c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0447\u0430\u0441 \u041c\u0438\u0445\u0430\u0435\u043b\u044c \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043c\u043d\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0434\u043b\u044f Helidon MP \u0438 Neo4j SDN. <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u0434, \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u0441\u0442\u0440\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 pom.xml:<\/p>\n<pre><code class=\"xml\">&lt;dependency>     &lt;groupId>org.springframework.data&lt;\/groupId>     &lt;artifactId>spring-data-neo4j&lt;\/artifactId> &lt;\/dependency><\/code><\/pre>\n<p>Spring? \u0414\u0430 \u043b\u0430\u0434\u043d\u0430! \u041f\u043e\u0447\u0435\u043c\u0443 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c Spring? <\/p>\n<p>\u041d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043a\u043e\u0434, \u044f \u0431\u044b\u043b \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d, \u0443\u0432\u0438\u0434\u0435\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 CDI 2.0, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430. \u042d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 CDI \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 Helidon, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 CDI &#8212; \u0448\u0438\u043a\u0430\u0440\u043d\u043e! \u042f \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043a\u0440\u0430\u0441\u043e\u0442\u0443 \u0438 \u0441\u0438\u043b\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432. <\/p>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u043d\u044c \u041c\u0438\u0445\u0430\u0435\u043b\u044c \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043c\u043d\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u043f\u043e. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043e\u043d \u0432\u043a\u043b\u044e\u0447\u0438\u043b \u0441\u0432\u043e\u0438 \u0438\u0434\u0435\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Neo4j \u0441 Helidon SE. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0442\u043e\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u0411\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Helidon Config \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0432\u0441\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Neo4j \u0432 \u0435\u0434\u0438\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e. \u0410 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Neo4j \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 native image, \u0432\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 native-image \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430. <\/p>\n<p>\u042d\u0442\u043e \u043f\u043e\u0440\u043e\u0434\u0438\u043b\u043e \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 Helidon \u0438 Neo4j \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f Helidon. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e! <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u0446\u0438\u0439 \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u0435\u043c Neo4j \u0438 \u043c\u043e\u0438\u043c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u041c\u0438\u0445\u0430\u0435\u043b\u0435\u043c \u0421\u0438\u043c\u043e\u043d\u0438\u0441\u043e\u043c \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c Helidon. \u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 Health Checks \u0438\u0437 Neo4j \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u0432 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 Helidon \/ MicroProfile \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 &#8212; \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 Maven. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e Neo4j \u0441 Helidon? \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0432\u0435 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0438 Helidon &#8212; MP \u0438 SE. SE \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 API, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0439 Java. \u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u00ab\u043c\u0430\u0433\u0438\u0438\u00bb \u0432\u0440\u043e\u0434\u0435 \u0440\u0435\u0444\u043b\u0435\u043a\u0448\u0430\u043d\u0430 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u0435\u0439. Helidon MP, \u043f\u043e \u0441\u0443\u0442\u0438, \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 SE \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c MicroProfile. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 Neo4j \u0434\u043b\u044f Helidon SE, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0435 \u043a\u0430\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f CDI \u0434\u043b\u044f Helidon MP.<\/p>\n<h3>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e! <\/h3>\n<blockquote>\n<p><em>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Helidon \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 Apache 2.0, \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Helidon.<\/em> <\/p>\n<\/blockquote>\n<p>\u0412 Helidon \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 support \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438. \u042d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041c\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u043c Builder pattern \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 Builder, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"java\">public Builder config(Config config) {    config.get(\"authentication.username\").asString().ifPresent(this::username);    config.get(\"authentication.password\").asString().ifPresent(this::password);    config.get(\"authentication.enabled\").asBoolean().ifPresent(this::authenticationEnabled);    config.get(\"uri\").asString().ifPresent(this::uri);    config.get(\"encrypted\").asBoolean().ifPresent(this::encrypted);    \/\/pool    config.get(\"pool.metricsEnabled\").asBoolean().ifPresent(this::metricsEnabled);    config.get(\"pool.logLeakedSessions\").asBoolean().ifPresent(this::logLeakedSessions);    config.get(\"pool.maxConnectionPoolSize\").asInt().ifPresent(this::maxConnectionPoolSize);    config.get(\"pool.idleTimeBeforeConnectionTest\").as(Duration.class).ifPresent(this::idleTimeBeforeConnectionTest);    config.get(\"pool.maxConnectionLifetime\").as(Duration.class).ifPresent(this::maxConnectionLifetime);    config.get(\"pool.connectionAcquisitionTimeout\").as(Duration.class).ifPresent(this::connectionAcquisitionTimeout);    \/\/trust       config.get(\"trustsettings.trustStrategy\").asString().map(TrustStrategy::valueOf).ifPresent(this::trustStrategy);    config.get(\"trustsettings.certificate\").as(Path.class).ifPresent(this::certificate);    config.get(\"trustsettings.hostnameVerificationEnabled\").asBoolean().ifPresent(this::hostnameVerificationEnabled);    return this; } <\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u043e\u043d\u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u043f\u0440\u0438\u0447\u0435\u043c, \u043b\u0438\u0431\u043e \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 SE, \u043b\u0438\u0431\u043e \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 MicroProfile. \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0443 Builder:<\/p>\n<pre><code class=\"java\">... public Builder password(String password) {    Objects.requireNonNull(password);    this.password = password;    return this; } ... <\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0431\u0438\u043b\u0434\u0438\u0442\u044c support \u043e\u0431\u044a\u0435\u043a\u0442:<\/p>\n<pre><code class=\"java\">@Override public Neo4j build() {    if (driver == null) {        driver = initDriver();    }    return new Neo4j(this); } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430 (\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u043f\u0443\u0449\u0435\u043d\u044b):<\/p>\n<pre><code class=\"java\">private Driver initDriver() {    AuthToken authToken = AuthTokens.none();    if (authenticationEnabled) {        authToken = AuthTokens.basic(username, password);    }    org.neo4j.driver.Config.ConfigBuilder configBuilder = createBaseConfig();    configureSsl(configBuilder);    configurePoolSettings(configBuilder);    return GraphDatabase.driver(uri, authToken, configBuilder.build()); } <\/code><\/pre>\n<p> Support \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440:<\/p>\n<pre><code class=\"java\">public Driver driver() {    return driver; } <\/code><\/pre>\n<p>&#8230; \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"java\">Neo4jMetricsSupport.builder()        .driver(neo4j.driver())        .build()        .initialize(); Driver neo4jDriver = neo4j.driver(); <\/code><\/pre>\n<p>Helidon \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 application.yaml:<\/p>\n<pre><code class=\"yaml\">neo4j:  uri: bolt:\/\/localhost:7687  authentication:    username: neo4j    password: secret  pool:    metricsEnabled: true <\/code><\/pre>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0435 &#8212; \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435:<\/p>\n<pre><code class=\"java\">public List&lt;Movie> findAll(){    try (var session = driver.session()) {        var query = \"\"                + \"match (m:Movie) \"                + \"match (m) &lt;- [:DIRECTED] - (d:Person) \"                + \"match (m) &lt;- [r:ACTED_IN] - (a:Person) \"                + \"return m, collect(d) as directors, collect({name:a.name, roles: r.roles}) as actors\";        return session.readTransaction(tx -> tx.run(query).list(r -> {            var movieNode = r.get(\"m\").asNode();            var directors = r.get(\"directors\").asList(v -> {                var personNode = v.asNode();                return new Person(personNode.get(\"born\").asInt(), personNode.get(\"name\").asString());            });            var actors = r.get(\"actors\").asList(v -> {                return new Actor(v.get(\"name\").asString(), v.get(\"roles\").asList(Value::asString));            });            var m = new Movie(movieNode.get(\"title\").asString(), movieNode.get(\"tagline\").asString());            m.setReleased(movieNode.get(\"released\").asInt());            m.setDirectorss(directors);            m.setActors(actors);            return m;        }));    } } <\/code><\/pre>\n<p>\u0418\u00a0<em>\u0432\u0443\u0430\u043b\u044f<\/em>!\u00a0Helidon \u0438 Neo4j \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>\u0410 \u043a\u0430\u043a \u0436\u0435 MP?\u00a0<\/p>\n<p>\u041d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430\u0448\u0443 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 CDI &#8212; \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"java\">public class Neo4jCdiExtension implements Extension {    private static final String NEO4J_METRIC_NAME_PREFIX = \"neo4j\";    void afterBeanDiscovery(@Observes AfterBeanDiscovery addEvent) {        addEvent.addBean()                .types(Driver.class)                .qualifiers(Default.Literal.INSTANCE, Any.Literal.INSTANCE)                .scope(ApplicationScoped.class)                .name(Driver.class.getName())                .beanClass(Driver.class)                .createWith(creationContext -> {                    org.eclipse.microprofile.config.Config config = ConfigProvider.getConfig();                    Config helidonConfig = MpConfig.toHelidonConfig(config).get(NEO4J_METRIC_NAME_PREFIX);                     ConfigValue&lt;Neo4j> configValue = helidonConfig.as(Neo4j::create);                    if (configValue.isPresent()) {                        return configValue.get().driver();                    }                    throw new Neo4jException(\"There is no Neo4j driver configured in configuration under key 'neo4j\");                });    } } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 SE:<\/p>\n<pre><code class=\"java\">Config helidonConfig = MpConfig.toHelidonConfig(config).get(NEO4J_METRIC_NAME_PREFIX); <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0448 support \u043e\u0431\u044a\u0435\u043a\u0442 Neo4j SE:<\/p>\n<pre><code class=\"java\">ConfigValue&lt;Neo4j> configValue = helidonConfig.as(Neo4j::create);<\/code><\/pre>\n<p>\u2026 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440:<\/p>\n<pre><code class=\"java\">return configValue.get().driver();<\/code><\/pre>\n<p>\u0418 \u0442\u043e\u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0435 &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440:<\/p>\n<pre><code class=\"java\">@Inject public MovieRepository(Driver driver) {    this.driver = driver; } <\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <code>microprofile-config.properties<\/code>:<\/p>\n<pre><code class=\"yaml\"># Neo4j settings neo4j.uri=bolt:\/\/localhost:7687 neo4j.authentication.username=neo4j neo4j.authentication.password: secret neo4j.pool.metricsEnabled: true <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 SE.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c  \u0438 Helidon MP \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Neo4j!<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435!<\/p>\n<h3>\u041c\u0435\u0442\u0440\u0438\u043a\u0438<\/h3>\n<p>\u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b, \u0434\u043b\u044f \u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0430\u0445 \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 health checks \u0438\u0437 Neo4j.<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435 &#8212; \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043b\u044f SE, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0435 \u043e\u0431\u0435\u0440\u043d\u0435\u043c \u0432 MP. <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043c\u0435\u0442\u0440\u0438\u043a! \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043c\u0435\u0442\u0440\u0438\u043a Neo4j.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 Helidon SE, \u0432 support \u043e\u0431\u044a\u0435\u043a\u0442\u0435 Neo4j \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u0443 Builder \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043c\u0435\u0442\u0440\u0438\u043a.\u00a0\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Neo4j, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"java\">public static class Builder implements io.helidon.common.Builder&lt;Neo4jMetricsSupport> {    private Driver driver;    private Builder() {    }    public Neo4jMetricsSupport build() {        Objects.requireNonNull(driver, \"Must set driver before building\");        return new Neo4jMetricsSupport(this);    }    public Builder driver(Driver driver) {        this.driver = driver;        return this;    } } <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c counter\u2013\u044b \u0438 gauge\u2013\u044b Neo4j:<\/p>\n<pre><code class=\"java\">private static class Neo4JCounterWrapper implements Counter {    private final Supplier&lt;Long> fn;    private Neo4JCounterWrapper(Supplier&lt;Long> fn) {        this.fn = fn;    }    @Override    public void inc() {        throw new UnsupportedOperationException();    }    @Override    public void inc(long n) {        throw new UnsupportedOperationException();    }    @Override    public long getCount() {        return fn.get();    } }  private static class Neo4JGaugeWrapper&lt;T> implements Gauge&lt;T> {    private final Supplier&lt;T> supplier;    private Neo4JGaugeWrapper(Supplier&lt;T> supplier) {        this.supplier = supplier;    }    @Override    public T getValue() {        return supplier.get();    } } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438 \u0432 MetricsRegistry:<\/p>\n<pre><code class=\"java\">private void registerCounter(MetricRegistry metricRegistry,                             ConnectionPoolMetrics cpm,                             String poolPrefix,                             String name,                             Function&lt;ConnectionPoolMetrics, Long> fn) {    String counterName = poolPrefix + name;    if (metricRegistry.getCounters().get(new MetricID(counterName)) == null) {        Metadata metadata = Metadata.builder()                .withName(counterName)                .withType(MetricType.COUNTER)                .notReusable()                .build();        Neo4JCounterWrapper wrapper = new Neo4JCounterWrapper(() -> fn.apply(cpm));        metricRegistry.register(metadata, wrapper);    } } private void registerGauge(MetricRegistry metricRegistry,                           ConnectionPoolMetrics cpm,                           String poolPrefix,                           String name,                           Function&lt;ConnectionPoolMetrics, Integer> fn) {    String gaugeName = poolPrefix + name;    if (metricRegistry.getGauges().get(new MetricID(gaugeName)) == null) {        Metadata metadata = Metadata.builder()                .withName(poolPrefix + name)                .withType(MetricType.GAUGE)                .notReusable()                .build();        Neo4JGaugeWrapper&lt;Integer> wrapper =                new Neo4JGaugeWrapper&lt;>(() -> fn.apply(cpm));        metricRegistry.register(metadata, wrapper);    } } <\/code><\/pre>\n<p>\u0418 \u043c\u044b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u043e\u0442\u043e\u0432\u044b:<\/p>\n<pre><code class=\"java\">private void reinit() {    Map&lt;String, Function&lt;ConnectionPoolMetrics, Long>> counters = Map.ofEntries(            entry(\"acquired\", ConnectionPoolMetrics::acquired),            entry(\"closed\", ConnectionPoolMetrics::closed),            entry(\"created\", ConnectionPoolMetrics::created),            entry(\"failedToCreate\", ConnectionPoolMetrics::failedToCreate),            entry(\"timedOutToAcquire\", ConnectionPoolMetrics::timedOutToAcquire),            entry(\"totalAcquisitionTime\", ConnectionPoolMetrics::totalAcquisitionTime),            entry(\"totalConnectionTime\", ConnectionPoolMetrics::totalConnectionTime),            entry(\"totalInUseCount\", ConnectionPoolMetrics::totalInUseCount),            entry(\"totalInUseTime\", ConnectionPoolMetrics::totalInUseTime));     Map&lt;String, Function&lt;ConnectionPoolMetrics, Integer>> gauges = Map.ofEntries(            entry(\"acquiring\", ConnectionPoolMetrics::acquiring),            entry(\"creating\", ConnectionPoolMetrics::creating),            entry(\"idle\", ConnectionPoolMetrics::idle),            entry(\"inUse\", ConnectionPoolMetrics::inUse)    );    for (ConnectionPoolMetrics it : lastPoolMetrics.get()) {        String poolPrefix = NEO4J_METRIC_NAME_PREFIX + \"-\";        counters.forEach((name, supplier) -> registerCounter(metricRegistry.get(), it, poolPrefix, name, supplier));        gauges.forEach((name, supplier) -> registerGauge(metricRegistry.get(), it, poolPrefix, name, supplier));        \/\/ we only care about the first one        metricsInitialized.set(true);        break;    } } <\/code><\/pre>\n<p>\u0412\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"java\">private void refreshMetrics(ScheduledExecutorService executor) {    Collection&lt;ConnectionPoolMetrics> currentPoolMetrics = driver.metrics().connectionPoolMetrics();    if (!metricsInitialized.get() &amp;&amp; currentPoolMetrics.size() >= 1) {        lastPoolMetrics.set(currentPoolMetrics);        reinit();        if (metricsInitialized.get()) {            reinitFuture.get().cancel(false);            executor.shutdown();        }    } } <\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Neo4j \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u0445 \u0432 \u043d\u0430\u0448\u0435\u043c \u0444\u0430\u0439\u043b\u0435 application.yaml:<\/p>\n<pre><code class=\"yaml\">neo4j:  pool:    metricsEnabled: true <\/code><\/pre>\n<p>\u2026 \u0418\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c\u00a0<strong>microprofile-config.properties<\/strong>\u00a0:<\/p>\n<pre><code class=\"java\">neo4j.pool.metricsEnabled = true <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0439\u0434\u0435\u0442\u0435 \u043f\u043e \u00ab\/health\u00bb, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043e\u0442 Neo4j.<\/p>\n<p>\u0414\u043b\u044f MP, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u0440\u0438\u043a \u043a\u0430\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 CDI.\u00a0\u0421\u043e\u0431\u044b\u0442\u0438\u0435 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d:<\/p>\n<pre><code class=\"java\">public class Neo4jMetricsCdiExtension implements Extension {    private void addMetrics(@Observes @Priority(PLATFORM_AFTER + 101) @Initialized(ApplicationScoped.class) Object event) {        Instance&lt;Driver> driver = CDI.current().select(Driver.class);        Neo4jMetricsSupport.builder()                .driver(driver.get())                .build()                .initialize();    } } <\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435!\u00a0\u041c\u0435\u0442\u0440\u0438\u043a\u0438 Neo4j \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438 \u0432 Helidon MP!<\/p>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u043d\u043e \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0435, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438!<\/p>\n<h3>Health Checks<\/h3>\n<p>\u0418 \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u0447\u0438\u0441\u0442\u043e \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u043e.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0441 MP:<\/p>\n<pre><code class=\"java\">@Readiness @ApplicationScoped public class Neo4jHealthCheck implements HealthCheck {    private static final String CYPHER = \"RETURN 1 AS result\";    private static final SessionConfig DEFAULT_SESSION_CONFIG = SessionConfig.builder()            .withDefaultAccessMode(AccessMode.WRITE)            .build();    private final Driver driver;       @Inject    \/\/will be ignored outside of CDI    Neo4jHealthCheck(Driver driver) {        this.driver = driver;    }    public static Neo4jHealthCheck create(Driver driver) {        return new Neo4jHealthCheck(driver);    }    private static HealthCheckResponse buildStatusUp(ResultSummary resultSummary, HealthCheckResponseBuilder builder) {        ServerInfo serverInfo = resultSummary.server();        builder.withData(\"server\", serverInfo.version() + \"@\" + serverInfo.address());        String databaseName = resultSummary.database().name();        if (!(databaseName == null || databaseName.trim().isEmpty())) {            builder.withData(\"database\", databaseName.trim());        }        return builder.build();    }    @Override    public HealthCheckResponse call() {        HealthCheckResponseBuilder builder = HealthCheckResponse.named(\"Neo4j connection health check\").up();        try {            ResultSummary resultSummary;            \/\/ Retry one time when the session has been expired            try {                resultSummary = runHealthCheckQuery();            } catch (SessionExpiredException sessionExpiredException) {                resultSummary = runHealthCheckQuery();            }            return buildStatusUp(resultSummary, builder);        } catch (Exception e) {            return builder.down().withData(\"reason\", e.getMessage()).build();        }    }    private ResultSummary runHealthCheckQuery() {        \/\/ We use WRITE here to make sure UP is returned for a server that supports        \/\/ all possible workloads        if (driver != null) {            Session session = this.driver.session(DEFAULT_SESSION_CONFIG);            Result run = session.run(CYPHER);            return run.consume();        }        return null;    } } <\/code><\/pre>\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f health check-a, \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 Cypher, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0437\u043d\u0430\u0447\u0438\u0442, Neo4j \u0436\u0438\u0432, \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e!<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c Maven \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<pre><code class=\"xml\">&lt;dependency>    &lt;groupId>io.helidon.integrations.neo4j&lt;\/groupId>    &lt;artifactId>helidon-integrations-neo4j-health&lt;\/artifactId> &lt;\/dependency> <\/code><\/pre>\n<p>\u0418 \u0441\u043d\u043e\u0432\u0430 &#8212; <em>\u0412\u0443\u0430\u043b\u044f, \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/em>!<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f SE, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0447\u0438\u0441\u0442\u0430\u044f Java, \u043d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"java\">Neo4j neo4j = Neo4j.create(config.get(\"neo4j\")); Neo4jHealthCheck healthCheck = Neo4jHealthCheck.create(neo4j.driver()); Driver neo4jDriver = neo4j.driver(); HealthSupport health = HealthSupport.builder()      .addLiveness(HealthChecks.healthChecks())   \/\/ Adds a convenient set of checks      .addReadiness(healthCheck)      .build();  return Routing.builder()         .register(health)                   \/\/ Health at \"\/health\"         \/\/other services         .build(); } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0435 Helidon \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u0430\u043a MP, \u0442\u0430\u043a \u0438 SE, \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Neo4j, \u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c health checks.\u00a0<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Neo4j \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 GraalVM native-image, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Helidon MP \u0438\u043b\u0438 SE \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b!<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0441 Helidon.\u00a0\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f Neo4j, \u043c\u044b \u0443\u0436\u0435 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e \u0437\u0430 \u0432\u0430\u0441!<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0438 Maven \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"xml\">&lt;dependency>    &lt;groupId>io.helidon.integrations.neo4j&lt;\/groupId>    &lt;artifactId>helidon-integrations-neo4j&lt;\/artifactId> &lt;\/dependency> &lt;dependency>    &lt;groupId>io.helidon.integrations.neo4j&lt;\/groupId>    &lt;artifactId>helidon-integrations-neo4j-metrics&lt;\/artifactId> &lt;\/dependency> &lt;dependency>    &lt;groupId>io.helidon.integrations.neo4j&lt;\/groupId>    &lt;artifactId>helidon-integrations-neo4j-health&lt;\/artifactId> &lt;\/dependency> <\/code><\/pre>\n<p>\u2026 \u0418 \u044d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Helidon \u0438 Neo4j!<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Helidon \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430.\u00a0\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e &#8212; \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c support\u043e\u0431\u044a\u0435\u043a\u0442 Helidon SE, \u0441\u043b\u0435\u0434\u0443\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0443 Builder \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0433\u043e \u0432 CDI \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b MicroProfile \u043c\u043e\u0433 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 &#171;\u043c\u0430\u0433\u0438\u0435\u0439&#187;!<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 Helidon \u0438\u043d Neo4j \u0432 \u043d\u0430\u0448\u0435\u043c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u00a0<a href=\"https:\/\/github.com\/oracle\/helidon\/tree\/master\/examples\/integrations\/neo4j\" rel=\"noopener noreferrer nofollow\"><u>\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Helidon Neo4j<\/u><\/a>\u00a0.<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f Neo4j, \u0432\u0430\u0441 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c\u00a0<a href=\"https:\/\/github.com\/neo4j-contrib\/cypher-dsl\" rel=\"noopener noreferrer nofollow\"><u>CypherDsl<\/u><\/a>\u00a0\u0438\u00a0<a href=\"https:\/\/github.com\/neo4j-contrib\/cypher-dsl\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u0438\u043c\u0435\u0440<\/u><\/a>\u00a0\u0441 \u043d\u0438\u043c.<\/p>\n<h2>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u043a\u0430\u043a Neo4j \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Helidon, \u043d\u043e \u0438 \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.\u00a0\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Helidon \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441\u043d\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u043c\u044b \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0430\u0441 \u0432 \u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u0442\u044c!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/584796\/\"> https:\/\/habr.com\/ru\/articles\/584796\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0434\u0435\u044f \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 Neo4j \u0441 Helidon \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e. <\/p>\n<blockquote>\n<p><em>Neo4j \u2014 \u0433\u0440\u0430\u0444\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 Java. \u041f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043d\u0430 2015 \u0433\u043e\u0434 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u043e\u0432\u043e\u0439 \u0421\u0423\u0411\u0414. (\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044f, 21.10.2021) <\/em><\/p>\n<\/blockquote>\n<p>Neo4j \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Java \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438\u0437 \u041f\u041e, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044f\u0437\u044b\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 Cypher, \u0447\u0435\u0440\u0435\u0437 HTTP endpoint \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u00abbolt\u00bb. Neo4j \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u043e\u0432\u044b\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u0442\u0440\u0430\u0441\u043b\u044f\u0445. <\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u0432 \u0441\u0435 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430 \u0441 Michael Simonis, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 Spring Data Neo4j 6 \u0438 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u044e\u0449\u0438\u043c Neo4j-OGM. \u041c\u044b \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u041c\u0438\u0445\u0430\u0435\u043b\u044f, \u0447\u0442\u043e \u043e\u043d \u0434\u0443\u043c\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a Helidon \u0438 Neo4J \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435. \u041c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0447\u0430\u0441 \u041c\u0438\u0445\u0430\u0435\u043b\u044c \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043c\u043d\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0434\u043b\u044f Helidon MP \u0438 Neo4j SDN. <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u0434, \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u0441\u0442\u0440\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 pom.xml:<\/p>\n<pre><code class=\"xml\">&lt;dependency>     &lt;groupId>org.springframework.data&lt;\/groupId>     &lt;artifactId>spring-data-neo4j&lt;\/artifactId> &lt;\/dependency><\/code><\/pre>\n<p>Spring? \u0414\u0430 \u043b\u0430\u0434\u043d\u0430! \u041f\u043e\u0447\u0435\u043c\u0443 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c Spring? <\/p>\n<p>\u041d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043a\u043e\u0434, \u044f \u0431\u044b\u043b \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d, \u0443\u0432\u0438\u0434\u0435\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 CDI 2.0, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430. \u042d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 CDI \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 Helidon, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 CDI &#8212; \u0448\u0438\u043a\u0430\u0440\u043d\u043e! \u042f \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043a\u0440\u0430\u0441\u043e\u0442\u0443 \u0438 \u0441\u0438\u043b\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432. <\/p>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u043d\u044c \u041c\u0438\u0445\u0430\u0435\u043b\u044c \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043c\u043d\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u043f\u043e. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043e\u043d \u0432\u043a\u043b\u044e\u0447\u0438\u043b \u0441\u0432\u043e\u0438 \u0438\u0434\u0435\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Neo4j \u0441 Helidon SE. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0442\u043e\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u0411\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Helidon Config \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0432\u0441\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Neo4j \u0432 \u0435\u0434\u0438\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e. \u0410 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Neo4j \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 native image, \u0432\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 native-image \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430. <\/p>\n<p>\u042d\u0442\u043e \u043f\u043e\u0440\u043e\u0434\u0438\u043b\u043e \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 Helidon \u0438 Neo4j \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f Helidon. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e! <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u043d\u0441\u0443\u043b\u044c\u0442\u0430\u0446\u0438\u0439 \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u0435\u043c Neo4j \u0438 \u043c\u043e\u0438\u043c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u041c\u0438\u0445\u0430\u0435\u043b\u0435\u043c \u0421\u0438\u043c\u043e\u043d\u0438\u0441\u043e\u043c \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c Helidon. \u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 Health Checks \u0438\u0437 Neo4j \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u0432 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 Helidon \/ MicroProfile \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 &#8212; \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 Maven. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e Neo4j \u0441 Helidon? \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0432\u0435 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0438 Helidon &#8212; MP \u0438 SE. SE \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 API, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0439 Java. \u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u00ab\u043c\u0430\u0433\u0438\u0438\u00bb \u0432\u0440\u043e\u0434\u0435 \u0440\u0435\u0444\u043b\u0435\u043a\u0448\u0430\u043d\u0430 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u0435\u0439. Helidon MP, \u043f\u043e \u0441\u0443\u0442\u0438, \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 SE \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c MicroProfile. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 Neo4j \u0434\u043b\u044f Helidon SE, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0435 \u043a\u0430\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f CDI \u0434\u043b\u044f Helidon MP.<\/p>\n<h3>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e! <\/h3>\n<blockquote>\n<p><em>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Helidon \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 Apache 2.0, \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Helidon.<\/em> <\/p>\n<\/blockquote>\n<p>\u0412 Helidon \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 support \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438. \u042d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041c\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u043c Builder pattern \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 Builder, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"java\">public Builder config(Config config) {    config.get(\"authentication.username\").asString().ifPresent(this::username);    config.get(\"authentication.password\").asString().ifPresent(this::password);    config.get(\"authentication.enabled\").asBoolean().ifPresent(this::authenticationEnabled);    config.get(\"uri\").asString().ifPresent(this::uri);    config.get(\"encrypted\").asBoolean().ifPresent(this::encrypted);    \/\/pool    config.get(\"pool.metricsEnabled\").asBoolean().ifPresent(this::metricsEnabled);    config.get(\"pool.logLeakedSessions\").asBoolean().ifPresent(this::logLeakedSessions);    config.get(\"pool.maxConnectionPoolSize\").asInt().ifPresent(this::maxConnectionPoolSize);    config.get(\"pool.idleTimeBeforeConnectionTest\").as(Duration.class).ifPresent(this::idleTimeBeforeConnectionTest);    config.get(\"pool.maxConnectionLifetime\").as(Duration.class).ifPresent(this::maxConnectionLifetime);    config.get(\"pool.connectionAcquisitionTimeout\").as(Duration.class).ifPresent(this::connectionAcquisitionTimeout);    \/\/trust       config.get(\"trustsettings.trustStrategy\").asString().map(TrustStrategy::valueOf).ifPresent(this::trustStrategy);    config.get(\"trustsettings.certificate\").as(Path.class).ifPresent(this::certificate);    config.get(\"trustsettings.hostnameVerificationEnabled\").asBoolean().ifPresent(this::hostnameVerificationEnabled);    return this; } <\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u043e\u043d\u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u043f\u0440\u0438\u0447\u0435\u043c, \u043b\u0438\u0431\u043e \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 SE, \u043b\u0438\u0431\u043e \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 MicroProfile. \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0443 Builder:<\/p>\n<pre><code class=\"java\">... public Builder password(String password) {    Objects.requireNonNull(password);    this.password = password;    return this; } ... <\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0431\u0438\u043b\u0434\u0438\u0442\u044c support \u043e\u0431\u044a\u0435\u043a\u0442:<\/p>\n<pre><code class=\"java\">@Override public Neo4j build() {    if (driver == null) {        driver = initDriver();    }    return new Neo4j(this); } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430 (\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u043f\u0443\u0449\u0435\u043d\u044b):<\/p>\n<pre><code class=\"java\">private Driver initDriver() {    AuthToken authToken = AuthTokens.none();    if (authenticationEnabled) {        authToken = AuthTokens.basic(username, password);    }    org.neo4j.driver.Config.ConfigBuilder configBuilder = createBaseConfig();    configureSsl(configBuilder);    configurePoolSettings(configBuilder);    return GraphDatabase.driver(uri, authToken, configBuilder.build()); } <\/code><\/pre>\n<p> Support \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0440\u0430\u0439\u0432\u0435\u0440:<\/p>\n<pre><code class=\"java\">public Driver driver() {    return driver; } <\/code><\/pre>\n<p>&#8230; \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"java\">Neo4jMetricsSupport.builder()        .driver(neo4j.driver())        .build()        .initialize(); Driver neo4jDriver = neo4j.driver(); <\/code><\/pre>\n<p>Helidon \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 application.yaml:<\/p>\n<pre><code class=\"yaml\">neo4j:  uri: bolt:\/\/localhost:7687  authentication:    username: neo4j    password: secret  pool:    metricsEnabled: true <\/code><\/pre>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0435 &#8212; \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435:<\/p>\n<pre><code class=\"java\">public List&lt;Movie> findAll(){    try (var session = driver.session()) {        var query = \"\"                + \"match (m:Movie) \"                + \"match (m) &lt;- [:DIRECTED] - (d:Person) \"                + \"match (m) &lt;- [r:ACTED_IN] - (a:Person) \"                + \"return m, collect(d) as directors, collect({name:a.name, roles: r.roles}) as actors\";        return session.readTransaction(tx -> tx.run(query).list(r -> {            var movieNode = r.get(\"m\").asNode();            var directors = r.get(\"directors\").asList(v -> {                var personNode = v.asNode();                return new Person(personNode.get(\"born\").asInt(), personNode.get(\"name\").asString());            });            var actors = r.get(\"actors\").asList(v -> {                return new Actor(v.get(\"name\").asString(), v.get(\"roles\").asList(Value::asString));            });            var m = new Movie(movieNode.get(\"title\").asString(), movieNode.get(\"tagline\").asString());            m.setReleased(movieNode.get(\"released\").asInt());            m.setDirectorss(directors);            m.setActors(actors);            return m;        }));    } } <\/code><\/pre>\n<p>\u0418\u00a0<em>\u0432\u0443\u0430\u043b\u044f<\/em>!\u00a0Helidon \u0438 Neo4j \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>\u0410 \u043a\u0430\u043a \u0436\u0435 MP?\u00a0<\/p>\n<p>\u041d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430\u0448\u0443 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 CDI &#8212; \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"java\">public class Neo4jCdiExtension implements Extension {    private static final String NEO4J_METRIC_NAME_PREFIX = \"neo4j\";    void afterBeanDiscovery(@Observes AfterBeanDiscovery addEvent) {        addEvent.addBean()                .types(Driver.class)                .qualifiers(Default.Literal.INSTANCE, Any.Literal.INSTANCE)                .scope(ApplicationScoped.class)                .name(Driver.class.getName())                .beanClass(Driver.class)                .createWith(creationContext -> {                    org.eclipse.microprofile.config.Config config = ConfigProvider.getConfig();                    Config helidonConfig = MpConfig.toHelidonConfig(config).get(NEO4J_METRIC_NAME_PREFIX);                     ConfigValue&lt;Neo4j> configValue = helidonConfig.as(Neo4j::create);                    if (configValue.isPresent()) {                        return configValue.get().driver();                    }                    throw new Neo4jException(\"There is no Neo4j driver configured in configuration under key 'neo4j\");                });    } } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 SE:<\/p>\n<pre><code class=\"java\">Config helidonConfig = MpConfig.toHelidonConfig(config).get(NEO4J_METRIC_NAME_PREFIX); <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0448 support \u043e\u0431\u044a\u0435\u043a\u0442 Neo4j SE:<\/p>\n<pre><code class=\"java\">ConfigValue&lt;Neo4j> configValue = helidonConfig.as(Neo4j::create);<\/code><\/pre>\n<p>\u2026 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440:<\/p>\n<pre><code class=\"java\">return configValue.get().driver();<\/code><\/pre>\n<p>\u0418 \u0442\u043e\u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0435 &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440:<\/p>\n<pre><code class=\"java\">@Inject public MovieRepository(Driver driver) {    this.driver = driver; } <\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <code>microprofile-config.properties<\/code>:<\/p>\n<pre><code class=\"yaml\"># Neo4j settings neo4j.uri=bolt:\/\/localhost:7687 neo4j.authentication.username=neo4j neo4j.authentication.password: secret neo4j.pool.metricsEnabled: true <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 SE.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c  \u0438 Helidon MP \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Neo4j!<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435!<\/p>\n<h3>\u041c\u0435\u0442\u0440\u0438\u043a\u0438<\/h3>\n<p>\u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b, \u0434\u043b\u044f \u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0430\u0445 \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 health checks \u0438\u0437 Neo4j.<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435 &#8212; \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043b\u044f SE, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0435 \u043e\u0431\u0435\u0440\u043d\u0435\u043c \u0432 MP. <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043c\u0435\u0442\u0440\u0438\u043a! \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043c\u0435\u0442\u0440\u0438\u043a Neo4j.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 Helidon SE, \u0432 support \u043e\u0431\u044a\u0435\u043a\u0442\u0435 Neo4j \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u0443 Builder \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043c\u0435\u0442\u0440\u0438\u043a.\u00a0\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Neo4j, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"java\">public static class Builder implements io.helidon.common.Builder&lt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-414820","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/414820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=414820"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/414820\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=414820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=414820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=414820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}