├── README.md ├── client ├── .gitignore ├── hs_err_pid34864.log ├── pom.xml └── src │ └── main │ ├── java │ └── demo │ │ ├── DemoApplication.java │ │ ├── Message.java │ │ ├── MessageController.java │ │ ├── MicroservicesClient.java │ │ └── MicroservicesHystrixClient.java │ └── resources │ ├── application.yml │ └── bootstrap.yml ├── microservice-greetings ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── demo │ │ │ ├── DemoApplication.java │ │ │ ├── Message.java │ │ │ └── MessageController.java │ └── resources │ │ ├── application.yml │ │ └── bootstrap.yml │ └── test │ └── java │ └── demo │ └── DemoApplicationTests.java ├── microservice-helloworld ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── demo │ │ │ ├── DemoApplication.java │ │ │ ├── Message.java │ │ │ └── MessageController.java │ └── resources │ │ ├── application.yml │ │ └── bootstrap.yml │ └── test │ └── java │ └── demo │ └── DemoApplicationTests.java ├── paso-1.md ├── paso-2.md ├── paso-3.md ├── paso-4.md ├── paso-5.md ├── paso-6.md ├── paso-7.md ├── service-archaius ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ └── demo │ │ └── ArchaiusServiceApplication.java │ └── resources │ └── application.yml ├── service-eureka ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ └── demo │ │ └── EurekaServiceApplication.java │ └── resources │ └── application.yml ├── service-hystrix ├── pom.xml └── src │ └── main │ ├── java │ └── demo │ │ └── HystrixDashboardApp.java │ └── resources │ ├── application.yml │ └── bootstrap.yml └── service-zuul ├── .gitignore ├── pom.xml └── src ├── main ├── java │ └── demo │ │ └── ZuulServiceApplication.java └── resources │ └── application.yml └── test └── java └── demo └── ZuulServiceApplicationTest.java /README.md: -------------------------------------------------------------------------------- 1 | # tutorial sobre microservicios utilizando spring-boot y arquitectura de netflix 2 | 3 | este tutorial consiste en breves explicaciones, muchos enlaces y código de ejemplo sobre el que experimentar. está basado en la documentación oficial de spring cloud y netfilx oss condimentado con otros contenidos que me parecieron oportunos. 4 | 5 | ```sh 6 | $ git clone https://github.com/jantoniucci/tutorial-microservices-spring-boot-netflix.git 7 | ``` 8 | el tuturial está organizado en "pasos" que van acompañados de tags en este repositorio. comenzamos accediendo al primer paso con el comando: 9 | ```sh 10 | $ git checkout paso-1 11 | ``` 12 | 13 | cada paso incluirá un paso-n.md con el contenido del tutorial y el código actualizado 14 | 15 | para ver los cambios entre pasos, puedes utilizar: 16 | ```sh 17 | $ git diff paso-1 paso-2 18 | ``` 19 | seguramente con un [visualGit](https://github.com/pvginkel/VisualGit) o [sourceTree](http://www.sourcetreeapp.com/) lo verás mejor. 20 | 21 | NOTA: este tutorial está dirigido a java developers con experiencia en desarrollo de aplicaciones mvc utilizando el stack tecnológico de spring. 22 | 23 | ## agenda 24 | - [paso 1 : mi primer microservicio spring-boot](paso-1.md) 25 | - qué es un microservicio ? 26 | - qué es spring boot 27 | - hellow (micro) world 28 | - [paso 2 : comenzando con netflix oss](paso-2.md) 29 | - la problemática de los microservicios 30 | - qué es netflix oss ? 31 | - el primer servicio netflix: archaius 32 | - actualizamos el microservicio para usar configuración distribuida 33 | - cambiar la configuración en caliente a un microservicio 34 | - cambiar la configuración en caliente en el repo y los microservicios 35 | - [paso 3 : registro y localización de microservicios](paso-3.md) 36 | - registro, localización y eureka! 37 | - instanciando un servidor 38 | - añadiendo el cliente al microservicio 39 | - la consola de eureka 40 | - [paso 4 : gestionando peticiones a microservicios](paso-4.md) 41 | - enrutado, balanceo y otros malabares 42 | - invocando a zuul 43 | - algunas pruebas 44 | - ...y otras pruebas más 45 | - [paso 5 : clientes inteligentes](paso-5.md) 46 | - un poco de contexto 47 | - crear un cliente con Feign 48 | - añadirle balanceo en cliente con ribbon 49 | - añadirle circuit-braker con hystrix 50 | - monitorizando clientes con hystrix dashboard 51 | - clusterizando la monitorización hystrix con turbine 52 | - [paso 6 : comunicando microservicios](paso-6.md) 53 | - un bus para comunicarles a todos 54 | - instalando rabbitmq 55 | - actualizar los microservicios 56 | - enviar mensajes 57 | - [paso 7 : Conclusiones](paso-7.md) 58 | 59 | Te gustan estos temas? Entonces tienes que conocer lo que hacemos en [Adesis Netlife](http://www.adesis.com). 60 | 61 | Te gusta este tutorial? Márcalo como favorito y twitealo al mundo! 62 | 63 | ## Contacto 64 | * [javier.antoniucci@gmail.com](mailto:javier.antoniucci@gmail.com) 65 | * http://www.adesis.com 66 | 67 | ## Contribuciones 68 | * Preguntas, erratas, solicitudes: escribir en la sección Issues del repo 69 | * Correcciones, mejoras, añadidos : enviar pull-requests 70 | * Propuestas, colaboraciones en otros tutoriales, etc: javier.antoniucci@gmail.com 71 | 72 | ## Licencia 73 | [Beerware Software Licence](http://en.wikipedia.org/wiki/Beerware). Beerware es un término de licencia de software otorgado bajo términos muy libres. Provee al usuario final el derecho a un programa particular (y hacer lo que quiera con el código fuente). Si el usuario considera el software útil, se le exhorta a comprarle al autor una cerveza "para devolver el favor". 74 | -------------------------------------------------------------------------------- /client/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /client/hs_err_pid34864.log: -------------------------------------------------------------------------------- 1 | # 2 | # A fatal error has been detected by the Java Runtime Environment: 3 | # 4 | # SIGSEGV (0xb) at pc=0x0000000110b31527, pid=34864, tid=21507 5 | # 6 | # JRE version: 7.0_06-b24 7 | # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.2-b09 mixed mode bsd-amd64 compressed oops) 8 | # Problematic frame: 9 | # V [libjvm.dylib+0x331527] 10 | # 11 | # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again 12 | # 13 | # If you would like to submit a bug report, please visit: 14 | # http://bugreport.sun.com/bugreport/crash.jsp 15 | # 16 | 17 | --------------- T H R E A D --------------- 18 | 19 | Current thread (0x00007fc4168be800): JavaThread "pool-4-thread-1" [_thread_in_vm, id=21507, stack(0x00000001195d5000,0x00000001196d5000)] 20 | 21 | siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000004b00a3 22 | 23 | Registers: 24 | RAX=0x00000000004b0006, RBX=0x00007fc415f0c3d8, RCX=0x0000000000000000, RDX=0x0000000000000000 25 | RSP=0x00000001196d3a00, RBP=0x00000001196d3bb0, RSI=0x00007fc415f0c3d8, RDI=0x00000001196d3d18 26 | R8 =0x00007fc415f0c3e0, R9 =0x0000000000000001, R10=0x0000000110f3ebf0, R11=0x0000000111559140 27 | R12=0x00007fc4168be800, R13=0x00000007fdae06b3, R14=0x00000001196d3d18, R15=0x00007fc4168be800 28 | RIP=0x0000000110b31527, EFLAGS=0x0000000000010206, ERR=0x0000000000000004 29 | TRAPNO=0x000000000000000e 30 | 31 | Top of Stack: (sp=0x00000001196d3a00) 32 | 0x00000001196d3a00: 00000001196d3cb8 00000001117f4884 33 | 0x00000001196d3a10: 00000001117f4772 00000001117f4828 34 | 0x00000001196d3a20: 0000000100000001 00000001117f4883 35 | 0x00000001196d3a30: 00007fc415f0c3e0 00000001117f631f 36 | 0x00000001196d3a40: 0000000111010000 00000001117f4840 37 | 0x00000001196d3a50: 00000001196d3a80 0000000110b950a1 38 | 0x00000001196d3a60: 00000001196d3aa0 00000007faea9108 39 | 0x00000001196d3a70: ef00ee4350383284 00000007fdb15938 40 | 0x00000001196d3a80: 0000000000000000 00000007fdb15930 41 | 0x00000001196d3a90: 0000000000000093 00007fc4168be800 42 | 0x00000001196d3aa0: 312e312f50545448 00000001113bc48a 43 | 0x00000001196d3ab0: 0000001800001f40 00007fc41341daa0 44 | 0x00000001196d3ac0: 00000001196d3b30 00007fc415db6460 45 | 0x00000001196d3ad0: 00000001196d3b10 0000000000000001 46 | 0x00000001196d3ae0: 00000007f2a17ee8 0000000000000009 47 | 0x00000001196d3af0: 0000000000000000 00000001196d3ae8 48 | 0x00000001196d3b00: 00000007fdaf8296 00000001196d3b68 49 | 0x00000001196d3b10: 00000007fdafccc0 00000007fe17ed58 50 | 0x00000001196d3b20: 00000007fdaf82b8 0000000000000000 51 | 0x00000001196d3b30: 00000001196d3b68 00000001196d3bb0 52 | 0x00000001196d3b40: 00000001113b0158 0000000000000000 53 | 0x00000001196d3b50: 0000000000000000 0000000000000000 54 | 0x00000001196d3b60: 00000007f2a17ee8 00000007f2a11570 55 | 0x00000001196d3b70: 00000001196d3b70 00000007fdb15cd9 56 | 0x00000001196d3b80: ef00ee4350383284 00007fc415f0c3d8 57 | 0x00000001196d3b90: 00007fc4168be800 00000007fdae06b3 58 | 0x00000001196d3ba0: 00000001196d3d18 00007fc4168be800 59 | 0x00000001196d3bb0: 00000001196d3ce0 0000000110b31f0d 60 | 0x00000001196d3bc0: 00007fc4168be800 00000007f11db2b8 61 | 0x00000001196d3bd0: 00000007f11db2a8 00000001196d3bd8 62 | 0x00000001196d3be0: 00000007fda79c1b 00000001196d3c28 63 | 0x00000001196d3bf0: 00000007fda7b6c8 0000000000000000 64 | 65 | Instructions: (pc=0x0000000110b31527) 66 | 0x0000000110b31507: 00 44 89 8d 70 fe ff ff 4c 89 85 80 fe ff ff 48 67 | 0x0000000110b31517: 8b 05 23 ad 35 00 48 8b 00 48 89 45 d0 48 8b 06 68 | 0x0000000110b31527: f6 80 9d 00 00 00 02 48 89 f3 0f 84 be 00 00 00 69 | 0x0000000110b31537: 48 8b 4d 10 48 8b 89 08 01 00 00 48 89 8d e8 fe 70 | 71 | Register to memory mapping: 72 | 73 | RAX=0x00000000004b0006 is an unknown value 74 | RBX=0x00007fc415f0c3d8 is an unknown value 75 | RCX=0x0000000000000000 is an unknown value 76 | RDX=0x0000000000000000 is an unknown value 77 | RSP=0x00000001196d3a00 is pointing into the stack for thread: 0x00007fc4168be800 78 | RBP=0x00000001196d3bb0 is pointing into the stack for thread: 0x00007fc4168be800 79 | RSI=0x00007fc415f0c3d8 is an unknown value 80 | RDI=0x00000001196d3d18 is pointing into the stack for thread: 0x00007fc4168be800 81 | R8 =0x00007fc415f0c3e0 is an unknown value 82 | R9 =0x0000000000000001 is an unknown value 83 | R10=0x0000000110f3ebf0: _ZN19TemplateInterpreter13_active_tableE+0x4000 in /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/server/libjvm.dylib at 0x0000000110800000 84 | R11=0x0000000111559010 [CodeBlob (0x0000000111559010)] 85 | Framesize: 6 86 | R12=0x00007fc4168be800 is a thread 87 | R13=0x00000007fdae06b3 is an oop 88 | {constMethod} 89 | - klass: {other class} 90 | - method: 0x00000007fdae06f8 {method} 'deserialize' '(Lorg/apache/http/io/SessionInputBuffer;Lorg/apache/http/HttpMessage;)Lorg/apache/http/HttpEntity;' in 'org/apache/http/impl/entity/EntityDeserializer' 91 | - exceptions: 0x00000007fae01d50 92 | bci_from(0x7fdae06b3) = 3; print_codes(): 93 | R14=0x00000001196d3d18 is pointing into the stack for thread: 0x00007fc4168be800 94 | R15=0x00007fc4168be800 is a thread 95 | 96 | 97 | Stack: [0x00000001195d5000,0x00000001196d5000], sp=0x00000001196d3a00, free space=1018k 98 | Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) 99 | V [libjvm.dylib+0x331527] 100 | V [libjvm.dylib+0x331f0d] 101 | V [libjvm.dylib+0x334274] 102 | V [libjvm.dylib+0x3343bb] 103 | V [libjvm.dylib+0x284443] 104 | j org.apache.http.impl.entity.EntityDeserializer.deserialize(Lorg/apache/http/io/SessionInputBuffer;Lorg/apache/http/HttpMessage;)Lorg/apache/http/HttpEntity;+3 105 | j org.apache.http.impl.AbstractHttpClientConnection.receiveResponseEntity(Lorg/apache/http/HttpResponse;)V+20 106 | j org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseEntity(Lorg/apache/http/HttpResponse;)V+16 107 | j org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(Lorg/apache/http/HttpRequest;Lorg/apache/http/HttpClientConnection;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;+61 108 | j org.apache.http.protocol.HttpRequestExecutor.execute(Lorg/apache/http/HttpRequest;Lorg/apache/http/HttpClientConnection;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;+39 109 | j org.apache.http.impl.client.DefaultRequestDirector.tryExecute(Lorg/apache/http/impl/client/RoutedRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;+198 110 | j org.apache.http.impl.client.DefaultRequestDirector.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;+578 111 | j org.apache.http.impl.client.AbstractHttpClient.doExecute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse;+362 112 | j org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;)Lorg/apache/http/client/methods/CloseableHttpResponse;+7 113 | j org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;)Lorg/apache/http/HttpResponse;+3 114 | j com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;+103 115 | j com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;+117 116 | j com.netflix.discovery.EurekaIdentityHeaderFilter.handle(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;+76 117 | j com.sun.jersey.api.client.Client.handle(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;+35 118 | j com.sun.jersey.api.client.WebResource.handle(Ljava/lang/Class;Lcom/sun/jersey/api/client/ClientRequest;)Ljava/lang/Object;+10 119 | j com.sun.jersey.api.client.WebResource.put(Ljava/lang/Class;)Ljava/lang/Object;+15 120 | j com.netflix.discovery.DiscoveryClient.makeRemoteCall(Lcom/netflix/discovery/DiscoveryClient$Action;I)Lcom/sun/jersey/api/client/ClientResponse;+224 121 | j com.netflix.discovery.DiscoveryClient.makeRemoteCall(Lcom/netflix/discovery/DiscoveryClient$Action;)Lcom/sun/jersey/api/client/ClientResponse;+3 122 | j com.netflix.discovery.DiscoveryClient.access$500(Lcom/netflix/discovery/DiscoveryClient;Lcom/netflix/discovery/DiscoveryClient$Action;)Lcom/sun/jersey/api/client/ClientResponse;+2 123 | j com.netflix.discovery.DiscoveryClient$HeartbeatThread.run()V+9 124 | 125 | Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) 126 | j org.apache.http.impl.entity.EntityDeserializer.deserialize(Lorg/apache/http/io/SessionInputBuffer;Lorg/apache/http/HttpMessage;)Lorg/apache/http/HttpEntity;+3 127 | j org.apache.http.impl.AbstractHttpClientConnection.receiveResponseEntity(Lorg/apache/http/HttpResponse;)V+20 128 | j org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseEntity(Lorg/apache/http/HttpResponse;)V+16 129 | j org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(Lorg/apache/http/HttpRequest;Lorg/apache/http/HttpClientConnection;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;+61 130 | j org.apache.http.protocol.HttpRequestExecutor.execute(Lorg/apache/http/HttpRequest;Lorg/apache/http/HttpClientConnection;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;+39 131 | j org.apache.http.impl.client.DefaultRequestDirector.tryExecute(Lorg/apache/http/impl/client/RoutedRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;+198 132 | j org.apache.http.impl.client.DefaultRequestDirector.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;+578 133 | j org.apache.http.impl.client.AbstractHttpClient.doExecute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse;+362 134 | j org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;)Lorg/apache/http/client/methods/CloseableHttpResponse;+7 135 | j org.apache.http.impl.client.CloseableHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;)Lorg/apache/http/HttpResponse;+3 136 | j com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;+103 137 | j com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;+117 138 | j com.netflix.discovery.EurekaIdentityHeaderFilter.handle(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;+76 139 | j com.sun.jersey.api.client.Client.handle(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/ClientResponse;+35 140 | j com.sun.jersey.api.client.WebResource.handle(Ljava/lang/Class;Lcom/sun/jersey/api/client/ClientRequest;)Ljava/lang/Object;+10 141 | j com.sun.jersey.api.client.WebResource.put(Ljava/lang/Class;)Ljava/lang/Object;+15 142 | j com.netflix.discovery.DiscoveryClient.makeRemoteCall(Lcom/netflix/discovery/DiscoveryClient$Action;I)Lcom/sun/jersey/api/client/ClientResponse;+224 143 | j com.netflix.discovery.DiscoveryClient.makeRemoteCall(Lcom/netflix/discovery/DiscoveryClient$Action;)Lcom/sun/jersey/api/client/ClientResponse;+3 144 | j com.netflix.discovery.DiscoveryClient.access$500(Lcom/netflix/discovery/DiscoveryClient;Lcom/netflix/discovery/DiscoveryClient$Action;)Lcom/sun/jersey/api/client/ClientResponse;+2 145 | j com.netflix.discovery.DiscoveryClient$HeartbeatThread.run()V+9 146 | J java.util.concurrent.FutureTask.run()V 147 | j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+46 148 | j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5 149 | j java.lang.Thread.run()V+11 150 | v ~StubRoutines::call_stub 151 | 152 | --------------- P R O C E S S --------------- 153 | 154 | Java Threads: ( => current thread ) 155 | 0x00007fc417a16800 JavaThread "http-nio-9001-exec-6" daemon [_thread_blocked, id=20743, stack(0x00000001196d8000,0x00000001197d8000)] 156 | 0x00007fc416004000 JavaThread "http-nio-9001-exec-5" daemon [_thread_blocked, id=20231, stack(0x00000001193cf000,0x00000001194cf000)] 157 | =>0x00007fc4168be800 JavaThread "pool-4-thread-1" [_thread_in_vm, id=21507, stack(0x00000001195d5000,0x00000001196d5000)] 158 | 0x00007fc417064800 JavaThread "pool-5-thread-1" [_thread_blocked, id=21255, stack(0x00000001194d2000,0x00000001195d2000)] 159 | 0x00007fc4169dd800 JavaThread "http-nio-9001-exec-4" daemon [_thread_blocked, id=20487, stack(0x00000001192cc000,0x00000001193cc000)] 160 | 0x00007fc41712c800 JavaThread "http-nio-9001-exec-3" daemon [_thread_blocked, id=15111, stack(0x00000001191c9000,0x00000001192c9000)] 161 | 0x00007fc417a15800 JavaThread "http-nio-9001-exec-2" daemon [_thread_blocked, id=15367, stack(0x0000000118d4d000,0x0000000118e4d000)] 162 | 0x00007fc417be4000 JavaThread "pool-6-thread-2" daemon [_thread_blocked, id=19971, stack(0x00000001190c6000,0x00000001191c6000)] 163 | 0x00007fc417a14000 JavaThread "DataPublisher" daemon [_thread_blocked, id=19459, stack(0x0000000118c4a000,0x0000000118d4a000)] 164 | 0x00007fc4169dc800 JavaThread "pool-6-thread-1" daemon [_thread_blocked, id=14599, stack(0x0000000118b47000,0x0000000118c47000)] 165 | 0x00007fc417b24000 JavaThread "http-nio-9001-exec-1" daemon [_thread_blocked, id=9735, stack(0x00000001173ed000,0x00000001174ed000)] 166 | 0x00007fc417125000 JavaThread "ServoPollScheduler-3" daemon [_thread_blocked, id=8967, stack(0x00000001172ea000,0x00000001173ea000)] 167 | 0x00007fc417b4d000 JavaThread "ServoPollScheduler-2" daemon [_thread_blocked, id=11015, stack(0x0000000117ebd000,0x0000000117fbd000)] 168 | 0x00007fc417d7a800 JavaThread "ServoMonitorGetValueLimiter-0" daemon [_thread_blocked, id=9991, stack(0x0000000114acc000,0x0000000114bcc000)] 169 | 0x00007fc4162ed800 JavaThread "http-nio-9001-Acceptor-0" daemon [_thread_in_native, id=19203, stack(0x0000000118fc3000,0x00000001190c3000)] 170 | 0x00007fc414bd4000 JavaThread "http-nio-9001-ClientPoller-1" daemon [_thread_in_native, id=18947, stack(0x0000000118ec0000,0x0000000118fc0000)] 171 | 0x00007fc414160000 JavaThread "http-nio-9001-ClientPoller-0" daemon [_thread_in_native, id=18691, stack(0x00000001187e8000,0x00000001188e8000)] 172 | 0x00007fc414b2f800 JavaThread "NioBlockingSelector.BlockPoller-1" daemon [_thread_in_native, id=18435, stack(0x0000000118518000,0x0000000118618000)] 173 | 0x00007fc417211800 JavaThread "DiscoveryClient-3" daemon [_thread_blocked, id=18179, stack(0x0000000118415000,0x0000000118515000)] 174 | 0x00007fc417b2f000 JavaThread "DiscoveryClient-2" daemon [_thread_blocked, id=17923, stack(0x000000011813b000,0x000000011823b000)] 175 | 0x00007fc417232800 JavaThread "DiscoveryClient-1" daemon [_thread_blocked, id=17667, stack(0x0000000118038000,0x0000000118138000)] 176 | 0x00007fc417123800 JavaThread "Eureka-JerseyClient-Conn-Cleaner2" daemon [_thread_blocked, id=17411, stack(0x00000001179ff000,0x0000000117aff000)] 177 | 0x00007fc413c42000 JavaThread "DiscoveryClient-0" daemon [_thread_blocked, id=17155, stack(0x0000000117d4e000,0x0000000117e4e000)] 178 | 0x00007fc41600c000 JavaThread "ServoPollScheduler-1" daemon [_thread_blocked, id=16899, stack(0x0000000117c4b000,0x0000000117d4b000)] 179 | 0x00007fc415293000 JavaThread "ServoPollScheduler-0" daemon [_thread_blocked, id=9227, stack(0x0000000117b48000,0x0000000117c48000)] 180 | 0x00007fc4152e5000 JavaThread "container-0" [_thread_blocked, id=16643, stack(0x00000001178fc000,0x00000001179fc000)] 181 | 0x00007fc413c2b000 JavaThread "ContainerBackgroundProcessor[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]" daemon [_thread_blocked, id=16387, stack(0x00000001177f9000,0x00000001178f9000)] 182 | 0x00007fc414822800 JavaThread "Service Thread" daemon [_thread_blocked, id=13827, stack(0x00000001166ba000,0x00000001167ba000)] 183 | 0x00007fc41481e000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=13571, stack(0x00000001165b7000,0x00000001166b7000)] 184 | 0x00007fc41385f800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=13079, stack(0x00000001164b4000,0x00000001165b4000)] 185 | 0x00007fc41481d000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=10263, stack(0x00000001163b1000,0x00000001164b1000)] 186 | 0x00007fc414005800 JavaThread "Finalizer" daemon [_thread_blocked, id=8707, stack(0x0000000114994000,0x0000000114a94000)] 187 | 0x00007fc413854000 JavaThread "Reference Handler" daemon [_thread_blocked, id=8451, stack(0x0000000114891000,0x0000000114991000)] 188 | 0x00007fc41380f000 JavaThread "main" [_thread_blocked, id=4355, stack(0x00000001112a8000,0x00000001113a8000)] 189 | 190 | Other Threads: 191 | 0x00007fc413851800 VMThread [stack: 0x000000011478e000,0x000000011488e000] [id=8195] 192 | 0x00007fc414810800 WatcherThread [stack: 0x00000001167bd000,0x00000001168bd000] [id=14083] 193 | 194 | VM state:not at safepoint (normal execution) 195 | 196 | VM Mutex/Monitor currently owned by a thread: None 197 | 198 | Heap 199 | def new generation total 28032K, used 4809K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 200 | eden space 24960K, 15% used [0x00000007f0e00000, 0x00000007f11df010, 0x00000007f2660000) 201 | from space 3072K, 27% used [0x00000007f2960000, 0x00000007f2a33568, 0x00000007f2c60000) 202 | to space 3072K, 0% used [0x00000007f2660000, 0x00000007f2660000, 0x00000007f2960000) 203 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 204 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 205 | compacting perm gen total 52928K, used 52877K [0x00000007fae00000, 0x00000007fe1b0000, 0x0000000800000000) 206 | the space 52928K, 99% used [0x00000007fae00000, 0x00000007fe1a3680, 0x00000007fe1a3800, 0x00000007fe1b0000) 207 | No shared spaces configured. 208 | 209 | Card table byte_map: [0x000000011446a000,0x00000001144e4000] byte_map_base: 0x00000001104e3000 210 | 211 | Polling page: 0x000000010ffa7000 212 | 213 | Code Cache [0x00000001113aa000, 0x000000011180a000, 0x00000001143aa000) 214 | total_blobs=1919 nmethods=1521 adapters=349 free_code_cache=44761Kb largest_free_block=45755968 215 | 216 | Compilation events (10 events): 217 | Event: 17419.592 Thread 0x00007fc41385f800 1701 com.thoughtworks.xstream.io.xml.AbstractPullReader::readEvent (76 bytes) 218 | Event: 17419.593 Thread 0x00007fc41481e000 1702 com.thoughtworks.xstream.io.xml.AbstractPullReader::reset (34 bytes) 219 | Event: 17419.597 Thread 0x00007fc41481e000 nmethod 1702 0x00000001117f5ad0 code [0x00000001117f5c40, 0x00000001117f5ec8] 220 | Event: 17419.620 Thread 0x00007fc41385f800 nmethod 1701 0x0000000111802b90 code [0x0000000111802f80, 0x0000000111804a78] 221 | Event: 17629.658 Thread 0x00007fc41481e000 1703 com.sun.jersey.core.util.KeyComparatorHashMap::put (115 bytes) 222 | Event: 17629.666 Thread 0x00007fc41481e000 nmethod 1703 0x00000001117f4650 code [0x00000001117f4840, 0x00000001117f4fd0] 223 | Event: 17839.715 Thread 0x00007fc41385f800 1704 org.apache.http.message.AbstractHttpMessage::getParams (23 bytes) 224 | Event: 17839.718 Thread 0x00007fc41385f800 nmethod 1704 0x00000001115fe810 code [0x00000001115fe9a0, 0x00000001115feb68] 225 | Event: 17839.720 Thread 0x00007fc41481e000 1705 sun.reflect.ClassFileAssembler::emitConstantPoolClass (23 bytes) 226 | Event: 17839.725 Thread 0x00007fc41481e000 nmethod 1705 0x0000000111800590 code [0x0000000111800740, 0x0000000111800b08] 227 | 228 | GC Heap History (10 events): 229 | Event: 11047.837 GC heap before 230 | {Heap before GC invocations=135 (full 10): 231 | def new generation total 28032K, used 25567K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 232 | eden space 24960K, 100% used [0x00000007f0e00000, 0x00000007f2660000, 0x00000007f2660000) 233 | from space 3072K, 19% used [0x00000007f2660000, 0x00000007f26f7d88, 0x00000007f2960000) 234 | to space 3072K, 0% used [0x00000007f2960000, 0x00000007f2960000, 0x00000007f2c60000) 235 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 236 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 237 | compacting perm gen total 52608K, used 52308K [0x00000007fae00000, 0x00000007fe160000, 0x0000000800000000) 238 | the space 52608K, 99% used [0x00000007fae00000, 0x00000007fe115360, 0x00000007fe115400, 0x00000007fe160000) 239 | No shared spaces configured. 240 | Event: 11047.842 GC heap after 241 | Heap after GC invocations=136 (full 10): 242 | def new generation total 28032K, used 650K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 243 | eden space 24960K, 0% used [0x00000007f0e00000, 0x00000007f0e00000, 0x00000007f2660000) 244 | from space 3072K, 21% used [0x00000007f2960000, 0x00000007f2a02968, 0x00000007f2c60000) 245 | to space 3072K, 0% used [0x00000007f2660000, 0x00000007f2660000, 0x00000007f2960000) 246 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 247 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 248 | compacting perm gen total 52608K, used 52308K [0x00000007fae00000, 0x00000007fe160000, 0x0000000800000000) 249 | the space 52608K, 99% used [0x00000007fae00000, 0x00000007fe115360, 0x00000007fe115400, 0x00000007fe160000) 250 | No shared spaces configured. 251 | } 252 | Event: 12363.262 GC heap before 253 | {Heap before GC invocations=136 (full 10): 254 | def new generation total 28032K, used 25610K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 255 | eden space 24960K, 100% used [0x00000007f0e00000, 0x00000007f2660000, 0x00000007f2660000) 256 | from space 3072K, 21% used [0x00000007f2960000, 0x00000007f2a02968, 0x00000007f2c60000) 257 | to space 3072K, 0% used [0x00000007f2660000, 0x00000007f2660000, 0x00000007f2960000) 258 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 259 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 260 | compacting perm gen total 52608K, used 52454K [0x00000007fae00000, 0x00000007fe160000, 0x0000000800000000) 261 | the space 52608K, 99% used [0x00000007fae00000, 0x00000007fe139890, 0x00000007fe139a00, 0x00000007fe160000) 262 | No shared spaces configured. 263 | Event: 12363.267 GC heap after 264 | Heap after GC invocations=137 (full 10): 265 | def new generation total 28032K, used 698K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 266 | eden space 24960K, 0% used [0x00000007f0e00000, 0x00000007f0e00000, 0x00000007f2660000) 267 | from space 3072K, 22% used [0x00000007f2660000, 0x00000007f270e8a0, 0x00000007f2960000) 268 | to space 3072K, 0% used [0x00000007f2960000, 0x00000007f2960000, 0x00000007f2c60000) 269 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 270 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 271 | compacting perm gen total 52608K, used 52454K [0x00000007fae00000, 0x00000007fe160000, 0x0000000800000000) 272 | the space 52608K, 99% used [0x00000007fae00000, 0x00000007fe139890, 0x00000007fe139a00, 0x00000007fe160000) 273 | No shared spaces configured. 274 | } 275 | Event: 13655.717 GC heap before 276 | {Heap before GC invocations=137 (full 10): 277 | def new generation total 28032K, used 25658K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 278 | eden space 24960K, 100% used [0x00000007f0e00000, 0x00000007f2660000, 0x00000007f2660000) 279 | from space 3072K, 22% used [0x00000007f2660000, 0x00000007f270e8a0, 0x00000007f2960000) 280 | to space 3072K, 0% used [0x00000007f2960000, 0x00000007f2960000, 0x00000007f2c60000) 281 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 282 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 283 | compacting perm gen total 52608K, used 52593K [0x00000007fae00000, 0x00000007fe160000, 0x0000000800000000) 284 | the space 52608K, 99% used [0x00000007fae00000, 0x00000007fe15c7c8, 0x00000007fe15c800, 0x00000007fe160000) 285 | No shared spaces configured. 286 | Event: 13655.722 GC heap after 287 | Heap after GC invocations=138 (full 10): 288 | def new generation total 28032K, used 745K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 289 | eden space 24960K, 0% used [0x00000007f0e00000, 0x00000007f0e00000, 0x00000007f2660000) 290 | from space 3072K, 24% used [0x00000007f2960000, 0x00000007f2a1a6c0, 0x00000007f2c60000) 291 | to space 3072K, 0% used [0x00000007f2660000, 0x00000007f2660000, 0x00000007f2960000) 292 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 293 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 294 | compacting perm gen total 52608K, used 52593K [0x00000007fae00000, 0x00000007fe160000, 0x0000000800000000) 295 | the space 52608K, 99% used [0x00000007fae00000, 0x00000007fe15c7c8, 0x00000007fe15c800, 0x00000007fe160000) 296 | No shared spaces configured. 297 | } 298 | Event: 14967.469 GC heap before 299 | {Heap before GC invocations=138 (full 10): 300 | def new generation total 28032K, used 25705K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 301 | eden space 24960K, 100% used [0x00000007f0e00000, 0x00000007f2660000, 0x00000007f2660000) 302 | from space 3072K, 24% used [0x00000007f2960000, 0x00000007f2a1a6c0, 0x00000007f2c60000) 303 | to space 3072K, 0% used [0x00000007f2660000, 0x00000007f2660000, 0x00000007f2960000) 304 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 305 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 306 | compacting perm gen total 52928K, used 52735K [0x00000007fae00000, 0x00000007fe1b0000, 0x0000000800000000) 307 | the space 52928K, 99% used [0x00000007fae00000, 0x00000007fe17fcb0, 0x00000007fe17fe00, 0x00000007fe1b0000) 308 | No shared spaces configured. 309 | Event: 14967.474 GC heap after 310 | Heap after GC invocations=139 (full 10): 311 | def new generation total 28032K, used 788K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 312 | eden space 24960K, 0% used [0x00000007f0e00000, 0x00000007f0e00000, 0x00000007f2660000) 313 | from space 3072K, 25% used [0x00000007f2660000, 0x00000007f2725398, 0x00000007f2960000) 314 | to space 3072K, 0% used [0x00000007f2960000, 0x00000007f2960000, 0x00000007f2c60000) 315 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 316 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 317 | compacting perm gen total 52928K, used 52735K [0x00000007fae00000, 0x00000007fe1b0000, 0x0000000800000000) 318 | the space 52928K, 99% used [0x00000007fae00000, 0x00000007fe17fcb0, 0x00000007fe17fe00, 0x00000007fe1b0000) 319 | No shared spaces configured. 320 | } 321 | Event: 17711.426 GC heap before 322 | {Heap before GC invocations=139 (full 10): 323 | def new generation total 28032K, used 25748K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 324 | eden space 24960K, 100% used [0x00000007f0e00000, 0x00000007f2660000, 0x00000007f2660000) 325 | from space 3072K, 25% used [0x00000007f2660000, 0x00000007f2725398, 0x00000007f2960000) 326 | to space 3072K, 0% used [0x00000007f2960000, 0x00000007f2960000, 0x00000007f2c60000) 327 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 328 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 329 | compacting perm gen total 52928K, used 52859K [0x00000007fae00000, 0x00000007fe1b0000, 0x0000000800000000) 330 | the space 52928K, 99% used [0x00000007fae00000, 0x00000007fe19ec38, 0x00000007fe19ee00, 0x00000007fe1b0000) 331 | No shared spaces configured. 332 | Event: 17711.453 GC heap after 333 | Heap after GC invocations=140 (full 10): 334 | def new generation total 28032K, used 845K [0x00000007f0e00000, 0x00000007f2c60000, 0x00000007f4350000) 335 | eden space 24960K, 0% used [0x00000007f0e00000, 0x00000007f0e00000, 0x00000007f2660000) 336 | from space 3072K, 27% used [0x00000007f2960000, 0x00000007f2a33568, 0x00000007f2c60000) 337 | to space 3072K, 0% used [0x00000007f2660000, 0x00000007f2660000, 0x00000007f2960000) 338 | tenured generation total 62172K, used 37301K [0x00000007f4350000, 0x00000007f8007000, 0x00000007fae00000) 339 | the space 62172K, 59% used [0x00000007f4350000, 0x00000007f67bd768, 0x00000007f67bd800, 0x00000007f8007000) 340 | compacting perm gen total 52928K, used 52859K [0x00000007fae00000, 0x00000007fe1b0000, 0x0000000800000000) 341 | the space 52928K, 99% used [0x00000007fae00000, 0x00000007fe19ec38, 0x00000007fe19ee00, 0x00000007fe1b0000) 342 | No shared spaces configured. 343 | } 344 | 345 | Deoptimization events (10 events): 346 | Event: 231.057 Thread 0x00007fc415293000 Uncommon trap -83 fr.pc 0x0000000111580b74 347 | Event: 1122.725 Thread 0x00007fc417064800 Uncommon trap -12 fr.pc 0x00000001114a23c0 348 | Event: 2580.898 Thread 0x00007fc413c42000 Uncommon trap -83 fr.pc 0x000000011161fdcc 349 | Event: 2614.601 Thread 0x00007fc417232800 Uncommon trap -83 fr.pc 0x000000011163e150 350 | Event: 4655.362 Thread 0x00007fc417064800 Uncommon trap -12 fr.pc 0x00000001115ff2b4 351 | Event: 5585.733 Thread 0x00007fc417064800 Uncommon trap -83 fr.pc 0x0000000111674fc0 352 | Event: 5615.743 Thread 0x00007fc4168be800 Uncommon trap -83 fr.pc 0x0000000111559d20 353 | Event: 8616.946 Thread 0x00007fc4168be800 Uncommon trap -83 fr.pc 0x000000011152b8f4 354 | Event: 12483.493 Thread 0x00007fc417d7a800 Uncommon trap -83 fr.pc 0x00000001114a3bdc 355 | Event: 15558.580 Thread 0x00007fc4169dc800 Uncommon trap -83 fr.pc 0x000000011173faa0 356 | 357 | Internal exceptions (10 events): 358 | Event: 17749.688 Thread 0x00007fc417064800 Threw 0x00000007f0e9e9f0 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 359 | Event: 17779.670 Thread 0x00007fc4168be800 Threw 0x00000007f0f9aa60 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 360 | Event: 17779.697 Thread 0x00007fc417064800 Threw 0x00000007f0f28520 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 361 | Event: 17809.676 Thread 0x00007fc4168be800 Threw 0x00000007f102bbf8 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 362 | Event: 17809.707 Thread 0x00007fc417064800 Threw 0x00000007f0fa5bf0 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 363 | Event: 17839.682 Thread 0x00007fc4168be800 Threw 0x00000007f10b36f8 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 364 | Event: 17839.716 Thread 0x00007fc417064800 Threw 0x00000007f1037058 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 365 | Event: 17869.693 Thread 0x00007fc4168be800 Threw 0x00000007f114f438 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 366 | Event: 17869.726 Thread 0x00007fc417064800 Threw 0x00000007f10bee28 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 367 | Event: 17899.702 Thread 0x00007fc4168be800 Threw 0x00000007f11d9ae8 at /HUDSON/workspace/jdk7u6-2-build-macosx-amd64-product/jdk7u6/hotspot/src/share/vm/prims/jni.cpp:742 368 | 369 | Events (10 events): 370 | Event: 15625.265 Executing VM operation: RevokeBias 371 | Event: 15625.267 Executing VM operation: RevokeBias done 372 | Event: 15625.268 Executing VM operation: RevokeBias 373 | Event: 15625.268 Executing VM operation: RevokeBias done 374 | Event: 17179.508 Executing VM operation: RevokeBias 375 | Event: 17179.509 Executing VM operation: RevokeBias done 376 | Event: 17179.510 Executing VM operation: RevokeBias 377 | Event: 17179.510 Executing VM operation: RevokeBias done 378 | Event: 17711.424 Executing VM operation: GenCollectForAllocation 379 | Event: 17711.453 Executing VM operation: GenCollectForAllocation done 380 | 381 | 382 | Dynamic libraries: 383 | 0x0000000007d8f000 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa 384 | 0x0000000007d8f000 /System/Library/Frameworks/Security.framework/Versions/A/Security 385 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices 386 | 0x0000000007d8f000 /usr/lib/libz.1.dylib 387 | 0x0000000007d8f000 /usr/lib/libSystem.B.dylib 388 | 0x0000000007d8f000 /usr/lib/libobjc.A.dylib 389 | 0x0000000007d8f000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 390 | 0x0000000007d8f000 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 391 | 0x0000000007d8f000 /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData 392 | 0x0000000007d8f000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation 393 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices 394 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation 395 | 0x0000000007d8f000 /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface 396 | 0x0000000007d8f000 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox 397 | 0x0000000007d8f000 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit 398 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore 399 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv 400 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox 401 | 0x0000000007d8f000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore 402 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition 403 | 0x0000000007d8f000 /usr/lib/libauto.dylib 404 | 0x0000000007d8f000 /usr/lib/libicucore.A.dylib 405 | 0x0000000007d8f000 /usr/lib/libxml2.2.dylib 406 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI 407 | 0x0000000007d8f000 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio 408 | 0x0000000007d8f000 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration 409 | 0x0000000007d8f000 /usr/lib/liblangid.dylib 410 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport 411 | 0x0000000007d8f000 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit 412 | 0x0000000007d8f000 /usr/lib/libDiagnosticMessagesClient.dylib 413 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices 414 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis 415 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage 416 | 0x0000000007d8f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL 417 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing 418 | 0x0000000007d8f000 /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics 419 | 0x0000000007d8f000 /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText 420 | 0x0000000007d8f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO 421 | 0x0000000007d8f000 /usr/lib/libextension.dylib 422 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/Backup.framework/Versions/A/Backup 423 | 0x0000000007d8f000 /usr/lib/libarchive.2.dylib 424 | 0x0000000007d8f000 /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork 425 | 0x0000000007d8f000 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration 426 | 0x0000000007d8f000 /usr/lib/libCRFSuite.dylib 427 | 0x0000000007d8f000 /usr/lib/libc++.1.dylib 428 | 0x0000000007d8f000 /usr/lib/libc++abi.dylib 429 | 0x0000000007d8f000 /usr/lib/system/libcache.dylib 430 | 0x0000000007d8f000 /usr/lib/system/libcommonCrypto.dylib 431 | 0x0000000007d8f000 /usr/lib/system/libcompiler_rt.dylib 432 | 0x0000000007d8f000 /usr/lib/system/libcopyfile.dylib 433 | 0x0000000007d8f000 /usr/lib/system/libcorecrypto.dylib 434 | 0x0000000007d8f000 /usr/lib/system/libdispatch.dylib 435 | 0x0000000007d8f000 /usr/lib/system/libdyld.dylib 436 | 0x0000000007d8f000 /usr/lib/system/libkeymgr.dylib 437 | 0x0000000007d8f000 /usr/lib/system/liblaunch.dylib 438 | 0x0000000007d8f000 /usr/lib/system/libmacho.dylib 439 | 0x0000000007d8f000 /usr/lib/system/libquarantine.dylib 440 | 0x0000000007d8f000 /usr/lib/system/libremovefile.dylib 441 | 0x0000000007d8f000 /usr/lib/system/libsystem_asl.dylib 442 | 0x0000000007d8f000 /usr/lib/system/libsystem_blocks.dylib 443 | 0x0000000007d8f000 /usr/lib/system/libsystem_c.dylib 444 | 0x0000000007d8f000 /usr/lib/system/libsystem_configuration.dylib 445 | 0x0000000007d8f000 /usr/lib/system/libsystem_coreservices.dylib 446 | 0x0000000007d8f000 /usr/lib/system/libsystem_coretls.dylib 447 | 0x0000000007d8f000 /usr/lib/system/libsystem_dnssd.dylib 448 | 0x0000000007d8f000 /usr/lib/system/libsystem_info.dylib 449 | 0x0000000007d8f000 /usr/lib/system/libsystem_kernel.dylib 450 | 0x0000000007d8f000 /usr/lib/system/libsystem_m.dylib 451 | 0x0000000007d8f000 /usr/lib/system/libsystem_malloc.dylib 452 | 0x0000000007d8f000 /usr/lib/system/libsystem_network.dylib 453 | 0x0000000007d8f000 /usr/lib/system/libsystem_networkextension.dylib 454 | 0x0000000007d8f000 /usr/lib/system/libsystem_notify.dylib 455 | 0x0000000007d8f000 /usr/lib/system/libsystem_platform.dylib 456 | 0x0000000007d8f000 /usr/lib/system/libsystem_pthread.dylib 457 | 0x0000000007d8f000 /usr/lib/system/libsystem_sandbox.dylib 458 | 0x0000000007d8f000 /usr/lib/system/libsystem_secinit.dylib 459 | 0x0000000007d8f000 /usr/lib/system/libsystem_stats.dylib 460 | 0x0000000007d8f000 /usr/lib/system/libsystem_trace.dylib 461 | 0x0000000007d8f000 /usr/lib/system/libunc.dylib 462 | 0x0000000007d8f000 /usr/lib/system/libunwind.dylib 463 | 0x0000000007d8f000 /usr/lib/system/libxpc.dylib 464 | 0x0000000007d8f000 /usr/lib/libbz2.1.0.dylib 465 | 0x0000000007d8f000 /usr/lib/liblzma.5.dylib 466 | 0x0000000007d8f000 /usr/lib/libbsm.0.dylib 467 | 0x0000000007d8f000 /usr/lib/libsqlite3.dylib 468 | 0x0000000007d8f000 /usr/lib/system/libkxld.dylib 469 | 0x0000000007d8f000 /usr/lib/libxar.1.dylib 470 | 0x0000000007d8f000 /usr/lib/libpam.2.dylib 471 | 0x0000000007d8f000 /usr/lib/libOpenScriptingUtil.dylib 472 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents 473 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore 474 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata 475 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices 476 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit 477 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE 478 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices 479 | 0x0000000007d8f000 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices 480 | 0x0000000007d8f000 /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS 481 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth 482 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport 483 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC 484 | 0x0000000007d8f000 /usr/lib/libmecabra.dylib 485 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS 486 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync 487 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices 488 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis 489 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore 490 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD 491 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis 492 | 0x0000000007d8f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate 493 | 0x0000000007d8f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage 494 | 0x0000000007d8f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib 495 | 0x0000000007d8f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib 496 | 0x0000000007d8f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib 497 | 0x0000000007d8f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib 498 | 0x0000000007d8f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 499 | 0x0000000007d8f000 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib 500 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib 501 | 0x0000000007d8f000 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib 502 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/AppleVPA.framework/Versions/A/AppleVPA 503 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG 504 | 0x0000000007d8f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib 505 | 0x0000000007d8f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib 506 | 0x0000000007d8f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib 507 | 0x0000000007d8f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib 508 | 0x0000000007d8f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib 509 | 0x0000000007d8f000 /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib 510 | 0x0000000007d8f000 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo 511 | 0x0000000007d8f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib 512 | 0x0000000007d8f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib 513 | 0x0000000007d8f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib 514 | 0x0000000007d8f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib 515 | 0x0000000007d8f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib 516 | 0x0000000007d8f000 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib 517 | 0x0000000007d8f000 /usr/lib/libcups.2.dylib 518 | 0x0000000007d8f000 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos 519 | 0x0000000007d8f000 /System/Library/Frameworks/GSS.framework/Versions/A/GSS 520 | 0x0000000007d8f000 /usr/lib/libresolv.9.dylib 521 | 0x0000000007d8f000 /usr/lib/libiconv.2.dylib 522 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal 523 | 0x0000000007d8f000 /usr/lib/libheimdal-asn1.dylib 524 | 0x0000000007d8f000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory 525 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth 526 | 0x0000000007d8f000 /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory 527 | 0x0000000007d8f000 /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation 528 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling 529 | 0x0000000007d8f000 /usr/lib/libcmph.dylib 530 | 0x0000000007d8f000 /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement 531 | 0x0000000007d8f000 /usr/lib/libxslt.1.dylib 532 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink 533 | 0x0000000007d8f000 /System/Library/Frameworks/QuartzCore.framework/Versions/A/Frameworks/CoreImage.framework/Versions/A/CoreImage 534 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport 535 | 0x0000000007d8f000 /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL 536 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore 537 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/Ubiquity.framework/Versions/A/Ubiquity 538 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices 539 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary 540 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211 541 | 0x0000000007d8f000 /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN 542 | 0x0000000007d8f000 /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth 543 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/CoreWiFi.framework/Versions/A/CoreWiFi 544 | 0x0000000007d8f000 /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth 545 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols 546 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication 547 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication 548 | 0x0000000007d8f000 /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore 549 | 0x0000000110800000 /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/server/libjvm.dylib 550 | 0x0000000007d8f000 /usr/lib/libstdc++.6.dylib 551 | 0x000000010ff6a000 /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/libverify.dylib 552 | 0x000000010ff77000 /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/libjava.dylib 553 | 0x000000010ffb1000 /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/libzip.dylib 554 | 0x0000000114a96000 /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/JavaRuntimeSupport 555 | 0x0000000114aac000 /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/JavaNativeFoundation 556 | 0x000000010fff1000 /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM 557 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon 558 | 0x0000000114ac0000 /System/Library/PrivateFrameworks/JavaLaunching.framework/Versions/A/JavaLaunching 559 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels 560 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help 561 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture 562 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting 563 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print 564 | 0x0000000007d8f000 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI 565 | 0x0000000116a15000 /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/libnio.dylib 566 | 0x0000000116a24000 /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/./libnet.dylib 567 | 0x0000000116960000 /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/libmanagement.dylib 568 | 0x0000000116e2f000 /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/libsunec.dylib 569 | 570 | VM Arguments: 571 | jvm_args: -Dclassworlds.conf=/usr/local/Cellar/maven/3.1.1/libexec/bin/m2.conf -Dmaven.home=/usr/local/Cellar/maven/3.1.1/libexec 572 | java_command: org.codehaus.plexus.classworlds.launcher.Launcher spring-boot:run 573 | Launcher Type: SUN_STANDARD 574 | 575 | Environment Variables: 576 | JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home 577 | PATH=/Users/javier/google-cloud-sdk/bin:/Users/javier/.rvm/gems/ruby-1.9.3-p448/bin:/Users/javier/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/javier/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/javier/.rvm/bin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/sbin:/usr/local/opt/android-sdk/tools:/usr/local/opt/android-sdk/platform-tools:/Users/javier/.ec2/bin 578 | SHELL=/bin/bash 579 | DISPLAY=/private/tmp/com.apple.launchd.4yH5dTTsga/org.macosforge.xquartz:0 580 | 581 | Signal Handlers: 582 | SIGSEGV: [libjvm.dylib+0x4a3a1d], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 583 | SIGBUS: [libjvm.dylib+0x4a3a1d], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 584 | SIGFPE: [libjvm.dylib+0x3b3431], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 585 | SIGPIPE: [libjvm.dylib+0x3b3431], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 586 | SIGXFSZ: [libjvm.dylib+0x3b3431], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 587 | SIGILL: [libjvm.dylib+0x3b3431], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 588 | SIGUSR1: SIG_DFL, sa_mask[0]=0x63807efb, sa_flags=0x00000000 589 | SIGUSR2: [libjvm.dylib+0x3b2fca], sa_mask[0]=0x00000000, sa_flags=0x00000042 590 | SIGHUP: [libjvm.dylib+0x3b122b], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 591 | SIGINT: [libjvm.dylib+0x3b122b], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 592 | SIGTERM: [libjvm.dylib+0x3b122b], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 593 | SIGQUIT: [libjvm.dylib+0x3b122b], sa_mask[0]=0xfffefeff, sa_flags=0x00000042 594 | 595 | 596 | --------------- S Y S T E M --------------- 597 | 598 | OS:Bsduname:Darwin 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 599 | rlimit: STACK 8192k, CORE 0k, NPROC 709, NOFILE 10240, AS infinity 600 | load average:4.12 3.50 2.60 601 | 602 | CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, ht, tsc, tscinvbit, tscinv 603 | 604 | Memory: 4k page, physical 651008k(162752k free) 605 | 606 | /proc/meminfo: 607 | 608 | 609 | vm_info: Java HotSpot(TM) 64-Bit Server VM (23.2-b09) for bsd-amd64 JRE (1.7.0_06-b24), built on Aug 9 2012 20:30:44 by "java_re" with gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00) 610 | 611 | time: Sun May 3 17:11:02 2015 612 | elapsed time: 17899 seconds 613 | 614 | -------------------------------------------------------------------------------- /client/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.test 7 | client 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | client 12 | client 13 | 14 | 15 | UTF-8 16 | demo.EurekaServiceApplication 17 | 1.7 18 | 6.1.2 19 | 20 | 21 | 22 | 23 | 24 | org.springframework.cloud 25 | spring-cloud-starter-parent 26 | 1.0.0.RC1 27 | pom 28 | import 29 | 30 | 31 | 32 | 33 | 34 | 35 | org.springframework.cloud 36 | spring-cloud-starter 37 | 38 | 39 | junit 40 | junit 41 | test 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-starter-web 46 | 47 | 48 | spring-boot-starter-logging 49 | org.springframework.boot 50 | 51 | 52 | 53 | 54 | org.springframework.cloud 55 | spring-cloud-starter-eureka 56 | 57 | 58 | org.springframework.boot 59 | spring-boot-starter-test 60 | test 61 | 62 | 63 | org.springframework.cloud 64 | spring-cloud-starter-hystrix 65 | 66 | 67 | 68 | com.netflix.feign 69 | feign-core 70 | ${feign.version} 71 | 72 | 73 | commons-logging 74 | commons-logging 75 | 1.1.3 76 | 77 | 78 | 79 | 80 | 81 | 82 | org.springframework.boot 83 | spring-boot-maven-plugin 84 | 85 | 86 | 87 | com.netflix.eureka 88 | eureka-core 89 | 90 | 91 | com.netflix.eureka 92 | eureka-client 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | spring-milestones 102 | Spring Maven Milestone Repository 103 | http://repo.spring.io/milestone 104 | 105 | false 106 | 107 | 108 | 109 | spring-snapshots 110 | Spring Snapshots 111 | http://repo.spring.io/snapshot 112 | 113 | true 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /client/src/main/java/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | import org.springframework.cloud.netflix.feign.FeignClientScan; 8 | import org.springframework.context.annotation.ComponentScan; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | @Configuration 12 | @ComponentScan 13 | @EnableAutoConfiguration 14 | @EnableDiscoveryClient 15 | @FeignClientScan 16 | @EnableCircuitBreaker 17 | public class DemoApplication { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(DemoApplication.class, args); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /client/src/main/java/demo/Message.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | public class Message { 4 | 5 | private String message; 6 | 7 | public Message() { 8 | this.message = ""; 9 | } 10 | 11 | public Message(String message) { 12 | this.message = message; 13 | } 14 | 15 | public String getMessage() { 16 | return message; 17 | } 18 | 19 | public void setMessage(String message) { 20 | this.message = message; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /client/src/main/java/demo/MessageController.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class MessageController { 11 | 12 | @Autowired 13 | private MicroservicesHystrixClient client; 14 | 15 | @RequestMapping("/") 16 | ResponseEntity home() { 17 | return new ResponseEntity(new Message(client.helloworld().getMessage() + " - " + client.greetings().getMessage() ), HttpStatus.ACCEPTED); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /client/src/main/java/demo/MicroservicesClient.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.cloud.netflix.feign.FeignClient; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | 7 | @FeignClient("zuulserver") 8 | public interface MicroservicesClient { 9 | 10 | @RequestMapping(method = RequestMethod.GET, value = "/helloworld") 11 | public Message helloworld(); 12 | 13 | @RequestMapping(method = RequestMethod.GET, value = "/greetings") 14 | public Message greetings(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /client/src/main/java/demo/MicroservicesHystrixClient.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Component; 5 | 6 | import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; 7 | 8 | @Component 9 | public class MicroservicesHystrixClient { 10 | 11 | @Autowired 12 | private MicroservicesClient client; 13 | 14 | @HystrixCommand(fallbackMethod="helloworldFallback") 15 | public Message helloworld() { 16 | return client.helloworld(); 17 | }; 18 | 19 | @HystrixCommand(fallbackMethod="greetingsFallback") 20 | public Message greetings() { 21 | return client.greetings(); 22 | }; 23 | 24 | public Message helloworldFallback() { 25 | return new Message("Hystrix saluda al mundo"); 26 | }; 27 | 28 | public Message greetingsFallback() { 29 | return new Message("que tengas un buen día desde Hystrix"); 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9001 3 | info: 4 | component: client app 5 | endpoints: 6 | shutdown: 7 | enabled: true 8 | restart: 9 | enabled: true 10 | spring: 11 | config: 12 | name: microservicesclient 13 | application: 14 | name: microservicesclient 15 | cloud: 16 | config: 17 | enabled: false 18 | zuulserver: 19 | ribbon: 20 | listOfServers: localhost:8080 21 | 22 | # the eureka vipAddress of the target service (Disabled) 23 | #DeploymentContextBasedVipAddresses: samplebackendservice 24 | 25 | # Max number of retries on the same server (excluding the first try) 26 | MaxAutoRetries: 1 27 | 28 | # Max number of next servers to retry (excluding the first server) 29 | MaxAutoRetriesNextServer: 1 30 | 31 | # Whether all operations can be retried for this client 32 | OkToRetryOnAllOperations: true 33 | 34 | # Interval to refresh the server list from the source 35 | ServerListRefreshInterval: 2000 36 | 37 | # Connect timeout used by Apache HttpClient 38 | ConnectTimeout: 3000 39 | 40 | # Read timeout used by Apache HttpClient 41 | ReadTimeout: 3000 -------------------------------------------------------------------------------- /client/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: microservicesclient 4 | cloud: 5 | config: 6 | enabled: false -------------------------------------------------------------------------------- /microservice-greetings/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /microservice-greetings/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.test 7 | greetings 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | greetings 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.2.0.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | demo.DemoApplication 24 | 1.7 25 | 1.0.0.RELEASE 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.cloud 32 | spring-cloud-starter-parent 33 | 1.0.0.RC1 34 | pom 35 | import 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.springframework.cloud 43 | spring-cloud-starter 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-web 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-starter-test 52 | test 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-starter-actuator 57 | 58 | 59 | org.springframework.cloud 60 | spring-cloud-starter-eureka 61 | 62 | 63 | org.springframework.cloud 64 | spring-cloud-starter-bus-amqp 65 | 66 | 67 | 68 | 69 | 70 | 71 | org.springframework.boot 72 | spring-boot-maven-plugin 73 | 74 | 75 | 76 | 77 | 78 | 79 | spring-snapshots 80 | Spring Snapshots 81 | http://repo.spring.io/libs-snapshot-local 82 | 83 | true 84 | 85 | 86 | 87 | spring-milestones 88 | Spring Milestones 89 | http://repo.spring.io/libs-milestone-local 90 | 91 | false 92 | 93 | 94 | 95 | spring-releases 96 | Spring Releases 97 | http://repo.spring.io/libs-release-local 98 | 99 | false 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /microservice-greetings/src/main/java/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | @Configuration 10 | @EnableAutoConfiguration 11 | @SpringBootApplication 12 | @EnableDiscoveryClient 13 | public class DemoApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(DemoApplication.class, args); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /microservice-greetings/src/main/java/demo/Message.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | public class Message { 4 | 5 | private String message; 6 | 7 | public Message() { 8 | this.message = ""; 9 | } 10 | 11 | public Message(String message) { 12 | this.message = message; 13 | } 14 | 15 | public String getMessage() { 16 | return message; 17 | } 18 | 19 | public void setMessage(String message) { 20 | this.message = message; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /microservice-greetings/src/main/java/demo/MessageController.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.http.ResponseEntity; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class MessageController { 11 | 12 | @Value("${server.port}") 13 | private int serverPort = 0; 14 | 15 | @RequestMapping("/") 16 | ResponseEntity home() { 17 | System.out.println("Greetings "+ serverPort); 18 | return new ResponseEntity(new Message("Buen dia"), HttpStatus.ACCEPTED); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /microservice-greetings/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9100 3 | endpoints: 4 | shutdown: 5 | enabled: true 6 | restart: 7 | enabled: true 8 | spring: 9 | config: 10 | name: greetings 11 | application: 12 | name: greetings 13 | cloud: 14 | config: 15 | enabled: true 16 | uri: http://localhost:8888 17 | failFast: true 18 | eureka: 19 | client: 20 | serviceUrl: 21 | defaultZone: http://localhost:8761/eureka/ 22 | instance: 23 | metadataMap: 24 | instanceId: ${spring.application.name}:${server.port} -------------------------------------------------------------------------------- /microservice-greetings/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: greetings 4 | -------------------------------------------------------------------------------- /microservice-greetings/src/test/java/demo/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.test.context.web.WebAppConfiguration; 7 | import org.springframework.boot.test.SpringApplicationConfiguration; 8 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 9 | 10 | @RunWith(SpringJUnit4ClassRunner.class) 11 | @SpringApplicationConfiguration(classes = DemoApplication.class) 12 | @WebAppConfiguration 13 | public class DemoApplicationTests { 14 | 15 | @Test 16 | @Ignore 17 | public void contextLoads() { 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /microservice-helloworld/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /microservice-helloworld/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.test 7 | demo 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | demo 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.2.0.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | demo.DemoApplication 24 | 1.7 25 | 1.0.0.RELEASE 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.cloud 32 | spring-cloud-starter-parent 33 | 1.0.0.RC1 34 | pom 35 | import 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.springframework.cloud 43 | spring-cloud-starter 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-web 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-starter-test 52 | test 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-starter-actuator 57 | 58 | 59 | org.springframework.cloud 60 | spring-cloud-starter-eureka 61 | 62 | 63 | org.springframework.cloud 64 | spring-cloud-starter-bus-amqp 65 | 66 | 67 | 68 | 69 | 70 | 71 | org.springframework.boot 72 | spring-boot-maven-plugin 73 | 74 | 75 | 76 | 77 | 78 | 79 | spring-snapshots 80 | Spring Snapshots 81 | http://repo.spring.io/libs-snapshot-local 82 | 83 | true 84 | 85 | 86 | 87 | spring-milestones 88 | Spring Milestones 89 | http://repo.spring.io/libs-milestone-local 90 | 91 | false 92 | 93 | 94 | 95 | spring-releases 96 | Spring Releases 97 | http://repo.spring.io/libs-release-local 98 | 99 | false 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /microservice-helloworld/src/main/java/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | @Configuration 10 | @EnableAutoConfiguration 11 | @SpringBootApplication 12 | @EnableDiscoveryClient 13 | public class DemoApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(DemoApplication.class, args); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /microservice-helloworld/src/main/java/demo/Message.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | public class Message { 4 | 5 | private String message; 6 | 7 | public Message() { 8 | this.message = ""; 9 | } 10 | 11 | public Message(String message) { 12 | this.message = message; 13 | } 14 | 15 | public String getMessage() { 16 | return message; 17 | } 18 | 19 | public void setMessage(String message) { 20 | this.message = message; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /microservice-helloworld/src/main/java/demo/MessageController.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.cloud.context.config.annotation.RefreshScope; 5 | import org.springframework.http.HttpStatus; 6 | import org.springframework.http.ResponseEntity; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RefreshScope 11 | @RestController 12 | public class MessageController { 13 | 14 | @Value("${nombre}") 15 | private String nombre; 16 | 17 | @RequestMapping("/") 18 | ResponseEntity home() { 19 | return new ResponseEntity(new Message("Hello " + nombre), HttpStatus.ACCEPTED); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /microservice-helloworld/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9000 3 | endpoints: 4 | shutdown: 5 | enabled: true 6 | restart: 7 | enabled: true 8 | eureka: 9 | client: 10 | serviceUrl: 11 | defaultZone: http://localhost:8761/eureka/ 12 | spring: 13 | config: 14 | name: helloworld 15 | application: 16 | name: helloworld -------------------------------------------------------------------------------- /microservice-helloworld/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | config: 3 | name: helloworld 4 | application: 5 | name: helloworld 6 | cloud: 7 | config: 8 | enabled: true 9 | uri: http://localhost:8888 10 | failFast: true 11 | -------------------------------------------------------------------------------- /microservice-helloworld/src/test/java/demo/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.test.context.web.WebAppConfiguration; 7 | import org.springframework.boot.test.SpringApplicationConfiguration; 8 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 9 | 10 | @RunWith(SpringJUnit4ClassRunner.class) 11 | @SpringApplicationConfiguration(classes = DemoApplication.class) 12 | @WebAppConfiguration 13 | public class DemoApplicationTests { 14 | 15 | @Test 16 | @Ignore 17 | public void contextLoads() { 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /paso-1.md: -------------------------------------------------------------------------------- 1 | #paso 1 : mi primer microservicio spring-boot 2 | ##qué es un microservicio ? 3 | hay muchísima literatura sobre el tema (incluso quizás demasiada) así que vamos a resumir en que un microservicio como: 4 | > Es una técnica de diseño de sistemas como una colección de pequeños servicios, cada uno ejecutándose en su propio proceso, comunicándose con protocolos ligeros como HTTP/JSon y gestionados desde fuera. 5 | 6 | algunas características: 7 | 8 | * componentización, 9 | * organización basada en capacidades funcionales de negocio, 10 | * gestión descentralizada, 11 | * endpoints inteligentes, 12 | * gestión de datos descentralizados, 13 | * automatización de infraestructura, 14 | 15 | lecturas recomendadas: 16 | * http://martinfowler.com/articles/microservices.html 17 | * http://microservices.io/patterns/microservices.html 18 | * http://en.wikipedia.org/wiki/Microservices 19 | 20 | esta técnica de diseño tiene problemáticas específicas: 21 | - ¿cómo configurar los servicios centralizadamente? 22 | - ¿cómo gestionar el tráfico hacia los servicios? 23 | - ¿cómo expongo y comunico los servicios entre ellos? 24 | - ¿cómo monitorizo los servicios? 25 | - ¿cómo detecto que un servicio falla y evito enviarle tráfico? 26 | - ¿cómo comunico los servicios entre ellos? 27 | - ¿cómo envío mensajes a los servicios? (o a los de un tipo) 28 | 29 | ##qué es spring boot 30 | spring boot es un automatismo para simplificar la creación de proyectos, desarrollo, empaquetamiento y ejecución de aplicaciones web basadas en el stack tecnológico de spring y maven/gradle y empaquetando en un "fat-JAR" el contenedor de servlets preferido (jetty, tomcat, undertow, etc). dicho de otra forma, han aprendido de los bootstraps de javascript y lo han traido al mundo java elegantemente. 31 | 32 | spring boot simplifica tremendamente la configuración a partir de los scanners (busca los beans del contexto mediante sus anotaciones), el fallback de configuraciones (desde parámetros en la línea de comando hasta propiedades del sistema operativo), [los actuators](http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready) (endpoints "plugables" para añadir características de administración como shutdown, ver configuración, salud, etc). Los más relevantes: 33 | * /autoconfig : Displays an auto-configuration report showing all auto-configuration candidates and the reason why they ‘were’ or ‘were not’ applied. 34 | * /beans : Displays a complete list of all the Spring Beans in your application. 35 | * /configprops : Displays a collated list of all @ConfigurationProperties. 36 | * /dump : Performs a thread dump. 37 | * /env : Exposes properties from Spring’s ConfigurableEnvironment. 38 | * /health : Shows application health information (a simple ‘status’ when accessed over an unauthenticated connection or full message details when authenticated). 39 | * /info : Displays arbitrary application info. 40 | * /metrics : Shows ‘metrics’ information for the current application. 41 | * /mappings : Displays a collated list of all @RequestMapping paths. 42 | * /shutdown : Allows the application to be gracefully shutdown (not enabled by default). 43 | * /trace : Displays trace information (by default the last few HTTP requests). 44 | 45 | nuevamente, hay mucha literatura sobre el tema y recomiendo: 46 | * su documentación oficial en http://projects.spring.io/spring-boot/#quick-start 47 | * http://spring.io/guides/tutorials/bookmarks/ 48 | * http://www.infoq.com/articles/microframeworks1-spring-boot 49 | 50 | ##hellow (micro) world 51 | 52 | con spring boot vamos a crear microservicios de la forma más sencilla posible: 53 | 1. Abre http://start.spring.io/ , 54 | 2. personaliza el formulario (no selecciones ningún check aún) 55 | 3. con el botón "Generate project" descargarás un zip con el pom.xml y fuentes. 56 | 4. descomprímelo 57 | 5. Crear una clase MessageController con un controlador para GET / : 58 | ```java 59 | @RestController 60 | @EnableAutoConfiguration 61 | public class MessageController { 62 | 63 | @RequestMapping("/") 64 | ResponseEntity home() { 65 | return new ResponseEntity( new Message("Hello World!") , HttpStatus.ACCEPTED); 66 | } 67 | } 68 | ``` 69 | 6. crear la classe ```Message``` con un atributo ```message``` y getters/setters (o mejor usar [lombok](http://projectlombok.org/)) 70 | 7. además añadiremos la dependencia de los actuators para poder jugar con ellos 71 | ```xml 72 | 73 | org.springframework.boot 74 | spring-boot-starter-actuator 75 | 76 | ``` 77 | 8. algunos actuators requieren configuración, así que editaremos el ```/src/main/resources/application.properties``` donde también podríamos setear el ```server.port``` si queremos asignarle un valor diferente al 8080 por defecto o cambiar el ```management.port``` para los actuators 78 | ```properties 79 | endpoints.shutdown.enabled=true 80 | ``` 81 | 9. desde línea de comandos ejecutar spring-boot 82 | ```sh 83 | $ mvn spring-boot:run 84 | ``` 85 | o también podemos hacer un: 86 | ```sh 87 | $ mvn install 88 | $ java -jar target/demo-0.0.1-SNAPSHOT.jar 89 | ``` 90 | 9. desde un navegador, acceder a http://localhost:8080 91 | 10. cuando queramos terminar, podemos hacer un control-c o aprovechar el actuator que hemos activado y hacer 92 | ```sh 93 | curl -XPOST http://localhost:8080/shutdown 94 | ``` 95 | 96 | 97 | -------------------------------------------------------------------------------- /paso-2.md: -------------------------------------------------------------------------------- 1 | # paso 2 : comenzando con netflix oss 2 | ## la problemática de los microservicios 3 | - configuración centralizada y versionada 4 | - gestionar el tráfico hacia los servicios 5 | - exponer y comunicar los servicios entre ellos 6 | - monitorizar los servicios 7 | - detectar que un servicio falla y evitar enviarle tráfico 8 | - mensajes entre los servicios (o a los de un tipo) 9 | 10 | ## qué es netflix oss ? 11 | netflix open source software center, la externalización de proyectos de ingeniería software de netflix, ver http://netflix.github.io/ 12 | 13 | ## el primer servicio netflix: archaius 14 | - archaius es un servidor de configuraciones 15 | - configuraciones globales y específicas 16 | - cambios en caliente 17 | - versionado 18 | - se puede definir mediante spring boot 19 | - para ellos vamos a crear un proyecto spring-boot llamado ```service-archaius```con su ```pom.xml``` donde definiremos el parent para spring cloud y la dependency con el artefacto de servidor de configuraciones: 20 | 21 | ```xml 22 | 23 | org.springframework.cloud 24 | spring-cloud-starter-parent 25 | 1.0.0.RELEASE 26 | 27 | 28 | 29 | 30 | org.springframework.cloud 31 | spring-cloud-config-server 32 | 33 | 34 | ``` 35 | - crearemos una clase princpal con las anotaciones: 36 | 37 | ```java 38 | @SpringBootApplication 39 | @EnableConfigServer 40 | public class ArchaiusServiceApplication { 41 | 42 | public static void main(String[] args) { 43 | SpringApplication.run(ArchaiusServiceApplication.class, args); 44 | } 45 | } 46 | ``` 47 | - crearemos un fichero src/main/resources/application.yml para indicar que pondremos el fichero de configuración en github (podría estar en fichero, en url, etc): 48 | 49 | ```yaml 50 | server: 51 | port: 8888 52 | 53 | spring: 54 | cloud: 55 | config: 56 | server: 57 | git: 58 | uri: https://github.com/jantoniucci/archaius-config 59 | ``` 60 | - en ese github ponemos el helloworld.properties o el yaml con la configuración y podemos indicar con sufijos el entorno al que pertenecen. 61 | - podemos encriptar valores 62 | - podemos configurar usuario y contraseña de acceso 63 | - lanzamos archaius: 64 | ```sh 65 | $ mvn spring-boot:run 66 | ``` 67 | - lo probamos con curl: 68 | ```sh 69 | $ curl http://localhost:8888/helloworld/prod 70 | ``` 71 | 72 | ## actualizamos el microservicio para usar configuración distribuida 73 | - añadimos en el pom.xml del microservice-helloworld la dependencia: 74 | 75 | ```xml 76 | 77 | 78 | 79 | org.springframework.cloud 80 | spring-cloud-starter-parent 81 | 1.0.0.RC1 82 | pom 83 | import 84 | 85 | 86 | 87 | ... 88 | 89 | org.springframework.cloud 90 | spring-cloud-starter 91 | 92 | ``` 93 | - configuramos el ```application.properties``` para añadir la configuración del servidor: 94 | ```properties 95 | endpoints.shutdown.enabled=true 96 | endpoints.restart.enabled=true 97 | spring.application.name=helloworld 98 | spring.cloud.config.enabled=true 99 | spring.cloud.config.uri=http://localhost:8888 100 | spring.cloud.config.failFast=true 101 | ``` 102 | 103 | - modificamos la clase principal para añadir el soporte a configuraciones: 104 | 105 | ```java 106 | @Configuration 107 | @EnableAutoConfiguration 108 | @SpringBootApplication 109 | public class DemoApplication { 110 | public static void main(String[] args) { 111 | SpringApplication.run(DemoApplication.class, args); 112 | } 113 | } 114 | ``` 115 | - modificamos el controller para usar la configuración con el clásico @Value: 116 | 117 | ```java 118 | @RestController 119 | public class MessageController { 120 | @Value("${nombre}") 121 | private String nombre; 122 | 123 | @RequestMapping("/") 124 | ResponseEntity home() { 125 | return new ResponseEntity(new Message("Hello " + nombre), HttpStatus.ACCEPTED); 126 | } 127 | } 128 | 129 | ``` 130 | 131 | ## cambiar la configuración en caliente a un microservicio 132 | ```sh 133 | $ curl http://localhost:8080/env -d nombre=JAVIER 134 | {"nombre":"JAVIER"} 135 | $ curl http://localhost:8080/refresh -d helloworld 136 | [] 137 | $ curl http://localhost:8080/restart -d helloworld 138 | {"message":"Restarting"} 139 | $ curl http://localhost:8080/ 140 | {"message":"Hello JAVIER"} 141 | ``` 142 | ## cambiar la configuración en caliente en el repo y los microservicios 143 | - Añadir @RefreshScope a las clases que usen configuraciones: 144 | 145 | ```java 146 | @RefreshScope 147 | @RestController 148 | public class MessageController { 149 | 150 | @Value("${nombre}") 151 | private String nombre; 152 | 153 | @RequestMapping("/") 154 | ResponseEntity home() { 155 | return new ResponseEntity(new Message("Hello " + nombre), HttpStatus.ACCEPTED); 156 | } 157 | } 158 | ``` 159 | 160 | - hacemos la prueba 161 | 162 | ```sh 163 | $ curl http://localhost:8080/ 164 | {"message":"Hello Javier"} 165 | --- hacemos el cambio en el GIT a nombre=JavierA 166 | $ curl http://localhost:8080/refresh -d helloworld 167 | ["nombre"] 168 | $ curl http://localhost:8080/ 169 | {"message":"Hello JavierA"} 170 | ``` 171 | 172 | -------------------------------------------------------------------------------- /paso-3.md: -------------------------------------------------------------------------------- 1 | #paso 3 : registro y localización de microservicios 2 | ## registro, localización y eureka! 3 | esta agilidad de lanzar y eliminar microservicios en IPs y puertos diferentes es muy ágil pero tiene un precio: encontrarlos . el sistema eureka viene a gestionar los registros de los microservicios y las consultas de sus clientes intentando localizarlos. 4 | 5 | Eureka es un servicio basado en servicios REST ideado para balancear carga y proporcionar acciones “failover” de los servicios que gestiona. Se comenzó a usar en el AWS de amazon, para después ser incluido en la plataforma netflix. 6 | ## instanciando un servidor 7 | Creamos un proyecto spring boot (podemos copiar el pom.xml anterior, archaius) y añadimos la siguiente dependencia 8 | ```xml 9 | 10 | org.springframework.cloud 11 | spring-cloud-starter-parent 12 | 1.0.0.RELEASE 13 | 14 | ... 15 | 16 | 17 | org.springframework.cloud 18 | spring-cloud-starter-eureka-server 19 | 20 | 21 | ... 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-maven-plugin 27 | 28 | 29 | 30 | 31 | ``` 32 | Luego crear una aplicación: 33 | ```java 34 | @Configuration 35 | @EnableEurekaServer 36 | @EnableAutoConfiguration 37 | public class EurekaServiceApplication { 38 | 39 | public static void main(String[] args) { 40 | new SpringApplicationBuilder(EurekaServiceApplication.class).web(true).run(args); 41 | } 42 | } 43 | ``` 44 | Y finalmente, incorporar la configuración en el ```application.yml``` : 45 | ```yml 46 | server: 47 | port: 8761 48 | spring: 49 | application: 50 | name:eureka 51 | cloud: 52 | config: 53 | enabled: false 54 | eureka: 55 | instance: 56 | hostname: localhost 57 | client: 58 | registerWithEureka: false 59 | fetchRegistry: false 60 | serviceUrl: 61 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 62 | ``` 63 | Ahora ya podemos inciar el servidor con: 64 | ```sh 65 | $ mvn spring-boot:run 66 | ``` 67 | y probarlo accediendo a su consola en http://localhost:8761 68 | 69 | ## añadiendo el cliente al microservicio 70 | copiamos el proyecto ```microservicio-helloworld``` a un nuevo proyecto ```microservicio-greetings``` renombrando el artifactId en el pom.xml y añadiéndole la dependencia: 71 | ```xml 72 | 73 | org.springframework.cloud 74 | spring-cloud-starter-eureka 75 | 76 | ``` 77 | y actualizando la clase principal: 78 | ```java 79 | @Configuration 80 | @EnableAutoConfiguration 81 | @SpringBootApplication 82 | @EnableDiscoveryClient 83 | public class DemoApplication { 84 | public static void main(String[] args) { 85 | SpringApplication.run(DemoApplication.class, args); 86 | } 87 | } 88 | ``` 89 | el application.yml debe configurar el puerto 9000 y la url del servidor de eureka: 90 | ```yml 91 | server: 92 | port: 9100 93 | spring: 94 | application: 95 | name: greetings 96 | cloud: 97 | config: 98 | enabled: false 99 | endpoints: 100 | shutdown: 101 | enabled: true 102 | restart: 103 | enabled: true 104 | eureka: 105 | client: 106 | serviceUrl: 107 | defaultZone: http://localhost:8761/eureka/ 108 | 109 | ``` 110 | y modificamos el controller para que retorne "buenos dias"... 111 | también vamos a modificar el proyecto hello-world 112 | - en el pom.xml el spring-cloud-starter-eureka 113 | - en el DemoApplication el @EnableDiscoveryClient 114 | - en el application.xml el eureka:client:serviceUrl:defaultZone:... 115 | 116 | ## la consola de eureka 117 | en la consola de eureka http://localhost:8761/ veremos nuestros servicios en la sección "Instances currently registered with Eureka" -------------------------------------------------------------------------------- /paso-4.md: -------------------------------------------------------------------------------- 1 | #paso 4 : gestionando peticiones a microservicios 2 | ##enrutado, balanceo y otros malabares 3 | para que las peticiones de clientes externos e internos lleguen a nuestros microservicios necesitamos que una pieza intermediaria gestione el enrutado. [Zuul](https://github.com/Netflix/zuul) es un enrutador y balanceador de carga que se integra perfectamente con eureka de tal manera que enrutará llamadas a urls con servicios eureka, haciendo transparente a cual de todas las instancias del mismo servicio está enrutando la llamada. 4 | 5 | para instanciar a Zuul, creamos una aplicación spring boot y añadimos la dependencia maven de zuul 6 | ```xml 7 | 8 | org.springframework.cloud 9 | spring-cloud-netflix-zuul-server 10 | 1.0.0.BUILD-SNAPSHOT 11 | 12 | ``` 13 | 14 | incluir la anotación @EnableZuulProxy en la clase principal de la aplicación ZuulServiceApplication.java 15 | ```java 16 | @Configuration 17 | @ComponentScan 18 | @EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class}) 19 | @EnableDiscoveryClient 20 | @EnableZuulProxy 21 | public class ZuulServiceApplication { 22 | public static void main( String[] args ){ 23 | SpringApplication.run(ZuulServiceApplication.class, args); 24 | } 25 | } 26 | ``` 27 | e indicar en el ```application.yml``` que atenderá el puerto 8080 y las rutas que utilizará 28 | ```yml 29 | server: 30 | port: 8080 31 | zuul: 32 | routes: 33 | greetings: 34 | path: /greetings/** 35 | serviceId: GREETINGS 36 | helloworld: 37 | path: /helloworld/** 38 | serviceId: HELLOWORLD 39 | ``` 40 | finalmente, lo lanzamos con un: 41 | ```sh 42 | $ mvn spring-boot:run 43 | ``` 44 | ##invocando a zuul 45 | http://localhost:8080/helloworld 46 | http://localhost:8080/greetings 47 | ##algunas pruebas 48 | vamos a crear otra instancia de greetings ejecutando un ```mvn install``` y luego un: 49 | ```sh 50 | $ java -jar target/demo-0.0.1-SNAPSHOT.jar --server.port=9876 51 | ``` 52 | con el que iniciamos otra instancia en otro puerto 53 | 54 | vemos en la consola de eureka que el estado del servicio es UP(2) 55 | 56 | si lanzamos peticiones, veremos que se balancean entre ambas instancias 57 | 58 | ##...y otras pruebas más 59 | quitamos todas las instancias y vemos cómo reacciona zuul 60 | -------------------------------------------------------------------------------- /paso-5.md: -------------------------------------------------------------------------------- 1 | #paso 5 : clientes inteligentes 2 | ##un poco de contexto 3 | ya tenemos microservicios autocontenidos, que buscan configuración en archaius, que se registran a eureka y que se les balancea tráfico desde zuul. 4 | 5 | teóricamente, cada microservicio debe autocontener el acceso a la persistencia que requieran pero en muchas ocasiones tienen dependencias con otros microservicios a los que tienen que invocar. 6 | 7 | estos clientes deben resolver cuestiones como: 8 | * scafolding (feign) 9 | * balanceo en cliente (ribbon) 10 | * circuit-braker (hystrix) 11 | * monitorización de clientes 12 | 13 | ##crear un cliente con Feign 14 | Feign es un framework de scaffolding para implementar clientes REST declarativamente. 15 | 16 | funciona a partir de anotaciones, es muy customizable, pudiendo definir diversos encoders y decoders para el formateo de intercambio (json, xml, yaml, etc). 17 | 18 | Entre sus ventajas más relevantes: 19 | * Auto-magia 20 | * Uso de “converters” de Spring para codificar y descodificar el formato de intercambio 21 | * Compatibilidad con anotaciones de Spring MVC 22 | * Bien integrado con Ribbon y Eureka 23 | 24 | el cliente que construiremos invocará a los microservicios helloworld y greetings utilizando feign. creamos un proyecto spring-boot con las siguientes dependencias: 25 | ```xml 26 | 27 | org.springframework.cloud 28 | spring-cloud-starter 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-web 33 | 34 | 35 | org.springframework.cloud 36 | spring-cloud-starter-eureka 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-test 41 | test 42 | 43 | 44 | com.netflix.feign 45 | feign-core 46 | ${feign.version} 47 | 48 | ``` 49 | 50 | el cliente se crea a partir de una interfaz anotadada como FeignClient y cuyos métodos indican los end-points a utilizar: 51 | 52 | ```java 53 | @FeignClient("zuulserver") 54 | public interface MicroservicesClient { 55 | 56 | @RequestMapping(method = RequestMethod.GET, value = "/helloworld") 57 | public Message helloworld(); 58 | 59 | @RequestMapping(method = RequestMethod.GET, value = "/greetings") 60 | public Message greetings(); 61 | 62 | } 63 | ``` 64 | zuul entonces derivará estas invocaciones a los microservicios correspondientes 65 | 66 | y para que este cliente sea encontrado debemos anotar la clase principal: 67 | ```java 68 | @Configuration 69 | @ComponentScan 70 | @EnableAutoConfiguration 71 | @EnableDiscoveryClient 72 | @FeignClientScan 73 | public class DemoApplication { 74 | 75 | public static void main(String[] args) { 76 | SpringApplication.run(DemoApplication.class, args); 77 | } 78 | 79 | } 80 | ``` 81 | este cliente lo expondremos a través de un controlador específico: 82 | ```java 83 | @RestController 84 | public class MessageController { 85 | 86 | @Autowired 87 | private MicroservicesClient client; 88 | 89 | @RequestMapping("/") 90 | ResponseEntity home() { 91 | return new ResponseEntity(new Message(client.helloworld().getMessage() + " - " + client.greetings().getMessage() ), HttpStatus.ACCEPTED); 92 | } 93 | } 94 | ``` 95 | ##añadirle balanceo en cliente con ribbon 96 | Ribbon es un balanceado de carga en cliente para los protocolos de transportes más conocidos (http, tcp, udp). 97 | 98 | se le pueden definir algoritmos de balance de carga “pluggables”, lo que nos da la posibilidad de crear nuestro propio protocolo de carga. Por defecto proporciona los algoritmos más conocidos: Round robin, “best available”, random y response time based. 99 | 100 | soporta listas estáticas de nombres de servicios muy adecuadas para usar con el servidor Eureka. 101 | 102 | por último, actualizamos el application.yml para incorporar la configuración del zuulserver: 103 | ```yml 104 | zuulserver: 105 | ribbon: 106 | listOfServers: localhost:8080 107 | ``` 108 | si lanzamos el servidor y abrimos http://localhost:9001/ veremos el mensaje resultante de las invocaciones a ambos microservicios: 109 | ```json 110 | { 111 | message: "Hello JavierA - Buen dia" 112 | } 113 | ``` 114 | ##añadirle circuit-braker con hystrix 115 | las responsabilidades de un circuit-braker buscan mejorar el comportamiento de los clientes ante fallos de los servicios, las comunicaciones, etc. y mejorar el comportamiento de los servicios ante fallos en cascada, monitorización y alertas. 116 | 117 | Entre sus principales funciones: 118 | * dotar al cliente de fail-fast y fall-back 119 | * evitar el over flooding del servicio 120 | * añadir al cliente capacidades de monitorización y logs 121 | * ver http://martinfowler.com/bliki/CircuitBreaker.html , http://www.lordofthejars.com/2014/09/defend-your-application-with-hystrix.html , https://github.com/Netflix/Hystrix/wiki y para los más curiosos https://github.com/Netflix/Hystrix/wiki/How-it-Works 122 | 123 | primero debemos añadir la dependencia: 124 | ```xml 125 | 126 | org.springframework.cloud 127 | spring-cloud-starter-hystrix 128 | 129 | 130 | ``` 131 | luego creamos un nuevo cliente que envuelva al anterior y que utilice la anotación @HystrixCommand para indicar los métodos que serán protegidos con Hystrix. en dicha anotaciones aprovechamos para configurar el método alternativo al que se invocará cuando el cliente no funcione. 132 | ```java 133 | @Component 134 | public class MicroservicesHystrixClient { 135 | 136 | @Autowired 137 | private MicroservicesClient client; 138 | 139 | @HystrixCommand(fallbackMethod="helloworldFallback") 140 | public Message helloworld() { 141 | return client.helloworld(); 142 | }; 143 | 144 | @HystrixCommand(fallbackMethod="greetingsFallback") 145 | public Message greetings() { 146 | return client.greetings(); 147 | }; 148 | 149 | public Message helloworldFallback() { 150 | return new Message("Hystrix saluda al mundo"); 151 | }; 152 | 153 | public Message greetingsFallback() { 154 | return new Message("que tengas un buen día desde Hystrix"); 155 | }; 156 | 157 | } 158 | ``` 159 | en el MessageController cambiamos el cliente para usar el nuevo : 160 | ```java 161 | @Autowired 162 | private MicroservicesHystrixClient client; 163 | ``` 164 | y finalmente incluimos la anotación ```@EnableCircuitBreaker``` en la clase principal. 165 | 166 | si desconectamos / apagamos los servicios e invocamos al cliente http://localhost:9001/ obtendremos: 167 | ```json 168 | { 169 | message: "Hystrix saluda al mundo - que tengas un buen día desde Hystrix" 170 | } 171 | ``` 172 | ###monitorizando clientes con hystrix dashboard 173 | hystrix dispone de una consola de monitorización que podemos instanciar mediante una aplicación spring-boot con las siguientes dependencias: 174 | ```xml 175 | 176 | org.springframework.cloud 177 | spring-cloud-starter-hystrix 178 | 179 | 180 | org.springframework.cloud 181 | spring-cloud-starter-hystrix-dashboard 182 | 183 | ``` 184 | la clase principal de dicha aplicación debe contener la anotación @EnableHystrixDashboard 185 | ```java 186 | @Configuration 187 | @EnableAutoConfiguration 188 | @EnableHystrixDashboard 189 | @ComponentScan 190 | public class HystrixDashboardApp 191 | { 192 | public static void main( String[] args ) 193 | { 194 | new SpringApplicationBuilder(HystrixDashboardApp.class).web(true).run(args); 195 | } 196 | } 197 | ``` 198 | en el ```application.yml``` añadimos: 199 | ```yml 200 | server: 201 | port: 9002 202 | spring: 203 | application: 204 | name:hystrixdashboard 205 | config: 206 | name:hystrixdashboard 207 | security: 208 | ignored:true 209 | ``` 210 | 211 | arrancamos la aplicación con ```mvn spring-boot:run``` y cuando esté iniciada lanzamos un navegador con la url http://localhost:9002/hystrix para visualizar la consola 212 | 213 | en la consola, debemos configurar los servicios a monitorizar indicando la url de stream http://localhost:9001/hystrix.stream 214 | 215 | ###clusterizando la monitorización hystrix con turbine 216 | tubrine nos permite monitorizar todos los clientes desde un mismo dashboard 217 | 218 | turbine usa eureka para descubrir los servicios registrados 219 | 220 | para utilizaro, comenamos añadiendo la dependencia en el ```pom.xml```: 221 | ```xml 222 | 223 | org.springframework.cloud 224 | spring-cloud-netflix-turbine 225 | 226 | ``` 227 | en la aplicación principal añadimos la anotación ```@EnableTurbine```: 228 | ```java 229 | @Configuration 230 | @ComponentScan 231 | @EnableAutoConfiguration 232 | @EnableDiscoveryClient 233 | @FeignClientScan 234 | @EnableCircuitBreaker 235 | public class DemoApplication { 236 | public static void main(String[] args) { 237 | SpringApplication.run(DemoApplication.class, args); 238 | } 239 | } 240 | ``` 241 | en el ```application.yml``` añadimos: 242 | ```yml 243 | turbine: 244 | aggregator: 245 | clusterConfig: MICROSERVICESCLIENT 246 | appConfig: microservicesclient 247 | ```` 248 | donde : 249 | * turbine.appConfig es una lista de servicios Eureka que deben exponer su monitorización. 250 | * turbine.aggregator.clusterConfig se usa para agrupar los servicios expuestos en clusters. Debe estar en mayúsculas y coincidir con el nombre de los servicios expuestos en appConfig, tal y como explica en https://github.com/Netflix/Turbine/wiki/Configuration-%281.x%29#important-note . 251 | 252 | para poder ver la monitorización completa de un cluster utiliamos en la consola http://localhost:9002/hystrix la url http://localhost:9002/turbine.stream?cluster=MICROSERVICESCLIENT que genera el enlace http://localhost:9002/hystrix/monitor?stream=http%3A%2F%2Flocalhost%3A9002%2Fturbine.stream%3Fcluster%3DMICROSERVICESCLIENT 253 | -------------------------------------------------------------------------------- /paso-6.md: -------------------------------------------------------------------------------- 1 | #paso 6 : comunicando microservicios 2 | ##un bus para comunicarles a todos 3 | la configuración centralizada en archaius está muy bien peeeero implementar su actualización en caliente es compleja. también hay otros escenarios de negocio donde es necesario comunicar eventos a todos los servicios o a ciertos grupos, por ejemplo: activación/desactivación de una campaña comercial, cambio en la modalidad de funcionamiento de la aplicación (normal, contingencia, sólo lectura, etc) y cualquier otro cambio de estado del conjunto de microservicios. 4 | 5 | spring cloud bus es la implementación que spring propone para comunicar los servicios y la tecnología/protocolo por defecto es amqp. el protocolo amqp tiene como implementación de referencia a RabbitMQ. 6 | 7 | ##instalando rabbitmq 8 | [RabbitMQ](https://www.rabbitmq.com/download.html) es un servidor de colas muy eficiente y ágil que incluye una consola de administración muy potente. 9 | 10 | para instalarlo debemos seguir las instrucciones para cada plataforma como se indican en https://www.rabbitmq.com/download.html pero en macosx es tan simple como: 11 | ```sh 12 | $ brew update 13 | $ brew install rabbitmq 14 | ``` 15 | el instalador crea los scripts en ```/usr/local/sbin``` pero no los incluye automáticamente en el path del .bash_profile o .profile así que nos tocará editarlo manualmente y añadir: 16 | ```sh 17 | PATH=$PATH:/usr/local/sbin 18 | ``` 19 | luego podremos iniciar RabbitMQ desde línea de comando simplemente haciendo: 20 | ```sh 21 | rabbitmq-server 22 | ``` 23 | si abrimos un navegador en http://localhost:15672/ veremos la página de login de la consola donde podremos acceder utilizando ```guest``` como usuario y password. 24 | 25 | ya está... y nada más... es uno de los servidores de colas más simples de instalar. 26 | 27 | ##actualizar los microservicios 28 | para implementar el bus debemos incluir en el servidor de configuraciones y en los microservicios la siguiente dependencia: 29 | ```xml 30 | 31 | org.springframework.cloud 32 | spring-cloud-starter-bus-amqp 33 | 34 | ``` 35 | y al arrancar se conectarán por defecto al servidor rabbitmq en la url por defecto http://localhost:5672. Si se quiere cambiar por que se esté en cloud se puede añadir al application.yml un bloque del estilo: 36 | ```yml 37 | spring: 38 | rabbitmq: 39 | host: rabbitmqhost 40 | port: 5672 41 | username: guest 42 | password: guest 43 | ``` 44 | Al arrancar van a crear una cola “no durable” en el servidor rabbitmq para mandar los mensajes en esta sesión. 45 | 46 | En nuestro caso, al arrancar nos ha dejado la traza: 47 | ```properties 48 | [cTaskExecutor-8] o.s.amqp.rabbit.core.RabbitAdmin : Auto-declaring a non-durable Queue (891a9a17-5964-4bf1-8bc4-c93e2d045db9). It will be redeclared if the broker stops and is restarted while the connection factory is alive, but all messages will be lost. 49 | ``` 50 | y si vamos a la consola de nuestro servidor de rabbitmq podemos ver la cola recién creada. 51 | 52 | ##enviar mensajes 53 | 54 | Cada aplicación creará su propia cola, la cual se enganchará al “exchange” spring-cloud-bus, de tal manera que cada mensaje que se envíe mediante /bus/env -d : 55 | ```sh 56 | $ curl -X POST http://localhost:8888/bus/env -d nombre=Antoniucci 57 | $ curl -X POST http://localhost:8888/bus/refresh 58 | ``` 59 | se escribirá a todas las colas y llegará a cada una de las aplicaciones, las cuales actualizarán los valores cuando llegue la orden /bus/refresh , por ejemplo: 60 | ```sh 61 | curl -X POST http://localhost:8888/bus/refresh 62 | ``` 63 | -------------------------------------------------------------------------------- /paso-7.md: -------------------------------------------------------------------------------- 1 | #Conclusiones 2 | ##Lo que hemos aprendido 3 | La coordinación de microservicios distribuidos conlleva implementar patrones como: 4 | * Distributed/versioned configuration 5 | * Service registration and discovery 6 | * Routing 7 | * Service-to-service calls 8 | * Load balancing 9 | * Circuit Breaker 10 | * Asynchronous 11 | * Distributed messaging 12 | 13 | Netflix los implementa mediante los siguientes proyectos que Spring recubre habilmente: 14 | * Eureka (registro y autoreconocimiento de servicios) 15 | * Hystrix & Turbine (control de ruptura de comunicación con los servicios) 16 | * Ribbon (balance de carga) 17 | * Feign (llamadas servicio a servicio) 18 | * Zuul (enrutado) 19 | * Archaius (configuración distribuida) 20 | 21 | además tendríamos que revisar: 22 | 23 | * Curator (clustering) 24 | * Asgaard (deployments y gestión del cloud) 25 | 26 | e incluso ampliar nuestros conocimiento sobre Zuul ya que Netflix lo utiliza además para: 27 | * Authentication 28 | * Insights 29 | * Stress Testing 30 | * Canary Testing 31 | * Dynamic Routing 32 | * Service Migration 33 | * Load Shedding 34 | * Security 35 | * Static Response handling 36 | * Active/Active traffic management 37 | 38 | ##IMHO 39 | * spring recubre fenomenal y simplifica muchísimo la utilización de Netflix 40 | * spring debería abstraerse de Netflix y comenzar a implementar integraciones con alternativas como Consul, Vautl, zookeeper, etc. 41 | * los proyectos de Netflix deberían abstraerse más de amazon aws 42 | * el modelo de netflix se hace explícito a los microservicios 43 | * ellos saben de netflix y se crean dependencias con ellos 44 | * otras tecnologías como kubernetes son transparentes al microservicio 45 | * hay mucha "auto magia" con sus ventajas y desventajas 46 | * la tecnología de netflix está en producción, la de spring está saliendo del horno 47 | * la documentación es escasa 48 | * el soporte informal (stackoverflow, etc) también es escasa 49 | * el código de ambos es bastante limpio 50 | * no se aborda el aprovisionamiento y despliegue de microservicios (si en kubernetes) 51 | * las herramientas de monitorización de netflix están muy bien 52 | * hay que seguir investigando... -------------------------------------------------------------------------------- /service-archaius/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /service-archaius/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.test 7 | service-archaius 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | service-archaius 12 | service-archaius 13 | 14 | 15 | org.springframework.cloud 16 | spring-cloud-starter-parent 17 | 1.0.0.RELEASE 18 | 19 | 20 | 21 | UTF-8 22 | demo.ArchaiusServiceApplication 23 | 1.7 24 | 25 | 26 | 27 | 28 | org.springframework.cloud 29 | spring-cloud-config-server 30 | 31 | 32 | org.springframework.cloud 33 | spring-cloud-starter-bus-amqp 34 | 35 | 36 | 37 | 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-maven-plugin 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /service-archaius/src/main/java/demo/ArchaiusServiceApplication.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.config.server.EnableConfigServer; 6 | 7 | @SpringBootApplication 8 | @EnableConfigServer 9 | public class ArchaiusServiceApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(ArchaiusServiceApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /service-archaius/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | endpoints: 2 | shutdown: 3 | enabled: true 4 | 5 | server: 6 | port: 8888 7 | 8 | spring: 9 | cloud: 10 | config: 11 | server: 12 | git: 13 | uri: https://github.com/jantoniucci/archaius-config 14 | -------------------------------------------------------------------------------- /service-eureka/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /service-eureka/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.test 7 | service-eureka 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | service-eureka 12 | service-eureka 13 | 14 | 15 | org.springframework.cloud 16 | spring-cloud-starter-parent 17 | 1.0.0.RELEASE 18 | 19 | 20 | 21 | UTF-8 22 | demo.EurekaServiceApplication 23 | 1.7 24 | 25 | 26 | 27 | 28 | org.springframework.cloud 29 | spring-cloud-starter-eureka-server 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-maven-plugin 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /service-eureka/src/main/java/demo/EurekaServiceApplication.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 4 | import org.springframework.boot.builder.SpringApplicationBuilder; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | @EnableEurekaServer 10 | @EnableAutoConfiguration 11 | public class EurekaServiceApplication { 12 | 13 | public static void main(String[] args) { 14 | new SpringApplicationBuilder(EurekaServiceApplication.class).web(true).run(args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /service-eureka/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8761 3 | spring: 4 | application: 5 | name:eureka 6 | cloud: 7 | config: 8 | enabled: false 9 | eureka: 10 | instance: 11 | hostname: localhost 12 | client: 13 | registerWithEureka: false 14 | fetchRegistry: false 15 | serviceUrl: 16 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ -------------------------------------------------------------------------------- /service-hystrix/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.test 6 | hystrix 7 | 0.0.1-SNAPSHOT 8 | jar 9 | 10 | hystrix 11 | hystrix 12 | 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.2.0.RELEASE 18 | 19 | 20 | 21 | UTF-8 22 | demo.HystrixDashboardApp 23 | 24 | 25 | 26 | 27 | 28 | org.springframework.cloud 29 | spring-cloud-starter-parent 30 | 1.0.0.RC1 31 | pom 32 | import 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.springframework.cloud 40 | spring-cloud-starter 41 | 42 | 43 | junit 44 | junit 45 | test 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-starter-web 50 | 51 | 52 | spring-boot-starter-logging 53 | org.springframework.boot 54 | 55 | 56 | 57 | 58 | org.springframework.cloud 59 | spring-cloud-starter-eureka 60 | 61 | 62 | org.springframework.boot 63 | spring-boot-starter-test 64 | test 65 | 66 | 67 | org.springframework.cloud 68 | spring-cloud-starter-hystrix 69 | 70 | 71 | org.springframework.cloud 72 | spring-cloud-starter-hystrix-dashboard 73 | 74 | 75 | org.springframework.cloud 76 | spring-cloud-netflix-turbine 77 | 78 | 79 | 80 | commons-logging 81 | commons-logging 82 | 1.1.3 83 | 84 | 85 | 86 | 87 | 88 | 89 | org.springframework.boot 90 | spring-boot-maven-plugin 91 | 92 | 93 | 94 | com.netflix.eureka 95 | eureka-core 96 | 97 | 98 | com.netflix.eureka 99 | eureka-client 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | spring-milestones 110 | Spring Maven Milestone Repository 111 | http://repo.spring.io/milestone 112 | 113 | false 114 | 115 | 116 | 117 | spring-snapshots 118 | Spring Snapshots 119 | http://repo.spring.io/snapshot 120 | 121 | true 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /service-hystrix/src/main/java/demo/HystrixDashboardApp.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 4 | import org.springframework.boot.builder.SpringApplicationBuilder; 5 | import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; 6 | import org.springframework.cloud.netflix.turbine.EnableTurbine; 7 | import org.springframework.context.annotation.ComponentScan; 8 | import org.springframework.context.annotation.Configuration; 9 | 10 | @Configuration 11 | @EnableAutoConfiguration 12 | @EnableHystrixDashboard 13 | @ComponentScan 14 | @EnableTurbine 15 | public class HystrixDashboardApp 16 | { 17 | public static void main( String[] args ) 18 | { 19 | new SpringApplicationBuilder(HystrixDashboardApp.class).web(true).run(args); 20 | } 21 | } -------------------------------------------------------------------------------- /service-hystrix/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9002 3 | spring: 4 | application: 5 | name:hystrixdashboard 6 | config: 7 | name:hystrixdashboard 8 | security: 9 | ignored:true 10 | turbine: 11 | aggregator: 12 | clusterConfig: MICROSERVICESCLIENT 13 | appConfig: microservicesclient -------------------------------------------------------------------------------- /service-hystrix/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: hystrixdashboard 4 | cloud: 5 | config: 6 | enabled: true 7 | uri: http://localhost:8888 -------------------------------------------------------------------------------- /service-zuul/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /service-zuul/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.test 6 | service-zuul 7 | 0.0.1-SNAPSHOT 8 | jar 9 | 10 | service-zuul 11 | service-zuul 12 | 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-parent 18 | 1.2.0.RELEASE 19 | 20 | 21 | 22 | UTF-8 23 | demo.ZuulServiceApplication 24 | 1.7 25 | 26 | 27 | 28 | 29 | 30 | org.springframework.cloud 31 | spring-cloud-starter-parent 32 | 1.0.0.RELEASE 33 | pom 34 | import 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.springframework.cloud 42 | spring-cloud-starter 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-starter-actuator 47 | 48 | 49 | junit 50 | junit 51 | test 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-starter-web 56 | 57 | 58 | spring-boot-starter-logging 59 | org.springframework.boot 60 | 61 | 62 | 63 | 64 | org.springframework.cloud 65 | spring-cloud-starter-eureka 66 | 67 | 68 | org.springframework.boot 69 | spring-boot-starter-test 70 | test 71 | 72 | 73 | org.springframework.cloud 74 | spring-cloud-netflix-zuul-server 75 | 1.0.0.M3 76 | 77 | 78 | 79 | commons-logging 80 | commons-logging 81 | 1.1.3 82 | 83 | 84 | org.slf4j 85 | slf4j-api 86 | 87 | 88 | 89 | 90 | 91 | 92 | spring-milestones 93 | Spring Maven Milestone Repository 94 | http://repo.spring.io/milestone 95 | 96 | false 97 | 98 | 99 | 100 | spring-snapshots 101 | Spring Snapshots 102 | http://repo.spring.io/snapshot 103 | 104 | true 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | org.springframework.boot 113 | spring-boot-maven-plugin 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /service-zuul/src/main/java/demo/ZuulServiceApplication.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy; 8 | import org.springframework.context.annotation.ComponentScan; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | 12 | @Configuration 13 | @ComponentScan 14 | @EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class}) 15 | @EnableDiscoveryClient 16 | @EnableZuulProxy 17 | public class ZuulServiceApplication 18 | { 19 | public static void main( String[] args ) 20 | { 21 | SpringApplication.run(ZuulServiceApplication.class, args); 22 | } 23 | } -------------------------------------------------------------------------------- /service-zuul/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | info: 2 | component: zuul server app 3 | 4 | server: 5 | port: 8080 6 | 7 | spring: 8 | config: 9 | name: zuulserver 10 | application: 11 | name: zuulserver 12 | cloud: 13 | config: 14 | enabled: true 15 | uri: http://localhost:8888 16 | 17 | zuul: 18 | routes: 19 | greetings: 20 | path: /greetings/** 21 | serviceId: GREETINGS 22 | helloworld: 23 | path: /helloworld/** 24 | serviceId: HELLOWORLD 25 | 26 | error: 27 | whitelabel: 28 | enabled:false 29 | -------------------------------------------------------------------------------- /service-zuul/src/test/java/demo/ZuulServiceApplicationTest.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class ZuulServiceApplicationTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public ZuulServiceApplicationTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( ZuulServiceApplicationTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } --------------------------------------------------------------------------------