{"id":2523,"date":"2017-02-03T18:46:36","date_gmt":"2017-02-03T18:46:36","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2523"},"modified":"2023-06-19T03:58:42","modified_gmt":"2023-06-19T10:58:42","slug":"microservice-using-docker-stack-deploy-wildfly-javaee-couchbase","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/","title":{"rendered":"Microservice using Docker stack deploy &#8211; WildFly, Java EE and Couchbase"},"content":{"rendered":"<p>There is plenty of material on\u00a0microservices, just <a href=\"https:\/\/lmgtfy.com\/?q=microservices\">google it<\/a>! I gave a presentation on\u00a0refactoring monolith to microservices at Devoxx Belgium a couple of years back and it has\u00a0good reviews:\n<\/p>\n<p>This blog will show how\u00a0Docker simplifies creation and shutting down of a microservice. All code used in this blog is at\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/couchbase-javaee\">github.com\/arun-gupta\/couchbase-javaee<\/a>.<\/p>\n<h2>Microservice Definition using Compose<\/h2>\n<p>Docker 1.13 introduced a <a href=\"https:\/\/docs.docker.com\/compose\/compose-file\/#version-3\">v3\u00a0of Docker Compose<\/a>. The changes in the syntax are minimal but the key difference is addition of <a href=\"https:\/\/docs.docker.com\/compose\/compose-file\/#\/deploy\">deploy<\/a> attribute. This attribute allows to specify replicas, rolling update and restart policy for the container. Our microservice will start a WldFly application server with a Java EE application pre-deployed. This application will talk to a Couchbase database to CRUD\u00a0application data. Here is the Compose definition:<\/p>\n<pre class=\"lang:default decode:true\">\r\nversion: &apos;3&apos;\r\nservices:\r\n  web:\r\n    image: arungupta\/couchbase-javaee:travel\r\n    environment:\r\n      - COUCHBASE_URI=db\r\n    ports:\r\n      - 8080:8080\r\n      - 9990:9990\r\n    depends_on:\r\n      - db\r\n  db:\r\n    image: arungupta\/couchbase:travel\r\n    ports:\r\n      - 8091:8091\r\n      - 8092:8092 \r\n      - 8093:8093 \r\n      - 11210:11210<\/pre>\n<p>In this Compose file:<\/p>\n<ol>\n<li>Two services in this Compose are defined by the name <code>db<\/code> and <code>web<\/code> attributes<\/li>\n<li>Image name for each service defined using <code>image<\/code> attribute<\/li>\n<li>The <code>arungupta\/couchbase:travel<\/code> image starts Couchbase server, configures it using <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/rest-api\/rest-endpoints-all.html\">Couchbase REST API<\/a>, and loads\u00a0<code>travel-sample<\/code> bucket with ~32k JSON documents.<\/li>\n<li>The <code>arungupta\/couchbase-javaee:travel<\/code> image starts WildFly and deploys application WAR file built from <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-javaee\">https:\/\/github.com\/arun-gupta\/couchbase-javaee<\/a>. Clone that project if you want to build your own image.<\/li>\n<li><code>envrionment<\/code> attribute defines environment variables accessible by the application deployed in WildFly. <code>COUCHBASE_URI<\/code> refers to the database service. This is used in the application code as shown at <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-javaee\/blob\/master\/src\/main\/java\/org\/couchbase\/sample\/javaee\/Database.java\">https:\/\/github.com\/arun-gupta\/couchbase-javaee\/blob\/master\/src\/main\/java\/org\/couchbase\/sample\/javaee\/Database.java<\/a>.<\/li>\n<li>Port forwarding is achieved using <code>ports<\/code> attribute<\/li>\n<li>\n<div><code>depends_on<\/code> attribute in Compose definition file ensures the container start up order. But application-level start up needs to be ensured by the applications running inside container. In our case, WildFly starts up rather quickly but takes a few seconds for the database to start up. This means the Java EE application deployed in WildFly is not able to communicate with the database. This outlines a best practice when building micro services applications: you must code defensively and ensure in your application initialization that the micro services you depend on have started, without assuming startup order. This is shown in the database initialization code at <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-javaee\/blob\/master\/src\/main\/java\/org\/couchbase\/sample\/javaee\/Database.java\">https:\/\/github.com\/arun-gupta\/couchbase-javaee\/blob\/master\/src\/main\/java\/org\/couchbase\/sample\/javaee\/Database.java<\/a>. It performs the following checks:<\/p>\n<ol>\n<li>Bucket exists<\/li>\n<li>Query service of Couchbase is up and running<\/li>\n<li>Sample bucket is fully loaded<\/li>\n<\/ol><\/div>\n<\/li>\n<\/ol>\n<p>This application can be started using <code>docker-compose up -d<\/code> command on a single host. Or a cluster of Docker engines in swarm-mode using <code>docker stack deploy<\/code> command.<\/p>\n<h2>Setup Docker Swarm-mode<\/h2>\n<p>Initialize Swarm mode using the following command:<\/p>\n<pre>\r\ndocker swarm init<\/pre>\n<div>This starts a Swarm Manager. By default, manager node are also worker but can be configured to be manager-only.<\/div>\n<div>Find some information about this one-node cluster using the command <code>docker info<\/code> command:<\/p>\n<pre class=\"lang:default decode:true\">\r\nContainers: 0\r\n Running: 0\r\n Paused: 0\r\n Stopped: 0\r\nImages: 17\r\nServer Version: 1.13.0\r\nStorage Driver: overlay2\r\n Backing Filesystem: extfs\r\n Supports d_type: true\r\n Native Overlay Diff: true\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins:\r\n Volume: local\r\n Network: bridge host ipvlan macvlan null overlay\r\nSwarm: active\r\n NodeID: 92mydh0e09ba5hx3wtmcmvktz\r\n Is Manager: true\r\n ClusterID: v68ikyaff7rdxpaw1j0c9i60s\r\n Managers: 1\r\n Nodes: 1\r\n Orchestration:\r\n  Task History Retention Limit: 5\r\n Raft:\r\n  Snapshot Interval: 10000\r\n  Number of Old Snapshots to Retain: 0\r\n  Heartbeat Tick: 1\r\n  Election Tick: 3\r\n Dispatcher:\r\n  Heartbeat Period: 5 seconds\r\n CA Configuration:\r\n  Expiry Duration: 3 months\r\n Node Address: 192.168.65.2\r\n Manager Addresses:\r\n  192.168.65.2:2377\r\nRuntimes: runc\r\nDefault Runtime: runc\r\nInit Binary: docker-init\r\ncontainerd version: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e\r\nrunc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e\r\ninit version: 949e6fa\r\nSecurity Options:\r\n seccomp\r\n  Profile: default\r\nKernel Version: 4.9.5-moby\r\nOperating System: Alpine Linux v3.5\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 4\r\nTotal Memory: 1.952 GiB\r\nName: moby\r\nID: SGCM:KDRD:G3M7:PZHN:J4RL:VFFR:G2SR:EKD5:JV4J:RL3X:LF7T:XF6V\r\nDocker Root Dir: \/var\/lib\/docker\r\nDebug Mode (client): false\r\nDebug Mode (server): true\r\n File Descriptors: 31\r\n Goroutines: 124\r\n System Time: 2017-01-27T08:25:58.032295342Z\r\n EventsListeners: 1\r\nNo Proxy: *.local, 169.254\/16\r\nUsername: arungupta\r\nRegistry: https:\/\/index.docker.io\/v1\/\r\nExperimental: true\r\nInsecure Registries:\r\n 127.0.0.0\/8\r\nLive Restore Enabled: false<\/pre>\n<p>This cluster has 1\u00a0node, and that is manager. Alternatively, a multi-host cluster can be easily setup using <a href=\"https:\/\/github.com\/docker\/labs\/blob\/master\/developer-tools\/java\/chapters\/ch08-aws.adoc\">Docker for AWS<\/a>.<\/p>\n<h2>Deploy Microservice<\/h2>\n<p>The microservice can be started as:<\/p>\n<pre class=\"lang:default decode:true\">\r\ndocker stack deploy --compose-file=docker-compose.yml webapp<\/pre>\n<p>This shows the\u00a0output:<\/p><\/div>\n<pre class=\"lang:default decode:true\">\r\nCreating network webapp_default\r\nCreating service webapp_web\r\nCreating service webapp_db<\/pre>\n<div>WildFly and Couchbase services are started on this node. Each service has a single container. If the Swarm mode is enabled on multiple nodes then the containers will be distributed across multiple nodes.<\/div>\n<div>A new overlay network is created. This allows multiple containers on different hosts to communicate with each other.<\/div>\n<p>Verify that the WildFly and Couchbase services are running using <code>docker service ls<\/code>:<\/p>\n<pre class=\"lang:default decode:true\">\r\nID            NAME        MODE        REPLICAS  IMAGE\r\na9pkiziw3vgw  webapp_db   replicated  1\/1       arungupta\/couchbase:travel\r\nhr5s6ue54kwj  webapp_web  replicated  1\/1       arungupta\/couchbase-javaee:travel<\/pre>\n<div>Logs for the service can be seen using <code>docker service logs -f webapp_web<\/code>:<\/div>\n<div>\n<pre class=\"lang:default decode:true\">\r\nwebapp_web.1.wby0b04t7bap@moby    | =========================================================================\r\nwebapp_web.1.wby0b04t7bap@moby    |\r\nwebapp_web.1.wby0b04t7bap@moby    |   JBoss Bootstrap Environment\r\nwebapp_web.1.wby0b04t7bap@moby    |\r\nwebapp_web.1.wby0b04t7bap@moby    |   JBOSS_HOME: \/opt\/jboss\/wildfly\r\nwebapp_web.1.wby0b04t7bap@moby    |\r\nwebapp_web.1.wby0b04t7bap@moby    |   JAVA: \/usr\/lib\/jvm\/java\/bin\/java\r\nwebapp_web.1.wby0b04t7bap@moby    |\r\nwebapp_web.1.wby0b04t7bap@moby    |   JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true\r\nwebapp_web.1.wby0b04t7bap@moby    |\r\nwebapp_web.1.wby0b04t7bap@moby    | =========================================================================\r\n\r\n. . .\r\n\r\nwebapp_web.1.wby0b04t7bap@moby    | 23:14:15,811 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed \"airlines.war\" (runtime-name : \"airlines.war\")\r\nwebapp_web.1.wby0b04t7bap@moby    | 23:14:16,076 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on https:\/\/127.0.0.1:9990\/management\r\nwebapp_web.1.wby0b04t7bap@moby    | 23:14:16,077 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on https:\/\/127.0.0.1:9990\r\nwebapp_web.1.wby0b04t7bap@moby    | 23:14:16,077 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 98623ms - Started 443 of 691 services (404 services are lazy, passive or on-demand)<\/pre>\n<p>Make sure to wait for the last log statement to show.<\/p><\/div>\n<h2>Access Microservice<\/h2>\n<p>Get 10 airlines from the microservice:<\/p>\n<pre class=\"lang:default decode:true\">\r\ncurl -v https:\/\/localhost:8080\/airlines\/resources\/airline<\/pre>\n<p>This shows the results as:<\/p>\n<pre class=\"lang:default decode:true\">\r\n*   Trying ::1...\r\n* Connected to localhost (::1) port 8080 (#0)\r\n&gt; GET \/airlines\/resources\/airline HTTP\/1.1\r\n&gt; Host: localhost:8080\r\n&gt; User-Agent: curl\/7.43.0\r\n&gt; Accept: *\/*\r\n&gt; \r\n&lt; HTTP\/1.1 200 OK\r\n&lt; Connection: keep-alive\r\n&lt; X-Powered-By: Undertow\/1\r\n&lt; Server: WildFly\/10\r\n&lt; Content-Type: application\/octet-stream\r\n&lt; Content-Length: 1402\r\n&lt; Date: Fri, 03 Feb 2017 17:02:45 GMT\r\n&lt; \r\n* Connection #0 to host localhost left intact\r\n[{&quot;travel-sample&quot;:{&quot;country&quot;:&quot;United States&quot;,&quot;iata&quot;:&quot;Q5&quot;,&quot;callsign&quot;:&quot;MILE-AIR&quot;,&quot;name&quot;:&quot;40-Mile Air&quot;,&quot;icao&quot;:&quot;MLA&quot;,&quot;id&quot;:10,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;United States&quot;,&quot;iata&quot;:&quot;TQ&quot;,&quot;callsign&quot;:&quot;TXW&quot;,&quot;name&quot;:&quot;Texas Wings&quot;,&quot;icao&quot;:&quot;TXW&quot;,&quot;id&quot;:10123,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;United States&quot;,&quot;iata&quot;:&quot;A1&quot;,&quot;callsign&quot;:&quot;atifly&quot;,&quot;name&quot;:&quot;Atifly&quot;,&quot;icao&quot;:&quot;A1F&quot;,&quot;id&quot;:10226,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;United Kingdom&quot;,&quot;iata&quot;:null,&quot;callsign&quot;:null,&quot;name&quot;:&quot;Jc royal.britannica&quot;,&quot;icao&quot;:&quot;JRB&quot;,&quot;id&quot;:10642,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;United States&quot;,&quot;iata&quot;:&quot;ZQ&quot;,&quot;callsign&quot;:&quot;LOCAIR&quot;,&quot;name&quot;:&quot;Locair&quot;,&quot;icao&quot;:&quot;LOC&quot;,&quot;id&quot;:10748,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;United States&quot;,&quot;iata&quot;:&quot;K5&quot;,&quot;callsign&quot;:&quot;SASQUATCH&quot;,&quot;name&quot;:&quot;SeaPort Airlines&quot;,&quot;icao&quot;:&quot;SQH&quot;,&quot;id&quot;:10765,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;United States&quot;,&quot;iata&quot;:&quot;KO&quot;,&quot;callsign&quot;:&quot;ACE AIR&quot;,&quot;name&quot;:&quot;Alaska Central Express&quot;,&quot;icao&quot;:&quot;AER&quot;,&quot;id&quot;:109,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;United Kingdom&quot;,&quot;iata&quot;:&quot;5W&quot;,&quot;callsign&quot;:&quot;FLYSTAR&quot;,&quot;name&quot;:&quot;Astraeus&quot;,&quot;icao&quot;:&quot;AEU&quot;,&quot;id&quot;:112,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;France&quot;,&quot;iata&quot;:&quot;UU&quot;,&quot;callsign&quot;:&quot;REUNION&quot;,&quot;name&quot;:&quot;Air Austral&quot;,&quot;icao&quot;:&quot;REU&quot;,&quot;id&quot;:1191,&quot;type&quot;:&quot;airline&quot;}}, {&quot;travel-sample&quot;:{&quot;country&quot;:&quot;France&quot;,&quot;iata&quot;:&quot;A5&quot;,&quot;callsign&quot;:&quot;AIRLINAIR&quot;,&quot;name&quot;:&quot;Airlinair&quot;,&quot;icao&quot;:&quot;RLA&quot;,&quot;id&quot;:1203,&quot;type&quot;:&quot;airline&quot;}}]<\/pre>\n<p><a href=\"https:\/\/github.com\/docker\/labs\/tree\/master\/developer-tools\/java\">Docker for Java Developers workshop<\/a> is a self-paced hands-on lab\u00a0and allows you to get started with Docker easily. Get a single resource:<\/p>\n<pre class=\"lang:default decode:true\">\r\ncurl -v https:\/\/localhost:8080\/airlines\/resources\/airline\/137<\/pre>\n<p>Create a new resource:<\/p>\n<pre class=\"lang:default decode:true\">\r\ncurl -v -H \"Content-Type: application\/json\" -X POST -d &apos;{\"country\":\"France\",\"iata\":\"A5\",\"callsign\":\"AIRLINAIR\",\"name\":\"Airlinair\",\"icao\":\"RLA\",\"type\":\"airline\"}&apos; https:\/\/localhost:8080\/airlines\/resources\/airline<\/pre>\n<p>Update a resource:<\/p>\n<pre class=\"lang:default decode:true\">\r\ncurl -v -H \"Content-Type: application\/json\" -X PUT -d &apos;{\"country\":\"France\",\"iata\":\"A5\",\"callsign\":\"AIRLINAIR\",\"name\":\"Airlin Air\",\"icao\":\"RLA\",\"type\":\"airline\",\"id\": \"19810\"}&apos; https:\/\/localhost:8080\/airlines\/resources\/airline\/19810\r\n<\/pre>\n<p>Delete a resource:<\/p>\n<pre class=\"lang:default decode:true\">\r\ncurl -v -X DELETE https:\/\/localhost:8080\/airlines\/resources\/airline\/19810<\/pre>\n<p>Detailed output from each of these commands is at\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/couchbase-javaee\">github.com\/arun-gupta\/couchbase-javaee<\/a>.<\/p>\n<h2>Delete\u00a0Microservice<\/h2>\n<p>The microservice can be removed using \u00a0the command\u00a0<span class=\"s1\"><code>docker stack rm webapp<\/code>:<\/span><\/p>\n<pre class=\"lang:default decode:true\">\r\nRemoving service webapp_web\r\nRemoving service webapp_db\r\nRemoving network webapp_default<\/pre>\n<p>Want to get started with Couchbase? Look at <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/4.5\/getting-started\/starter-kits.html\">Couchbase Starter Kits<\/a>. Want to learn more about running Couchbase in containers?<\/p>\n<ul>\n<li><a href=\"https:\/\/couchbase.com\/containers\/\">Couchbase on Containers<\/a><\/li>\n<li><a href=\"https:\/\/forums.couchbase.com\/\">Couchbase Forums<\/a><\/li>\n<li><a href=\"https:\/\/developer.couchbase.com\/\">Couchbase Developer Portal<\/a><\/li>\n<li><a href=\"https:\/\/twitter.com\/couchbasedev\">@couchhasedev<\/a> and <a href=\"https:\/\/twitter.com\/couchbase\">@couchbase<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>There is plenty of material on\u00a0microservices, just google it! I gave a presentation on\u00a0refactoring monolith to microservices at Devoxx Belgium a couple of years back and it has\u00a0good reviews: This blog will show how\u00a0Docker simplifies creation and shutting down of [&hellip;]<\/p>\n","protected":false},"author":58,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816],"tags":[],"ppma_author":[8933],"class_list":["post-2523","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Microservice using Docker stack deploy - WildFly, Java EE and Couchbase - The Couchbase Blog<\/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\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Microservice using Docker stack deploy - WildFly, Java EE and Couchbase\" \/>\n<meta property=\"og:description\" content=\"There is plenty of material on\u00a0microservices, just google it! I gave a presentation on\u00a0refactoring monolith to microservices at Devoxx Belgium a couple of years back and it has\u00a0good reviews: This blog will show how\u00a0Docker simplifies creation and shutting down of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-03T18:46:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-19T10:58:42+00:00\" \/>\n<meta name=\"author\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@arungupta\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/\"},\"author\":{\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\"},\"headline\":\"Microservice using Docker stack deploy &#8211; WildFly, Java EE and Couchbase\",\"datePublished\":\"2017-02-03T18:46:36+00:00\",\"dateModified\":\"2023-06-19T10:58:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/\"},\"wordCount\":669,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Couchbase Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/\",\"name\":\"Microservice using Docker stack deploy - WildFly, Java EE and Couchbase - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-02-03T18:46:36+00:00\",\"dateModified\":\"2023-06-19T10:58:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Microservice using Docker stack deploy &#8211; WildFly, Java EE 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\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@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\/39d8caed0f536489b6aa6e8d31ee631f\",\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"caption\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\"},\"description\":\"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.\",\"sameAs\":[\"https:\/\/x.com\/arungupta\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Microservice using Docker stack deploy - WildFly, Java EE and Couchbase - The Couchbase Blog","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\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/","og_locale":"en_US","og_type":"article","og_title":"Microservice using Docker stack deploy - WildFly, Java EE and Couchbase","og_description":"There is plenty of material on\u00a0microservices, just google it! I gave a presentation on\u00a0refactoring monolith to microservices at Devoxx Belgium a couple of years back and it has\u00a0good reviews: This blog will show how\u00a0Docker simplifies creation and shutting down of [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-02-03T18:46:36+00:00","article_modified_time":"2023-06-19T10:58:42+00:00","author":"Arun Gupta, VP, Developer Advocacy, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@arungupta","twitter_misc":{"Written by":"Arun Gupta, VP, Developer Advocacy, Couchbase","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/"},"author":{"name":"Arun Gupta, VP, Developer Advocacy, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f"},"headline":"Microservice using Docker stack deploy &#8211; WildFly, Java EE and Couchbase","datePublished":"2017-02-03T18:46:36+00:00","dateModified":"2023-06-19T10:58:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/"},"wordCount":669,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Couchbase Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/","url":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/","name":"Microservice using Docker stack deploy - WildFly, Java EE and Couchbase - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-02-03T18:46:36+00:00","dateModified":"2023-06-19T10:58:42+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/microservice-using-docker-stack-deploy-wildfly-javaee-couchbase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Microservice using Docker stack deploy &#8211; WildFly, Java EE 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":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@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\/39d8caed0f536489b6aa6e8d31ee631f","name":"Arun Gupta, VP, Developer Advocacy, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337","url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","caption":"Arun Gupta, VP, Developer Advocacy, Couchbase"},"description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.","sameAs":["https:\/\/x.com\/arungupta"],"url":"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/"}]}},"authors":[{"term_id":8933,"user_id":58,"is_guest":0,"slug":"arun-gupta","display_name":"Arun Gupta, VP, Developer Advocacy, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","author_category":"","last_name":"Gupta","first_name":"Arun","job_title":"","user_url":"","description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team.\r\n\r\nGupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2523"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2523\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2523"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}