{"id":6423,"date":"2019-03-01T06:25:25","date_gmt":"2019-03-01T14:25:25","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=6423"},"modified":"2025-06-13T20:19:51","modified_gmt":"2025-06-14T03:19:51","slug":"create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/","title":{"rendered":"Criar uma arquitetura de microsservi\u00e7o Java de n\u00edvel de produ\u00e7\u00e3o com o JHipster e o Couchbase"},"content":{"rendered":"<p><em><span style=\"font-weight: 400\">Tayeb Chlyah \u00e9 um arquiteto l\u00edder em Java com s\u00f3lida experi\u00eancia em aplicativos de desempenho em larga escala, microsservi\u00e7os e bancos de dados NoSQL. Ele desenvolveu algumas bibliotecas Java de c\u00f3digo aberto para o Couchbase.<\/span><\/em><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Introdu\u00e7\u00e3o<\/b><\/h2>\n<p><span style=\"font-weight: 400\">Todo desenvolvedor bem-sucedido precisa se manter atualizado com as novas tecnologias de ponta e as tend\u00eancias emergentes, experimentando-as, brincando com elas, verificando se elas podem se encaixar em um projeto e como podem melhor\u00e1-las.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Mas como \u00e9 poss\u00edvel conseguir isso em um mundo em r\u00e1pida mudan\u00e7a, onde novas tecnologias e estruturas surgem diariamente?<\/span><\/p>\n<p><span style=\"font-weight: 400\">Se voc\u00ea \u00e9 um desenvolvedor Java full-stack, tem muita sorte: o JHipster \u00e9 a solu\u00e7\u00e3o para aprender rapidamente novas tecnologias da melhor maneira. Ele \u00e9 um <\/span><a href=\"https:\/\/yeoman.io\/\"><span style=\"font-weight: 400\">Gerador Yeoman<\/span><\/a><span style=\"font-weight: 400\">O Spring Boot \u00e9 um sistema de andaimes que ajuda voc\u00ea a gerar aplicativos completos combinando uma das melhores estruturas de desenvolvimento da Web: back-end Spring Boot e front-end Angular ou React.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00c9 claro que voc\u00ea pode usar <\/span><a href=\"https:\/\/start.spring.io\/\"><span style=\"font-weight: 400\">Inicializa\u00e7\u00e3o do Spring<\/span><\/a><span style=\"font-weight: 400\">No entanto, implementar essas combina\u00e7\u00f5es com sucesso n\u00e3o \u00e9 nada trivial. Voc\u00ea precisa dedicar muito tempo ao estudo de cada conceito e, em seguida, tentar colar tudo, sem esquecer os testes, o que pode ser muito caro e propenso a erros. E, acima de tudo, isso pode desencoraj\u00e1-lo ou, na melhor das hip\u00f3teses, obrig\u00e1-lo a se concentrar em uma das estruturas.<\/span><\/p>\n<p><span style=\"font-weight: 400\">O JHipster cria aplicativos totalmente testados de forma r\u00e1pida e f\u00e1cil, usando pr\u00e1ticas recomendadas, metodologias e estrat\u00e9gias. Ele prop\u00f5e v\u00e1rias op\u00e7\u00f5es (Arquitetura <\/span><span style=\"font-weight: 400\">-<\/span><span style=\"font-weight: 400\"> mon\u00f3lito ou microsservi\u00e7os; banco de dados <\/span><span style=\"font-weight: 400\">- <\/span><span style=\"font-weight: 400\">SQL ou NoSQL; seguran\u00e7a <\/span><span style=\"font-weight: 400\">-<\/span><span style=\"font-weight: 400\"> autentica\u00e7\u00e3o por sess\u00e3o, JWT ou OAuth2; Outros <\/span><span style=\"font-weight: 400\">- <\/span><span style=\"font-weight: 400\">WebSocket, caches, Docker, Kubernetes...), que podem ajud\u00e1-lo a experimentar as melhores tecnologias dispon\u00edveis e escolher as combina\u00e7\u00f5es mais adequadas para o seu caso de uso.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Hoje, vamos nos concentrar em alguns dos novos conceitos de arquitetura mais importantes: microsservi\u00e7os e NoSQL com o Couchbase.<\/span><\/p>\n<h3><b>Por que o Couchbase?<\/b><\/h3>\n<p><span style=\"font-weight: 400\">O Couchbase \u00e9 um banco de dados NoSQL orientado a documentos. Com os bancos de dados de documentos, voc\u00ea tem um design sem esquema que permite alterar seus dados de forma livre e f\u00e1cil. Tamb\u00e9m \u00e9 poss\u00edvel armazenar toda a estrutura em um \u00fanico documento, evitando muitas jun\u00e7\u00f5es desnecess\u00e1rias, o que significa opera\u00e7\u00f5es de leitura e grava\u00e7\u00e3o naturalmente mais r\u00e1pidas.<\/span><\/p>\n<p><span style=\"font-weight: 400\">O Couchbase exp\u00f5e um r\u00e1pido armazenamento de valores-chave e um mecanismo de consulta avan\u00e7ado, juntamente com indexadores integrados para consultar dados com N1QL, uma linguagem semelhante a SQL para documentos JSON. Com sua arquitetura distribu\u00edda sem mestre, ele \u00e9 muito f\u00e1cil de dimensionar. Ele pode fornecer milh\u00f5es de opera\u00e7\u00f5es por segundo sem a necessidade de um cache de terceiros para executar. O Couchbase tamb\u00e9m vem com pesquisa de texto completo integrada, um mecanismo de an\u00e1lise e uma solu\u00e7\u00e3o m\u00f3vel completa.<\/span><\/p>\n<h3><b>Por que microsservi\u00e7os?<\/b><\/h3>\n<p><span style=\"font-weight: 400\">A arquitetura de microsservi\u00e7os \u00e9 um padr\u00e3o de desenvolvimento de sistemas de software que se concentra na cria\u00e7\u00e3o de aplicativos como um conjunto de servi\u00e7os pequenos, modulares e fracamente acoplados, permitindo uma entrega cont\u00ednua mais f\u00e1cil, melhor testabilidade, escalabilidade e melhor isolamento de falhas. Cada servi\u00e7o pode ser escrito em diferentes linguagens e pode usar diferentes t\u00e9cnicas de armazenamento de dados, o que permite a capacidade de organizar o desenvolvimento em v\u00e1rias equipes de recursos.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Mas os microsservi\u00e7os trazem alguns desafios: a decomposi\u00e7\u00e3o do aplicativo em servi\u00e7os pode ser muito complicada e \u00e9 uma arte. Os desenvolvedores tamb\u00e9m precisam lidar com a complexidade adicional de um sistema distribu\u00eddo.<\/span><\/p>\n<p><span style=\"font-weight: 400\">O JHipster lida com a maioria das complexidades dos microsservi\u00e7os: Descoberta e configura\u00e7\u00e3o de servi\u00e7os com o <\/span><a href=\"https:\/\/www.consul.io\/\"><span style=\"font-weight: 400\">C\u00f4nsul<\/span><\/a><span style=\"font-weight: 400\"> ou <\/span><a href=\"https:\/\/www.jhipster.tech\/jhipster-registry\/\"><span style=\"font-weight: 400\">Registro JHipster<\/span><\/a><span style=\"font-weight: 400\"> (<\/span><a href=\"https:\/\/cloud.spring.io\/spring-cloud-netflix\/spring-cloud-netflix.html\"><span style=\"font-weight: 400\">Netflix Eureka<\/span><\/a><span style=\"font-weight: 400\">, <\/span><a href=\"https:\/\/cloud.spring.io\/spring-cloud-config\/spring-cloud-config.html\"><span style=\"font-weight: 400\">Servidor de configura\u00e7\u00e3o do Spring Cloud<\/span><\/a><span style=\"font-weight: 400\">e painel de monitoramento), balanceamento de carga com <\/span><a href=\"https:\/\/github.com\/Netflix\/ribbon\"><span style=\"font-weight: 400\">Fita da Netflix<\/span><\/a><span style=\"font-weight: 400\">toler\u00e2ncia a falhas com <\/span><a href=\"https:\/\/github.com\/Netflix\/hystrix\"><span style=\"font-weight: 400\">Netflix Hystrix<\/span><\/a><span style=\"font-weight: 400\">e registro e monitoramento centralizados com <\/span><a href=\"https:\/\/www.jhipster.tech\/monitoring\/#jhipster-console\"><span style=\"font-weight: 400\">jhipster-console<\/span><\/a><span style=\"font-weight: 400\"> (pilha personalizada Elasticsearch, Logstash e Kibana) e muito mais.<\/span><\/p>\n<h2><b>Cria\u00e7\u00e3o de um microsservi\u00e7o de cervejaria<\/b><\/h2>\n<h3><b>Pr\u00e9-requisitos:<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Instalar <\/span><a href=\"https:\/\/docs.docker.com\/install\/\"><span style=\"font-weight: 400\">Mecanismo Docker<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Instalar <\/span><a href=\"https:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/index.html\"><span style=\"font-weight: 400\">JDK 8<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Instalar a vers\u00e3o LTS de 64 bits em <\/span><a href=\"https:\/\/nodejs.org\/\"><span style=\"font-weight: 400\">Node.js<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Instalar <\/span><a href=\"https:\/\/yarnpkg.com\/en\/docs\/install\"><span style=\"font-weight: 400\">Fios<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Instalar <\/span><a href=\"https:\/\/www.jhipster.tech\/installation\/\"><span style=\"font-weight: 400\">JHipster<\/span><\/a><span style=\"font-weight: 400\">:<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">yarn global add generator-jhipster<\/span><\/p>\n<h3><b>Gerar um gateway de API<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Para acessar nossos diferentes servi\u00e7os em uma arquitetura de microsservi\u00e7o, precisaremos de um <\/span><a href=\"https:\/\/microservices.io\/patterns\/apigateway.html\"><span style=\"font-weight: 400\">Gateway de API<\/span><\/a><span style=\"font-weight: 400\">. \u00c9 a entrada para seus microsservi\u00e7os. Ele fornece roteamento HTTP (<\/span><a href=\"https:\/\/github.com\/Netflix\/hystrix\"><span style=\"font-weight: 400\">Netflix Zuul<\/span><\/a><span style=\"font-weight: 400\">) e balanceamento de carga (<\/span><a href=\"https:\/\/github.com\/Netflix\/ribbon\"><span style=\"font-weight: 400\">Fita da Netflix<\/span><\/a><span style=\"font-weight: 400\">), qualidade dos servi\u00e7os (<\/span><a href=\"https:\/\/github.com\/Netflix\/zuul\"><span style=\"font-weight: 400\">Netflix Hystrix<\/span><\/a><span style=\"font-weight: 400\">), seguran\u00e7a (<\/span><a href=\"https:\/\/spring.io\/projects\/spring-security\"><span style=\"font-weight: 400\">Seguran\u00e7a do Spring<\/span><\/a><span style=\"font-weight: 400\">) e a documenta\u00e7\u00e3o da API (<\/span><a href=\"https:\/\/swagger.io\/solutions\/api-documentation\/\"><span style=\"font-weight: 400\">Swagger<\/span><\/a><span style=\"font-weight: 400\">) para todos os microevices.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Em uma janela de terminal:<\/span><\/p>\n<pre class=\"lang:default decode:true\">mkdir couchbase-jhipster-microservices-example\r\ncd couchbase-jhipster-microservices-example\r\nmkdir gateway\r\ncd gateway\r\njhipster<\/pre>\n<p><span style=\"font-weight: 400\">O JHipster pergunta sobre o tipo de aplicativo que voc\u00ea deseja criar e quais recursos deseja incluir. Voc\u00ea pode encontrar todos os detalhes sobre as op\u00e7\u00f5es dispon\u00edveis em <\/span><a href=\"https:\/\/www.jhipster.tech\"><span style=\"font-weight: 400\">Site da JHipster<\/span><\/a><span style=\"font-weight: 400\">.\u00a0<\/span><span style=\"font-weight: 400\">Use as respostas a seguir para gerar um gateway com suporte ao Couchbase.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6453\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image1-300x263.png\" alt=\"\" width=\"411\" height=\"361\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image1-300x263.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image1-1024x897.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image1-768x672.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image1-1536x1345.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image1-20x18.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image1-1320x1156.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image1.png 1600w\" sizes=\"auto, (max-width: 411px) 100vw, 411px\" \/><\/p>\n<h3><b>Gerar um aplicativo de microsservi\u00e7o de cervejaria<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Em <\/span><span style=\"font-weight: 400\">couchbase-jhipster-microservices-example<\/span><span style=\"font-weight: 400\">, crie um <\/span><span style=\"font-weight: 400\">cervejaria<\/span><span style=\"font-weight: 400\"> e, em seguida, execute o jhipster para gerar um microsservi\u00e7o com o banco de dados Couchbase com as seguintes respostas:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6454\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image2-300x259.png\" alt=\"\" width=\"406\" height=\"351\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image2-300x259.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image2-1024x883.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image2-768x662.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image2-1536x1325.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image2-20x17.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image2-1320x1139.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image2.png 1600w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/p>\n<h3><b>Gerar entidades de cervejaria<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Criar um arquivo <\/span><span style=\"font-weight: 400\">cervejaria.jh<\/span><span style=\"font-weight: 400\"> em <\/span><span style=\"font-weight: 400\">couchbase-jhipster-microservices-example<\/span><span style=\"font-weight: 400\"> com o seguinte <\/span><a href=\"https:\/\/www.jhipster.tech\/jdl\/\"><span style=\"font-weight: 400\">JDL<\/span><\/a><span style=\"font-weight: 400\"> (Linguagem de dom\u00ednio do JHipster):<\/span><\/p>\n<pre class=\"lang:default decode:true\">entidade Beer {\r\n   name String obrigat\u00f3rio,\r\n   category String obrigat\u00f3rio,\r\n   descri\u00e7\u00e3o String,\r\n   estilo String,\r\n   cervejaria String,\r\n   abv Float,\r\n   ibu Integer,\r\n   srm Integer,\r\n   upc Integer,\r\n   updated LocalDate\r\n}\r\n\r\nentidade Brewery {\r\n   name String obrigat\u00f3rio,\r\n   description String,\r\n   address String obrigat\u00f3rio maxlength(200),\r\n   cidade String,\r\n   c\u00f3digo String,\r\n   country String,\r\n   phone String padr\u00e3o(\/[0-9- .]+\/),\r\n   estado String,\r\n   website String,\r\n   updated LocalDate\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">paginar Cerveja com paginador<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">Paginar a Brewery com rolagem infinita<\/span><\/p>\n<p><span style=\"font-weight: 400\">Em uma janela de terminal, execute os seguintes comandos:<\/span><\/p>\n<pre class=\"lang:default decode:true\">cd cervejaria\r\njhipster import-jdl ..\/brewery.jh\r\ncd ..\/gateway\r\njhipster entidade cervejaria\r\njhipster entity beer<\/pre>\n<p><span style=\"font-weight: 400\">Quando solicitado a substituir arquivos, sempre responda a.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6455\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image3-300x95.png\" alt=\"\" width=\"388\" height=\"123\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image3-300x95.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image3-1024x323.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image3-768x242.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image3-1536x485.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image3-20x6.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image3-1320x417.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image3.png 1600w\" sizes=\"auto, (max-width: 388px) 100vw, 388px\" \/><\/p>\n<h3><b>Executar a arquitetura de microsservi\u00e7o<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Para executar nossa arquitetura, precisamos iniciar o seguinte:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Registro JHipster<\/span><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/www.keycloak.org\/\"><span style=\"font-weight: 400\">Chaveiro<\/span><\/a><span style=\"font-weight: 400\">: uma solu\u00e7\u00e3o de gerenciamento de identidade e acesso de c\u00f3digo aberto<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Servidor Couchbase<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Microsservi\u00e7o de cervejaria<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Gateway<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">Felizmente, o JHipster tem uma <\/span><a href=\"https:\/\/www.jhipster.tech\/docker-compose\/#docker-compose-subgen\"><span style=\"font-weight: 400\">Subgerador do docker-compose<\/span><\/a><span style=\"font-weight: 400\"> que iniciar\u00e1 todos os servi\u00e7os necess\u00e1rios sem dor de cabe\u00e7a. Mas, primeiro, precisamos criar nossos aplicativos. Em <\/span><span style=\"font-weight: 400\">couchbase-jhipster-microservices-example<\/span><span style=\"font-weight: 400\">:<\/span><\/p>\n<pre class=\"lang:default decode:true\">cd gateway\r\n.\/mvnw package -Pprod dockerfile:build -DskipTests\r\ncd ..\/brewery\r\n.\/mvnw package -Pprod dockerfile:build -DskipTests\r\ncd ...\r\nmkdir docker-compose &amp;&amp; cd docker-compose<\/pre>\n<p><span style=\"font-weight: 400\">Agora, podemos gerar <\/span><span style=\"font-weight: 400\">docker-compose.yml<\/span><span style=\"font-weight: 400\"> usando o comando e as respostas a seguir:<\/span><\/p>\n<pre class=\"lang:default decode:true\">jhipster docker-compose<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6456\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image4-300x162.png\" alt=\"\" width=\"417\" height=\"226\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-300x162.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4.png 512w\" sizes=\"auto, (max-width: 417px) 100vw, 417px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Para que nosso aplicativo funcione com um keycloak local, precisamos adicionar ao seu arquivo hosts (Windows: <\/span><span style=\"font-weight: 400\">C:\\Windows\\System32\\drivers\\etc\\hosts<\/span><span style=\"font-weight: 400\">, Mac\/Linux: <\/span><span style=\"font-weight: 400\">\/etc\/hosts<\/span><span style=\"font-weight: 400\">) a seguinte linha:<\/span><\/p>\n<pre class=\"lang:default decode:true\">127.0.0.1 keycloak<\/pre>\n<p><span style=\"font-weight: 400\">Antes de iniciar tudo, verifique se voc\u00ea configurou o Docker com mem\u00f3ria e CPUs suficientes e, em seguida, execute:<\/span><\/p>\n<pre class=\"lang:default decode:true\">docker-compose up<\/pre>\n<p><span style=\"font-weight: 400\">Quando tudo terminar de iniciar, abra um navegador para <\/span><b>Gateway<\/b><span style=\"font-weight: 400\"> (<\/span><a href=\"https:\/\/localhost:8080\/\"><span style=\"font-weight: 400\">https:\/\/localhost:8080\/<\/span><\/a><span style=\"font-weight: 400\">), clique em conta e, em seguida, fa\u00e7a login.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6459\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image4-1-300x185.png\" alt=\"\" width=\"300\" height=\"185\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-1-300x185.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-1-1024x632.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-1-768x474.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-1-1536x947.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-1-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-1-1320x814.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image4-1.png 1999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Voc\u00ea deve ser redirecionado para <\/span><b>keycloak<\/b><span style=\"font-weight: 400\">Fa\u00e7a login usando <\/span><b>administrador<\/b><span style=\"font-weight: 400\"> para usu\u00e1rio e senha.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6458\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image7-300x193.png\" alt=\"\" width=\"300\" height=\"193\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image7-300x193.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image7-1024x657.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image7-768x493.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image7-1536x986.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image7-20x13.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image7-1320x847.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image7.png 1999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Voc\u00ea retornar\u00e1 ao gateway, onde poder\u00e1 ver as interfaces de administra\u00e7\u00e3o, alterar o idioma, visualizar e editar suas entidades...<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6457\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image6-300x185.png\" alt=\"\" width=\"300\" height=\"185\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image6-300x185.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image6-1024x633.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image6-768x475.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image6-1536x950.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image6-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image6-1320x816.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image6.png 1999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6460\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image9-300x124.png\" alt=\"\" width=\"300\" height=\"124\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image9-300x124.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image9-1024x423.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image9-768x317.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image9-1536x635.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image9-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image9-1320x545.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image9.png 1999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3><b>Registro do JHipster<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Agora, abra seu navegador para <\/span><a href=\"https:\/\/localhost:8761\/\"><span style=\"font-weight: 400\">https:\/\/localhost:8761\/<\/span><\/a><span style=\"font-weight: 400\">. Voc\u00ea ser\u00e1 automaticamente conectado, pois j\u00e1 fez isso no keycloak, que \u00e9 a m\u00e1gica da autentica\u00e7\u00e3o oauth2.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6461\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image8-300x179.png\" alt=\"\" width=\"300\" height=\"179\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image8-300x179.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image8-1024x611.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image8-768x458.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image8-1536x917.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image8-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image8-1320x788.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image8.png 1999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Al\u00e9m de ser a espinha dorsal de seu aplicativo de microsservi\u00e7o, como \u00e9 um <\/span><b>servidor de descoberta<\/b><span style=\"font-weight: 400\"> com <\/span><a href=\"https:\/\/cloud.spring.io\/spring-cloud-netflix\/spring-cloud-netflix.html\"><span style=\"font-weight: 400\">Eureka<\/span><\/a><span style=\"font-weight: 400\"> que lida com roteamento, balanceamento de carga e escalabilidade, e um servidor de configura\u00e7\u00e3o com <\/span><a href=\"https:\/\/cloud.spring.io\/spring-cloud-config\/spring-cloud-config.html\"><span style=\"font-weight: 400\">Servidor de configura\u00e7\u00e3o do Spring Cloud<\/span><\/a><span style=\"font-weight: 400\"> que fornece a configura\u00e7\u00e3o do tempo de execu\u00e7\u00e3o de seus aplicativos, <\/span><a href=\"https:\/\/www.jhipster.tech\/jhipster-registry\/\"><span style=\"font-weight: 400\">Registro JHipster<\/span><\/a><span style=\"font-weight: 400\"> tamb\u00e9m \u00e9 um servidor de administra\u00e7\u00e3o, onde \u00e9 poss\u00edvel visualizar as inst\u00e2ncias, a integridade, as m\u00e9tricas e os registros do aplicativo.<\/span><\/p>\n<h2><b>Como isso funciona?<\/b><\/h2>\n<p><b>Acesso ao banco de dados<\/b><\/p>\n<p><span style=\"font-weight: 400\">Primeiro, voc\u00ea precisa acessar a inst\u00e2ncia do brewery-couchbase. Para isso, atualize <\/span><span style=\"font-weight: 400\">docker-compose\/docker-compose.yml<\/span><span style=\"font-weight: 400\"> para publicar sua porta de interface de administra\u00e7\u00e3o com o seguinte:<\/span><\/p>\n<pre class=\"lang:default decode:true\">brewery-couchbase:\r\n   build:\r\n   contexto: ..\/brewery\/src\/main\/docker\r\n   dockerfile: couchbase\/Couchbase.Dockerfile\r\n   ambiente:\r\n       - BUCKET=brewery\r\n   portas:\r\n       - 8091:8091<\/pre>\n<p><span style=\"font-weight: 400\">Vamos aplicar nossas altera\u00e7\u00f5es, em <\/span><span style=\"font-weight: 400\">docker-compose<\/span><span style=\"font-weight: 400\"> diret\u00f3rio:<\/span><\/p>\n<pre class=\"lang:default decode:true\">docker-compose up -d<\/pre>\n<p><span style=\"font-weight: 400\">Quando tudo estiver pronto, abra a interface de administra\u00e7\u00e3o do Couchbase em <\/span><a href=\"https:\/\/localhost:8091\/\"><span style=\"font-weight: 400\">https:\/\/localhost:8091\/<\/span><\/a><span style=\"font-weight: 400\">e, em seguida, fa\u00e7a login usando <\/span><b>Administrador<\/b><span style=\"font-weight: 400\"> como usu\u00e1rio e <\/span><b>senha<\/b><span style=\"font-weight: 400\"> como senha. Abrir <\/span><a href=\"https:\/\/localhost:8091\/ui\/index.html#!\/doc_editor?bucket=brewery\"><span style=\"font-weight: 400\">documentos de balde da cervejaria<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6462\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image12-300x179.png\" alt=\"\" width=\"300\" height=\"179\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image12-300x179.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image12-1024x612.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image12-768x459.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image12-1536x917.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image12-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image12-1320x788.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image12.png 1999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><b>Couchmove<br \/>\n<\/b><span style=\"font-weight: 400\">Como voc\u00ea pode ver, seu bucket j\u00e1 est\u00e1 preenchido com alguns documentos: O JHipster preenche os documentos de bootstrap usando <\/span><a href=\"https:\/\/github.com\/differentway\/couchmove\"><span style=\"font-weight: 400\">Couchmove<\/span><\/a><span style=\"font-weight: 400\">uma biblioteca de migra\u00e7\u00e3o de dados Java para o Couchbase, amplamente inspirada em <\/span><a href=\"https:\/\/flywaydb.org\/\"><span style=\"font-weight: 400\">Flyway<\/span><\/a><span style=\"font-weight: 400\">pois favorece muito mais a simplicidade e a conven\u00e7\u00e3o do que a configura\u00e7\u00e3o.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Voc\u00ea pode dar uma olhada nos arquivos changelog em<\/span><\/p>\n<pre class=\"lang:default decode:true\">brewery\/src\/main\/resources\/config\/couchmove\/changelog:\r\n\r\n<\/pre>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">V0.1__initial_setup<\/span><span style=\"font-weight: 400\"> diret\u00f3rio: cont\u00e9m documentos de usu\u00e1rio e de autoridade, usados por <\/span><a href=\"https:\/\/spring.io\/projects\/spring-security\"><span style=\"font-weight: 400\">Seguran\u00e7a do Spring<\/span><\/a><span style=\"font-weight: 400\"> para autenticar usu\u00e1rios.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">V0__create_indexes.n1ql<\/span><span style=\"font-weight: 400\">cria os \u00edndices necess\u00e1rios.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">Como Flyway ou <\/span><a href=\"https:\/\/www.liquibase.org\/\"><span style=\"font-weight: 400\">liquibase<\/span><\/a><span style=\"font-weight: 400\"> para bancos de dados SQL, <\/span><b>Couchmove<\/b><span style=\"font-weight: 400\"> mant\u00e9m <\/span><b>changelog<\/b><span style=\"font-weight: 400\"> documentos, mantendo o controle dos registros de altera\u00e7\u00f5es executados.<\/span><\/p>\n<h3><b>Spring Boot e Spring Data Couchbase<\/b><\/h3>\n<p><span style=\"font-weight: 400\">O JHipster gera um <\/span><a href=\"https:\/\/spring.io\/projects\/spring-boot\"><span style=\"font-weight: 400\">Spring Boot 2<\/span><\/a><span style=\"font-weight: 400\"> aplicativo e usos <\/span><a href=\"https:\/\/spring.io\/projects\/spring-data\"><span style=\"font-weight: 400\">Dados do Spring<\/span><\/a><span style=\"font-weight: 400\"> para acessar bancos de dados relacionais e n\u00e3o relacionais. No nosso caso, ele est\u00e1 usando <\/span><a href=\"https:\/\/projects.spring.io\/spring-data-couchbase\/\"><span style=\"font-weight: 400\">Dados do Spring Couchbase<\/span><\/a><span style=\"font-weight: 400\"> para fornecer integra\u00e7\u00e3o com o banco de dados do Couchbase Server. Mas ele vai muito al\u00e9m, personalizando o seu funcionamento:<\/span><\/p>\n<p><span style=\"font-weight: 400\">Por padr\u00e3o, o Spring Data Couchbase usa <\/span><a href=\"https:\/\/github.com\/spring-projects\/spring-data-couchbase\/blob\/master\/src\/main\/java\/org\/springframework\/data\/couchbase\/repository\/support\/N1qlCouchbaseRepository.java\"><span style=\"font-weight: 400\">N1qlCouchbaseRepository.java<\/span><\/a><span style=\"font-weight: 400\"> que utiliza o N1QL apenas para <\/span><a href=\"https:\/\/docs.spring.io\/spring-data\/rest\/docs\/2.0.0.M1\/reference\/html\/paging-chapter.html\"><span style=\"font-weight: 400\">pagina\u00e7\u00e3o ou classifica\u00e7\u00e3o<\/span><\/a> <b><i>findAll<\/i><\/b><span style=\"font-weight: 400\"> opera\u00e7\u00f5es. Todas as outras opera\u00e7\u00f5es est\u00e3o usando <\/span><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/3.x\/admin\/Views\/views-basics.html\"><span style=\"font-weight: 400\">visualiza\u00e7\u00f5es<\/span><\/a><span style=\"font-weight: 400\"> como voc\u00ea pode ver na implementa\u00e7\u00e3o do <\/span><a href=\"https:\/\/github.com\/spring-projects\/spring-data-couchbase\/tree\/master\/src\/integration\/java\/org\/springframework\/data\/couchbase\/repository\"><span style=\"font-weight: 400\">SimpleCouchbaseRepository.java<\/span><\/a><span style=\"font-weight: 400\">. Como os \u00edndices de visualiza\u00e7\u00e3o s\u00e3o sempre acessados do disco, eles n\u00e3o s\u00e3o t\u00e3o <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/4.0\/indexes\/mapreduce-view-performance.html\"><span style=\"font-weight: 400\">eficaz<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Vamos ver como o JHipster melhora esse comportamento:<\/span><\/p>\n<pre class=\"lang:default decode:true\">@Configura\u00e7\u00e3o\r\n@Profile(\"!\" + JHipsterConstants.SPRING_PROFILE_CLOUD)\r\n@EnableCouchbaseRepositories(repositoryBaseClass = CustomN1qlCouchbaseRepository.class, basePackages = \"com.couchbase.example.brewery.repository\")\r\n@Import(value = CouchbaseAutoConfiguration.class)\r\n@EnableCouchbaseAuditing(auditorAwareRef = \"springSecurityAuditorAware\")\r\npublic class DatabaseConfiguration {\r\n   ...\r\n   @Bean\r\n   p\u00fablico Couchmove couchmove(Bucket couchbaseBucket) {\r\n       log.debug(\"Configurando o Couchmove\");\r\n       Couchmove couchMove = novo Couchmove (couchbaseBucket, \"config\/couchmove\/changelog\");\r\n       couchMove.migrate();\r\n       return couchMove;\r\n   }\r\n   ...\r\n} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 400\">DatabaseConfiguration<\/span><span style=\"font-weight: 400\"> configura e inicia as migra\u00e7\u00f5es do Couchmove e tamb\u00e9m ativa os reposit\u00f3rios do Couchbase, mas com uma classe base personalizada: <\/span><span style=\"font-weight: 400\">CustomN1qlCouchbaseRepository<\/span><\/p>\n<pre class=\"lang:default decode:true\">public class CustomN1qlCouchbaseRepository extends N1qlCouchbaseRepository {\r\n   ...\r\n   @Override\r\n   public <s> S save(S entity) {\r\n       return super.save(populateIdIfNecessary(entity));\r\n   }\r\n   ...\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">Essa classe estende o reposit\u00f3rio padr\u00e3o para gerar automaticamente o ID do documento antes de salv\u00e1-lo e permite o uso do N1QL para todas as opera\u00e7\u00f5es implementando <\/span><span style=\"font-weight: 400\">CustomN1qlRespository<\/span><span style=\"font-weight: 400\"> interface:<\/span><\/p>\n<pre class=\"lang:default decode:true\">@NoRepositoryBean\r\npublic interface N1qlCouchbaseRepository extends CouchbasePagingAndSortingRepository {\r\n\r\n   @Query(\"#{#n1ql.selectEntity} WHERE #{#n1ql.filter}\")\r\n   List findAll();\r\n\r\n   @Query(\"SELECT count(*) FROM #{#n1ql.bucket} WHERE #{#n1ql.filter}\")\r\n   long count();\r\n\r\n   @Query(\"DELETE FROM #{#n1ql.bucket} WHERE #{#n1ql.filter} returning #{#n1ql.fields}\")\r\n   T removeAll();\r\n\r\n   default void deleteAll() {\r\n       removeAll();\r\n   }\r\n}\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Os IDs s\u00e3o gerados automaticamente usando <\/span><a href=\"https:\/\/docs.spring.io\/spring-data\/couchbase\/docs\/current\/api\/org\/springframework\/data\/couchbase\/core\/mapping\/id\/GeneratedValue.html\"><span style=\"font-weight: 400\">Valor Gerado<\/span><\/a><span style=\"font-weight: 400\"> com um prefixo usando <\/span><a href=\"https:\/\/docs.spring.io\/spring-data\/couchbase\/docs\/current\/api\/org\/springframework\/data\/couchbase\/core\/mapping\/id\/IdPrefix.html\"><span style=\"font-weight: 400\">IdPrefix<\/span><\/a><span style=\"font-weight: 400\"> que, por padr\u00e3o, \u00e9 o nome da classe, separado por <\/span><span style=\"font-weight: 400\">__<\/span><span style=\"font-weight: 400\"> delimitador.<\/span><\/p>\n<pre class=\"lang:default decode:true\">@Documento\r\npublic class Brewery implements Serializable {\r\n\r\n   private static final long serialVersionUID = 1L;\r\n\r\n   public static final String PREFIX = \"brewery\";\r\n\r\n   @SuppressWarnings(\"unused\")\r\n   @IdPrefix\r\n   private String prefix = PREFIX;\r\n\r\n   @Id\r\n   @GeneratedValue(strategy = UNIQUE, delimiter = ID_DELIMITER)\r\n   private String id;\r\n   ...\r\n}\r\n\r\n<\/pre>\n<h3><b>Testes<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Dissemos anteriormente que os aplicativos gerados pelo JHipster s\u00e3o totalmente testados com testes unit\u00e1rios e <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/integration-tests-couchbase-application\/\">testes de integra\u00e7\u00e3o<\/a>mas como isso funciona para os de integra\u00e7\u00e3o?<\/span><\/p>\n<p><span style=\"font-weight: 400\">Para o Couchbase, ele usa <\/span><a href=\"https:\/\/github.com\/differentway\/testcontainers-java-module-couchbase\"><span style=\"font-weight: 400\">Cont\u00eaineres de teste do Couchbase<\/span><\/a><span style=\"font-weight: 400\">que \u00e9 um m\u00f3dulo que estende <\/span><a href=\"https:\/\/www.testcontainers.org\/\"><span style=\"font-weight: 400\">cont\u00eaineres de teste<\/span><\/a><span style=\"font-weight: 400\">uma biblioteca Java que facilita o lan\u00e7amento de qualquer cont\u00eainer Docker durante os testes JUnit, para iniciar automaticamente uma inst\u00e2ncia do Couchbase Server e configur\u00e1-lo com os servi\u00e7os, usu\u00e1rios, buckets e \u00edndices necess\u00e1rios.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Para executar os testes, execute o seguinte comando em uma janela de terminal:<\/span><\/p>\n<pre class=\"lang:default decode:true\">.\/mvnw teste limpo<\/pre>\n<h2><b>Preencher alguns dados<\/b><\/h2>\n<p><span style=\"font-weight: 400\">Para preencher alguns dados, aproveitaremos as vantagens do <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/manage\/manage-settings\/install-sample-buckets.html\"><span style=\"font-weight: 400\">Baldes de amostra do Couchbase<\/span><\/a><span style=\"font-weight: 400\">. Abrir <\/span><b>Configura\u00e7\u00f5es<\/b><span style=\"font-weight: 400\"> guia, <\/span><b>Baldes de amostra<\/b><span style=\"font-weight: 400\">e, em seguida, selecione beer-sample (amostra de cerveja) e clique em <\/span><b>Carregar dados de amostra<\/b><span style=\"font-weight: 400\">. <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6463\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image10-300x185.png\" alt=\"\" width=\"300\" height=\"185\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image10-300x185.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image10-1024x633.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image10-768x475.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image10-1536x950.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image10-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image10-1320x816.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image10.png 1999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><span style=\"font-weight: 400\"> Voc\u00ea precisa modelar os dados em <\/span><a href=\"https:\/\/projects.spring.io\/spring-data-couchbase\/\"><span style=\"font-weight: 400\">Dados do Spring Couchbase<\/span><\/a><span style=\"font-weight: 400\"> formato de serializa\u00e7\u00e3o. Para isso, abra a guia Query (Consulta) e execute as seguintes consultas:<\/span><\/p>\n<pre class=\"lang:default decode:true\">INSERT INTO brewery (KEY k, VALUE v)\r\n  SELECT type || \"__\" || meta().id as k,\r\n  {\r\n     \"name\": nome,\r\n     \"category\": categoria,\r\n     \"description\": descri\u00e7\u00e3o,\r\n     \"style\": estilo,\r\n     \"brewery\": brewery_id,\r\n     \"abv\": abv,\r\n     \"ibu\": ibu,\r\n     \"srm\": srm,\r\n     \"upc\": upc,\r\n     \"updated\" (atualizado): STR_TO_MILLIS(updated),\r\n     \"_class\" : \"com.couchbase.example.brewery.domain.Beer\"\r\n  } as v\r\n  FROM `beer-sample` (amostra de cerveja)\r\n  WHERE type = 'beer';\r\n\r\nINSERT INTO cervejaria (KEY k, VALUE v)\r\n  SELECT type || \"__\" || meta().id as k,\r\n  {\r\n     \"name\": nome,\r\n     \"description\": descri\u00e7\u00e3o,\r\n     \"address\": endere\u00e7o[0],\r\n     \"country\": pa\u00eds,\r\n     \"website\": website,\r\n     \"code\": c\u00f3digo,\r\n     \"city\": cidade,\r\n     \"phone\": telefone,\r\n     \"state\": estado,\r\n     \"updated\" (atualizado): STR_TO_MILLIS(updated),\r\n     \"_class\" : \"com.couchbase.example.brewery.domain.Brewery\"\r\n  } as v\r\n  FROM `beer-sample`\r\n  WHERE type = 'brewery';<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6464\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image11-300x198.png\" alt=\"\" width=\"300\" height=\"198\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image11-300x198.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image11-1024x676.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image11-768x507.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image11-1536x1013.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image11-20x13.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image11-1320x871.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image11.png 1999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Aqui est\u00e1 um exemplo de um documento de cerveja inserido:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-6465\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/image13-300x256.png\" alt=\"\" width=\"300\" height=\"256\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image13-300x256.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image13-1024x874.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image13-768x656.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image13-20x17.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/image13.png 1293w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Agora vamos ver como o JHipster lida com documentos rec\u00e9m-inseridos. Navegue at\u00e9 <\/span><b>Gateway<\/b><span style=\"font-weight: 400\">, <\/span><b>Entidades<\/b><span style=\"font-weight: 400\">e, em seguida, abra <\/span><b>Cervejaria<\/b><span style=\"font-weight: 400\">. O JHipster carrega primeiro 20 cervejarias e, se voc\u00ea rolar a tela para baixo, ele carrega mais! Ele prop\u00f5e a navega\u00e7\u00e3o na p\u00e1gina para <\/span><b>Cerveja<\/b><span style=\"font-weight: 400\"> porque escolhemos esse comportamento ao gerar entidades com <\/span><span style=\"font-weight: 400\">cervejaria.jh<\/span><span style=\"font-weight: 400\"> JDL.<\/span><\/p>\n<pre class=\"lang:default decode:true\">paginar Cerveja com pager\r\npaginar Cervejaria com rolagem infinita<\/pre>\n<h2><b>C\u00f3digo-fonte<\/b><\/h2>\n<p><span style=\"font-weight: 400\">O c\u00f3digo-fonte dos aplicativos gerados est\u00e1 dispon\u00edvel em <\/span><a href=\"https:\/\/github.com\/tchlyah\/couchbase-jhipster-microservices-example\"><span style=\"font-weight: 400\">tchlyah\/couchbase-jhipster-microservices-example<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<h2><b>O que vem a seguir?<\/b><\/h2>\n<p><span style=\"font-weight: 400\">O JHipster, com a ajuda do Elasticsearch, prop\u00f5e uma op\u00e7\u00e3o que adiciona <\/span><a href=\"https:\/\/www.jhipster.tech\/using-elasticsearch\/\"><span style=\"font-weight: 400\">recursos de pesquisa<\/span><\/a><span style=\"font-weight: 400\"> sobre o banco de dados. Mas o Couchbase tem um recurso pronto para uso <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/products\/full-text-search\/\"><span style=\"font-weight: 400\">Pesquisa de texto completo<\/span><\/a><span style=\"font-weight: 400\"> que oferece amplos recursos para consultas em linguagem natural. Por que n\u00e3o implementar esse suporte no JHipster? Se voc\u00ea puder ajudar, n\u00e3o hesite em <\/span><a href=\"https:\/\/github.com\/jhipster\/generator-jhipster\/blob\/master\/CONTRIBUTING.md\"><span style=\"font-weight: 400\">contribuir<\/span><\/a><span style=\"font-weight: 400\">!<\/span><\/p>\n<p><span style=\"font-weight: 400\">Se voc\u00ea tiver alguma d\u00favida, envie-me um tweet para <\/span><a href=\"https:\/\/twitter.com\/tchlyah\"><span style=\"font-weight: 400\">@tchlyah<\/span><\/a><span style=\"font-weight: 400\"> ou deixe um coment\u00e1rio abaixo.<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>Tayeb Chlyah is a Java lead architect with solid experience on performance\u00a0large-scale applications, microservices, and NoSQL databases. He has developed a couple of open source Java libraries for Couchbase. &nbsp; Introduction Every successful developer needs to keep up to date [&hellip;]<\/p>","protected":false},"author":53,"featured_media":6466,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816,9417,1818],"tags":[1630],"ppma_author":[9026],"class_list":["post-6423","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-performance","category-java","tag-spring-boot"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java microservice architecture with JHipster &amp; Couchbase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create a production-grade Java microservice architecture with JHipster and Couchbase\" \/>\n<meta property=\"og:description\" content=\"Tayeb Chlyah is a Java lead architect with solid experience on performance\u00a0large-scale applications, microservices, and NoSQL databases. He has developed a couple of open source Java libraries for Couchbase. &nbsp; Introduction Every successful developer needs to keep up to date [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-01T14:25:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T03:19:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png\" \/>\n\t<meta property=\"og:image:width\" content=\"996\" \/>\n\t<meta property=\"og:image:height\" content=\"661\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Laura Czajkowski, Developer Community Manager, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Laura Czajkowski, Developer Community Manager, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/\"},\"author\":{\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220\"},\"headline\":\"Create a production-grade Java microservice architecture with JHipster and Couchbase\",\"datePublished\":\"2019-03-01T14:25:25+00:00\",\"dateModified\":\"2025-06-14T03:19:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/\"},\"wordCount\":1629,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png\",\"keywords\":[\"spring-boot\"],\"articleSection\":[\"Couchbase Server\",\"High Performance\",\"Java\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/\",\"name\":\"Java microservice architecture with JHipster & Couchbase\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png\",\"datePublished\":\"2019-03-01T14:25:25+00:00\",\"dateModified\":\"2025-06-14T03:19:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png\",\"width\":996,\"height\":661},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a production-grade Java microservice architecture with JHipster and Couchbase\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220\",\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9deb07d5daaa00220534c31768bc4409\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"caption\":\"Laura Czajkowski, Developer Community Manager, Couchbase\"},\"description\":\"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/pt\/author\/laura-czajkowski\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java microservice architecture with JHipster & Couchbase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/","og_locale":"pt_BR","og_type":"article","og_title":"Create a production-grade Java microservice architecture with JHipster and Couchbase","og_description":"Tayeb Chlyah is a Java lead architect with solid experience on performance\u00a0large-scale applications, microservices, and NoSQL databases. He has developed a couple of open source Java libraries for Couchbase. &nbsp; Introduction Every successful developer needs to keep up to date [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/","og_site_name":"The Couchbase Blog","article_published_time":"2019-03-01T14:25:25+00:00","article_modified_time":"2025-06-14T03:19:51+00:00","og_image":[{"width":996,"height":661,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png","type":"image\/png"}],"author":"Laura Czajkowski, Developer Community Manager, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Laura Czajkowski, Developer Community Manager, Couchbase","Est. reading time":"10 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/"},"author":{"name":"Laura Czajkowski, Developer Community Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220"},"headline":"Create a production-grade Java microservice architecture with JHipster and Couchbase","datePublished":"2019-03-01T14:25:25+00:00","dateModified":"2025-06-14T03:19:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/"},"wordCount":1629,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png","keywords":["spring-boot"],"articleSection":["Couchbase Server","High Performance","Java"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/","url":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/","name":"Java microservice architecture with JHipster & Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png","datePublished":"2019-03-01T14:25:25+00:00","dateModified":"2025-06-14T03:19:51+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/jhipster-1-.png","width":996,"height":661},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/create-a-production-grade-java-microservice-architecture-with-jhipster-and-couchbase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create a production-grade Java microservice architecture with JHipster and Couchbase"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220","name":"Laura Czajkowski, gerente da comunidade de desenvolvedores, Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9deb07d5daaa00220534c31768bc4409","url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","caption":"Laura Czajkowski, Developer Community Manager, Couchbase"},"description":"Laura Czajkowski \u00e9 a Snr. Developer Community Manager da Couchbase, supervisionando a comunidade. Ela \u00e9 respons\u00e1vel pelo nosso boletim informativo mensal para desenvolvedores.","url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/laura-czajkowski\/"}]}},"authors":[{"term_id":9026,"user_id":53,"is_guest":0,"slug":"laura-czajkowski","display_name":"Laura Czajkowski, Developer Community Manager, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","first_name":"Laura","last_name":"Czajkowski","user_url":"","author_category":"","description":"Laura Czajkowski \u00e9 a Snr. Developer Community Manager da Couchbase, supervisionando a comunidade. Ela \u00e9 respons\u00e1vel pelo nosso boletim informativo mensal para desenvolvedores."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/6423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=6423"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/6423\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/6466"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=6423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=6423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=6423"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=6423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}