SlideShare a Scribd company logo
Bonnes Pratiques
                                    Des
                             Applications Java
                         Prêtes pour la Production




                                                  des          Prêtes pour la
                        Bonnes Pratiques
                                           Applications Java    Production




                                       Cyrille Le Clerc

Sunday, June 13, 2010
Cyrille Le Clerc


   Architecte Java EE depuis 11 ans

   Committer Apache CXF

   Directeur associé chez Xebia

    cleclerc@xebia.fr




                        www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Les enjeux


   Améliorer la disponibilité des applications

   Réduire le cycle de vie des projets

   Améliorer les plateformes

   Diminuer le coût d’exploitation




                         www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Les axes clefs


   Le déploiement

   La supervision et le monitoring

   La gestion des logs

   La robustesse

   L’organisation



                          www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Le Déploiement


   Minimiser le nombre de composants à déployer

   Colocation friendly

   Les paramètres de configuration

   La traçabilité




                          www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Le Déploiement




       Minimiser le nombre de composants à déployer




                         www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Minimiser le nombre de composants à
déployer
                        my-app




                                 html       *.html
                                              *.html


                                 css



                                 img



                                  js



                                 jsp
                                            *.jsp
                                              *.jsp


                             WEB-INF

                                              classes


                                                 lib




                                 www.xebia.fr / blog.xebia.fr
                                           web.xml              5
Sunday, June 13, 2010
Minimiser le nombre de composants à
déployer
                                                               my-app



                                                                        html
                                                                                 *.html    just in case
                                                                        css


                                                                        img


                                                                         js



                                                                        jsp    *.jsp
                                                                                 *.jsp
    # don't proxy static content !
    ProxyPassMatch ^(/my/.*.html)$ !                              WEB-INF

    ProxyPassMatch ^(/my/.*.css)$ !                                            classes
                                                         2                                      1
    ProxyPassMatch ^(/my/.*.gif)$ !                                              lib

    ProxyPassMatch ^(/my/.*.jpeg)$ !
    ProxyPassMatch ^(/my/.*.png)$ !                                           web.xml

    ProxyPassMatch ^(/my/.*.js)$ !

    # proxy dynamic content                   my-app static files                          my-app.war
    ProxyPass /my/ http://my:8080/my/
                                                 Apache Httpd                              Tomcat
      3   httpd.conf

                                        www.xebia.fr / blog.xebia.fr                                      5
Sunday, June 13, 2010
Minimiser le nombre de composants à
déployer
                                                                 my-app



                                                                          html
                                                                                   *.html

                                                                          css


                                                                          img


                                                                           js



                                                                          jsp    *.jsp
                                                                                   *.jsp

                                                                       WEB-INF

                                                                                  classes

                                                                                    lib
   # proxy /my/                                                                                  1
   ProxyPass /my/ http://my:8080/my/                                             web.xml




  2   httpd.conf                               my-app static files                           my-app.war

                          Cache Proxy              Apache Httpd                              Tomcat

                                        www.xebia.fr / blog.xebia.fr                                     5
Sunday, June 13, 2010
Colocation friendly

   Colocalisation de serveur (Linux, Windows, etc)
      ▶   Minimiser les répertoires absolus et les ports réseaux
      ▶   Ports dédiés par application (e.g. http : 10080)
      ▶   Chemins dédiés de répertoires (e.g. /etc/my-app-1/...)


   Colocalisation de serveur Java EE
      ▶   Ne pas utiliser de variable statique
      ▶   Chemins dédiés de répertoires (e.g. ${java.io.tmpdir}/my-app-1/...)




                                      www.xebia.fr / blog.xebia.fr              2
Sunday, June 13, 2010
Le Déploiement




                        Les paramètres de configuration




                                   www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Les paramètres de configuration

   Limiter les paramètres de configuration dont la
    valeur change suivant les environnements
      ▶   Ports réseau standards (e.g. 80, 1521)
      ▶   Noms logiques de host/serveurs (e.g. my-app-srv-1)
                                                             Production



                                                                                                       db-α




                                                               p1
                                                                                 app-1
                                                                                                1521


                                                            /ap
                                                                       10080
                                                80                             srv-i, srv-j, srv-k
                                                                                  ...

                                                443           /ap
              Internet                         om                                                      db-β
                                                                 p2
                                     p   any.c                                    app-2       1521
                             m y-com
                                                                       20080
                         Firewall                                           srv-l, srv-m, srv-n


                                             www.xebia.fr / blog.xebia.fr                                     2
Sunday, June 13, 2010
Les paramètres de configuration
                                                             Production



                                                                                                      db-α




                                                               p1
                                                                                 app-1
                                                                                             1521




                                                            /ap
                                                                      10080
                                                 80                         srv-i, srv-j, srv-k




                                                                                                             Sa
                                                                               ...




                                                                                                              m
                                                                                                                  e
                                                                                                                   ho
                                            443               /ap




                                                                                                                      s
                                         .com                                                         db-β




                                                                                                                       tn
                                                                 p2
                                     pany




                                                                                                             Sa
                                                                                 app-2




                                                                                                                        am
                                                                                               1521
                                y-com




                                                                                                              m
                            m




                                                                                                                            es
                                                                      20080




                                                                                                               e
                                                                           srv-l, srv-m, srv-n




                                                                                                                  ne
                        Firewall




                                                                                                                   tw
                                                                                                                       or
                                                                                                             Ca


                                                                                                                        k
                                                                                                              n


                                                                                                                            po
            Internet                                  NO communication




                                                                                                                  be


                                                                                                                              rt
                                                                                                                              s
                                                                                                                      sa
                                                                                                                       m
                                                              Validation




                                                                                                                        e
                                                                                                                            IP
                                                                                                                              !
                                                                                                      db-α
                                                               p1




                                                                                 app-1
                                                                                               1521
                                                            /ap




                                                                      10080
                                                 80                           srv-i, srv-j, srv-k
                                                                                 ...

                        proxy                    443          /ap
                                                       om        p2                                   db-β
                                                 any.c                           app-2         1521
                                           omp
                                    my-c                              20080
                                Firewall                                  srv-l, srv-m, srv-n

                                                               www.xebia.fr / blog.xebia.fr                                        5
Sunday, June 13, 2010
Le Déploiement

   La traçabilité
           my-app/tags/1.2.3/
                                                       artefact taggé

                                   my-app-1.2.3.war




                                                                                       Co
                                                                                          mme
                                    Repository                                                nt
                                                                                                   dé
                                                                                                     plo
                                                                                                        ye
                                                                                                          r
                                                                                                              ?




                        Dev zone                                                Data centers


                                                 www.xebia.fr / blog.xebia.fr                                     2
Sunday, June 13, 2010
Supervision et Monitoring


   Exposer des indicateurs métier

   Logs vs. JSP vs. JMX




                           www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Supervision et Monitoring


    Exposer des indicateurs métier

   Suivre les succès et échecs vécus par les
    utilisateurs




                         www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Supervision et Monitoring


    Logs de monitoring

   Détail par invocation vs. moyenne par minute




                         www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Monitoring : logs vs. jsp vs. jmx

    JSP
   Attention à la sécurité !
   Human Friendly and/or Script Friendly


                        /my-app/seye5E7E/jmx/cxf.jsp




                            www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Monitoring : logs vs. jsp vs. jmx

    JMX
   Sécurité ++
   Simple
   Human Friendly and/or Script Friendly




                        www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Monitoring : logs vs. jsp vs. jmx

    JMX : Simple

 @ManagedResource
 public class DemoServiceImpl {

  private final AtomicInteger invocationCount = new AtomicInteger();

  @ManagedAttribute
  public int getInvocationsCount() {
    return invocationCount.get();
  }

  @ManagedOperation
  public void purge(){
    // ...
  }




                              www.xebia.fr / blog.xebia.fr             2
Sunday, June 13, 2010
Monitoring : logs vs. jsp vs. jmx

    JMX : VisualVM




                        www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Monitoring : logs vs. jsp vs. jmx

    JMX : Hyperic HQ & cie




                        www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Monitoring : logs vs. jsp vs. jmx

    JMX & JSP


                        Powered by JMX !




                                www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
La gestion des logs


    Exceptions java & stack trace vs. code erreur

    Troubleshooting vs. logs longue durée &audit




                        www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
La gestion des logs

                                                                        2010/04/12 14:37:19 [catalina-exec-14] WARN o.a.cxf.phase.PhaseInterceptorChain - Application {http://ws.xebia.fr/customer/v1_0}customerService#{http://ws.xebia.fr/customer/v1_0}getCustomer has thrown exception, unwinding now
                                                                        org.apache.cxf.interceptor.Fault: Exception getting customer '71'
                                                                                                             at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155) ~[cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86) ~[cxf-rt-frontend-jaxws-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121) ~[cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60) ~[cxf-rt-frontend-jaxws-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) ~[cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) ~[cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) ~[na:1.6.0_17]




        Exceptions & stack trace
                                                                                                             at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) ~[na:1.6.0_17]
                                                                                                             at java.util.concurrent.FutureTask.run(FutureTask.java:138) ~[na:1.6.0_17]
                                                                                                             at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) ~[cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) ~[cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243) ~[cxf-api-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110) [cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98) [cxf-rt-transports-http-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:423) [cxf-rt-transports-http-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:178) [cxf-rt-transports-http-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142) [cxf-rt-transports-http-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) [cxf-rt-transports-http-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103) [cxf-rt-transports-http-2.2.7.jar:2.2.7]
                                                                                                             at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) [servlet-api.jar:na]
                                                                                                             at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) [cxf-rt-transports-http-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.26]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343) [spring-security-web-3.0.2.RELEASE.jar:na]




                  vs.
                                                                                                             at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:90) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188) [spring-security-web-3.0.2.RELEASE.jar:na]




              code erreur
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149) [spring-security-web-3.0.2.RELEASE.jar:na]
                                                                                                             at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
                                                                                                             at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
                                                                                                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:6.0.26]
                                                                                                             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) [catalina.jar:6.0.26]
                                                                                                             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) [tomcat-coyote.jar:6.0.26]
                                                                                                             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) [tomcat-coyote.jar:6.0.26]
                                                                                                             at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396) [tomcat-coyote.jar:6.0.26]
                                                                                                             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_17]
                                                                                                             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_17]
                                                                                                             at java.lang.Thread.run(Thread.java:637) [na:1.6.0_17]
                                                                        Caused by: java.lang.RuntimeException: Exception getting customer '71'
                                                                                                             at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:101) ~[CustomerServiceImpl.class:na]
                                                                                                             at fr.xebia.ws.customer.v1_0.CustomerServiceImpl$$FastClassByCGLIB$$30f63c56.invoke(<generated>) ~[cglib-nodep-2.2.jar:na]
                                                                                                             at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) ~[cglib-nodep-2.2.jar:na]
                                                                                                             at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:692) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at fr.xebia.audit.AuditAspect.logMessage(AuditAspect.java:139) ~[AuditAspect.class:na]
                                                                                                             at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[na:na]
                                                                                                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17]
                                                                                                             at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17]
                                                                                                             at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:622) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:611) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE]
                                                                                                             at fr.xebia.ws.customer.v1_0.CustomerServiceImpl$$EnhancerByCGLIB$$184a797f.getCustomer(<generated>) ~[cglib-nodep-2.2.jar:na]
                                                                                                             at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source) ~[na:na]
                                                                                                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17]
                                                                                                             at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17]
                                                                                                             at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173) ~[cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89) ~[cxf-rt-core-2.2.7.jar:2.2.7]
                                                                                                             ... 62 common frames omitted
                                                                        Caused by: java.lang.RuntimeException: Too many concurrent access to ZeSlowService
                                                                                                             at fr.xebia.productionready.backend.zeslowservice.ZeSlowServiceBoundedImpl.find(ZeSlowServiceBoundedImpl.java:57) ~[ZeSlowServiceBoundedImpl.class:na]
                                                                                                             at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.updateCustomerWithZeSlowServiceData(CustomerServiceImpl.java:166) ~[CustomerServiceImpl.class:na]
                                                                                                             at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:99) ~[CustomerServiceImpl.class:na]
                                                                                                             ... 84 common frames omitted




   2010/04/12 15:06:09 [catalina-exec-18] WARN o.a.cxf.phase.PhaseInterceptorChain -
    Application {http://ws.xebia.fr/customer/v1_0}customerService
    #{http://ws.xebia.fr/customer/v1_0}getCustomer has thrown exception, unwinding now
    org.apache.cxf.interceptor.Fault: Exception getting customer '1'
        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
   Caused by: java.lang.RuntimeException: Exception getting customer '1'
        at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:101)
   Caused by: java.lang.RuntimeException: Something went wrong
        at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.doSomeWork(CustomerServiceImpl.java:66)

                                                 www.xebia.fr / blog.xebia.fr                                                                                                                                                                                                                                 2
Sunday, June 13, 2010
La gestion des logs


                                       >= WARN, compact stack trace, collected
         logs
                        my-app.log
                                                      only audit, collected
                        my-app-audit.log                                       10x10Mo, rolling,
                                                                                NOT collected,
                        my-app-troubleshooting.log                             mostly >= WARN
                        my-app-troubleshooting-1.log
                        ...
                        my-app-troubleshooting-9.log


   logs-to-collect        easy to collect log files


                        my-app-audit-20100411.log
                        my-app-audit-201004....log
                        ...
                        my-app-20100411.log
                        my-app-201004...log
                        ...
                                                www.xebia.fr / blog.xebia.fr                       2
Sunday, June 13, 2010
La gestion des logs


    Audit par annotation
 @RolesAllowed("ROLE_USER")
 @Audited(message = "CustomerService.getCustomer(#{args[0]})")
 public Customer getCustomer(long id) throws MyException {
    // ...
 }


    Exemple de message
    ...
    2010/04/12-17:18:00:266
        CustomerService.getCustomer(12) by ze-remote-app coming from 9.0.1.53
    ...




                                       www.xebia.fr / blog.xebia.fr             2
Sunday, June 13, 2010
La Robustesse

   Dépendances inter-application :                     fail fast est-il synonyme de
    fragilité ?



   Prévention des saturations et des effets
    "domino" : l'art du code défensif,

   Les modes dégradés




                         www.xebia.fr / blog.xebia.fr                                  2
Sunday, June 13, 2010
La Robustesse

   Dépendances inter-application :                    fail fast est-il synonyme de
    fragilité ?



   Bloquer le démarrage pour mauvaise
    configuration

   Ne pas bloquer le démarrage pour indisponibilité
    d’une dépendance




                        www.xebia.fr / blog.xebia.fr                                  2
Sunday, June 13, 2010
La Robustesse

   Prévention des saturations et des effets
    "domino" : l'art du code défensif

                                                                            Sh
                                                                              or
                                                                            im t tim
                                                                               po
                                                                                  ssi eou
                                                                                     ble t i
                                                               Sometimes                ! s
                        Presentation & Business
                                                                 Slow
                                 Layer
                                                                Service




                                                                      Sometimes
                        Presentation & Business                         Slow
                                 Layer                                 Service



                                           limit concurrent invocations !




                                www.xebia.fr / blog.xebia.fr                                   2
Sunday, June 13, 2010
La Robustesse

    Les modes dégradés

   Mieux vaut-il un service limité ou un système en
    panne ?




                         www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
L’organisation

   Prévoir l’exploitation

   Les développeurs en support niveau 3

   You Build It, You Run It !




                         www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
L’organisation

    Prévoir l’exploitation

   Dès la conception

   Processus itératif




                         www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
L’organisation

    Les développeurs en support niveau 3

   Prendre conscience

   Responsabiliser




                         www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
L’organisation




                        “You Build It You Run It !”
                                            Amazon




                                  www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010
Formation !




                         Formation
        Applications Java Prêtes pour la Production
                  Les 17 & 18 Mai 2010 !




                          www.xebia.fr / blog.xebia.fr   2
Sunday, June 13, 2010

More Related Content

Viewers also liked

Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business Workflow
Yakov Fain
 
Introduction àJava
Introduction àJavaIntroduction àJava
Introduction àJava
Christophe Vaudry
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Shekhar Gulati
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
Yakov Fain
 
Angular2 Development for Java developers
Angular2 Development for Java developersAngular2 Development for Java developers
Angular2 Development for Java developers
Yakov Fain
 
AngularJS for Java Developers
AngularJS for Java DevelopersAngularJS for Java Developers
AngularJS for Java Developers
Loc Nguyen
 
RESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTRESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoT
Yakov Fain
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in Java
Yakov Fain
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
Yakov Fain
 
20090615 - Ch'ti JUG - Apache Maven
20090615 - Ch'ti JUG - Apache Maven20090615 - Ch'ti JUG - Apache Maven
20090615 - Ch'ti JUG - Apache Maven
Arnaud Héritier
 
JCertif 2012 : Maven par la pratique
JCertif 2012 : Maven par la pratiqueJCertif 2012 : Maven par la pratique
JCertif 2012 : Maven par la pratique
Rossi Oddet
 
Tp java ee.pptx
Tp java ee.pptxTp java ee.pptx
Tp java ee.pptx
Eric Bourdet
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java Developers
Yakov Fain
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Shekhar Gulati
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
Yakov Fain
 
Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVCNathaniel Richand
 
Reactive programming in Angular 2
Reactive programming in Angular 2Reactive programming in Angular 2
Reactive programming in Angular 2
Yakov Fain
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
Knoldus Inc.
 
Reactive Thinking in Java with RxJava2
Reactive Thinking in Java with RxJava2Reactive Thinking in Java with RxJava2
Reactive Thinking in Java with RxJava2
Yakov Fain
 

Viewers also liked (20)

Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business Workflow
 
Introduction àJava
Introduction àJavaIntroduction àJava
Introduction àJava
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Angular2 Development for Java developers
Angular2 Development for Java developersAngular2 Development for Java developers
Angular2 Development for Java developers
 
AngularJS for Java Developers
AngularJS for Java DevelopersAngularJS for Java Developers
AngularJS for Java Developers
 
RESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTRESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoT
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in Java
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
20090615 - Ch'ti JUG - Apache Maven
20090615 - Ch'ti JUG - Apache Maven20090615 - Ch'ti JUG - Apache Maven
20090615 - Ch'ti JUG - Apache Maven
 
JCertif 2012 : Maven par la pratique
JCertif 2012 : Maven par la pratiqueJCertif 2012 : Maven par la pratique
JCertif 2012 : Maven par la pratique
 
Tp java ee.pptx
Tp java ee.pptxTp java ee.pptx
Tp java ee.pptx
 
Soutenance PFE 2012
Soutenance PFE 2012Soutenance PFE 2012
Soutenance PFE 2012
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java Developers
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
 
Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVC
 
Reactive programming in Angular 2
Reactive programming in Angular 2Reactive programming in Angular 2
Reactive programming in Angular 2
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
Reactive Thinking in Java with RxJava2
Reactive Thinking in Java with RxJava2Reactive Thinking in Java with RxJava2
Reactive Thinking in Java with RxJava2
 

Similar to Bonnes pratiques des applications java prêtes pour la production

Synchronizing Core Data With Rails
Synchronizing Core Data With RailsSynchronizing Core Data With Rails
Synchronizing Core Data With Rails
Ken Collins
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache CamelFuseSource.com
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121WANGCHOU LU
 
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
2012-04-18-shibuyarb-offline-mobile-app-has-great-potentialKenichi Murahashi
 
Tuning web performance
Tuning web performanceTuning web performance
Tuning web performanceGeorge Ang
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web PerformanceEric ShangKuan
 
Camel and JBoss
Camel and JBossCamel and JBoss
Camel and JBoss
JBug Italy
 
Open End To End Js Stack
Open End To End Js StackOpen End To End Js Stack
Open End To End Js StackSkills Matter
 
Jsf2 composite-components
Jsf2 composite-componentsJsf2 composite-components
Jsf2 composite-components
vinaysbk
 
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
Luciano Resende
 
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NETSilicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NETMats Bryntse
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
Nicola Pedot
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
bobmcwhirter
 
Ajax Tags Advanced
Ajax Tags AdvancedAjax Tags Advanced
Ajax Tags AdvancedAkramWaseem
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Fabio Akita
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
ACCESS
 

Similar to Bonnes pratiques des applications java prêtes pour la production (20)

Synchronizing Core Data With Rails
Synchronizing Core Data With RailsSynchronizing Core Data With Rails
Synchronizing Core Data With Rails
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121
 
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
 
Tuning web performance
Tuning web performanceTuning web performance
Tuning web performance
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
 
Camel and JBoss
Camel and JBossCamel and JBoss
Camel and JBoss
 
Jspx Jdc2010
Jspx Jdc2010Jspx Jdc2010
Jspx Jdc2010
 
Open End To End Js Stack
Open End To End Js StackOpen End To End Js Stack
Open End To End Js Stack
 
Jsf2 composite-components
Jsf2 composite-componentsJsf2 composite-components
Jsf2 composite-components
 
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
 
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NETSilicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Ajax Tags Advanced
Ajax Tags AdvancedAjax Tags Advanced
Ajax Tags Advanced
 
JavaScript-Core
JavaScript-CoreJavaScript-Core
JavaScript-Core
 
JavaScript-Core
JavaScript-CoreJavaScript-Core
JavaScript-Core
 
J2 Ee Overview
J2 Ee OverviewJ2 Ee Overview
J2 Ee Overview
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 

More from Cyrille Le Clerc

Embracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetryEmbracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetry
Cyrille Le Clerc
 
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
Cyrille Le Clerc
 
Joe Mobile sur le Cloud - DevoxxFR 2013
Joe Mobile sur le Cloud - DevoxxFR 2013Joe Mobile sur le Cloud - DevoxxFR 2013
Joe Mobile sur le Cloud - DevoxxFR 2013
Cyrille Le Clerc
 
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Cyrille Le Clerc
 
Paris Devops - Monitoring And Feature Toggle Pattern With JMX
Paris Devops - Monitoring And Feature Toggle Pattern With JMXParis Devops - Monitoring And Feature Toggle Pattern With JMX
Paris Devops - Monitoring And Feature Toggle Pattern With JMX
Cyrille Le Clerc
 
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
Cyrille Le Clerc
 
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspectiveGeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
Cyrille Le Clerc
 
Java Application Monitoring with AppDynamics' Founder
Java Application Monitoring with AppDynamics' FounderJava Application Monitoring with AppDynamics' Founder
Java Application Monitoring with AppDynamics' Founder
Cyrille Le Clerc
 
Soirée OSGi au Paris Jug (14/10/2008)
Soirée OSGi au Paris Jug (14/10/2008)Soirée OSGi au Paris Jug (14/10/2008)
Soirée OSGi au Paris Jug (14/10/2008)Cyrille Le Clerc
 
Xebia Knowledge Exchange - Owasp Top Ten
Xebia Knowledge Exchange - Owasp Top TenXebia Knowledge Exchange - Owasp Top Ten
Xebia Knowledge Exchange - Owasp Top Ten
Cyrille Le Clerc
 
Soirée Data Grid au Paris JUG (2009/05/12)
Soirée Data Grid au Paris JUG (2009/05/12)Soirée Data Grid au Paris JUG (2009/05/12)
Soirée Data Grid au Paris JUG (2009/05/12)
Cyrille Le Clerc
 

More from Cyrille Le Clerc (11)

Embracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetryEmbracing Observability in CI/CD with OpenTelemetry
Embracing Observability in CI/CD with OpenTelemetry
 
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
 
Joe Mobile sur le Cloud - DevoxxFR 2013
Joe Mobile sur le Cloud - DevoxxFR 2013Joe Mobile sur le Cloud - DevoxxFR 2013
Joe Mobile sur le Cloud - DevoxxFR 2013
 
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios - DevoxxFR...
 
Paris Devops - Monitoring And Feature Toggle Pattern With JMX
Paris Devops - Monitoring And Feature Toggle Pattern With JMXParis Devops - Monitoring And Feature Toggle Pattern With JMX
Paris Devops - Monitoring And Feature Toggle Pattern With JMX
 
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
 
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspectiveGeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
GeeCon 2011 - NoSQL and In Memory Data Grids from a developer perspective
 
Java Application Monitoring with AppDynamics' Founder
Java Application Monitoring with AppDynamics' FounderJava Application Monitoring with AppDynamics' Founder
Java Application Monitoring with AppDynamics' Founder
 
Soirée OSGi au Paris Jug (14/10/2008)
Soirée OSGi au Paris Jug (14/10/2008)Soirée OSGi au Paris Jug (14/10/2008)
Soirée OSGi au Paris Jug (14/10/2008)
 
Xebia Knowledge Exchange - Owasp Top Ten
Xebia Knowledge Exchange - Owasp Top TenXebia Knowledge Exchange - Owasp Top Ten
Xebia Knowledge Exchange - Owasp Top Ten
 
Soirée Data Grid au Paris JUG (2009/05/12)
Soirée Data Grid au Paris JUG (2009/05/12)Soirée Data Grid au Paris JUG (2009/05/12)
Soirée Data Grid au Paris JUG (2009/05/12)
 

Recently uploaded

When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 

Recently uploaded (20)

When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

Bonnes pratiques des applications java prêtes pour la production

  • 1. Bonnes Pratiques Des Applications Java Prêtes pour la Production des Prêtes pour la Bonnes Pratiques Applications Java Production Cyrille Le Clerc Sunday, June 13, 2010
  • 2. Cyrille Le Clerc  Architecte Java EE depuis 11 ans  Committer Apache CXF  Directeur associé chez Xebia cleclerc@xebia.fr www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 3. Les enjeux  Améliorer la disponibilité des applications  Réduire le cycle de vie des projets  Améliorer les plateformes  Diminuer le coût d’exploitation www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 4. Les axes clefs  Le déploiement  La supervision et le monitoring  La gestion des logs  La robustesse  L’organisation www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 5. Le Déploiement  Minimiser le nombre de composants à déployer  Colocation friendly  Les paramètres de configuration  La traçabilité www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 6. Le Déploiement Minimiser le nombre de composants à déployer www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 7. Minimiser le nombre de composants à déployer my-app html *.html *.html css img js jsp *.jsp *.jsp WEB-INF classes lib www.xebia.fr / blog.xebia.fr web.xml 5 Sunday, June 13, 2010
  • 8. Minimiser le nombre de composants à déployer my-app html *.html just in case css img js jsp *.jsp *.jsp # don't proxy static content ! ProxyPassMatch ^(/my/.*.html)$ ! WEB-INF ProxyPassMatch ^(/my/.*.css)$ ! classes 2 1 ProxyPassMatch ^(/my/.*.gif)$ ! lib ProxyPassMatch ^(/my/.*.jpeg)$ ! ProxyPassMatch ^(/my/.*.png)$ ! web.xml ProxyPassMatch ^(/my/.*.js)$ ! # proxy dynamic content my-app static files my-app.war ProxyPass /my/ http://my:8080/my/ Apache Httpd Tomcat 3 httpd.conf www.xebia.fr / blog.xebia.fr 5 Sunday, June 13, 2010
  • 9. Minimiser le nombre de composants à déployer my-app html *.html css img js jsp *.jsp *.jsp WEB-INF classes lib # proxy /my/ 1 ProxyPass /my/ http://my:8080/my/ web.xml 2 httpd.conf my-app static files my-app.war Cache Proxy Apache Httpd Tomcat www.xebia.fr / blog.xebia.fr 5 Sunday, June 13, 2010
  • 10. Colocation friendly  Colocalisation de serveur (Linux, Windows, etc) ▶ Minimiser les répertoires absolus et les ports réseaux ▶ Ports dédiés par application (e.g. http : 10080) ▶ Chemins dédiés de répertoires (e.g. /etc/my-app-1/...)  Colocalisation de serveur Java EE ▶ Ne pas utiliser de variable statique ▶ Chemins dédiés de répertoires (e.g. ${java.io.tmpdir}/my-app-1/...) www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 11. Le Déploiement Les paramètres de configuration www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 12. Les paramètres de configuration  Limiter les paramètres de configuration dont la valeur change suivant les environnements ▶ Ports réseau standards (e.g. 80, 1521) ▶ Noms logiques de host/serveurs (e.g. my-app-srv-1) Production db-α p1 app-1 1521 /ap 10080 80 srv-i, srv-j, srv-k ... 443 /ap Internet om db-β p2 p any.c app-2 1521 m y-com 20080 Firewall srv-l, srv-m, srv-n www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 13. Les paramètres de configuration Production db-α p1 app-1 1521 /ap 10080 80 srv-i, srv-j, srv-k Sa ... m e ho 443 /ap s .com db-β tn p2 pany Sa app-2 am 1521 y-com m m es 20080 e srv-l, srv-m, srv-n ne Firewall tw or Ca k n po Internet NO communication be rt s sa m Validation e IP ! db-α p1 app-1 1521 /ap 10080 80 srv-i, srv-j, srv-k ... proxy 443 /ap om p2 db-β any.c app-2 1521 omp my-c 20080 Firewall srv-l, srv-m, srv-n www.xebia.fr / blog.xebia.fr 5 Sunday, June 13, 2010
  • 14. Le Déploiement  La traçabilité my-app/tags/1.2.3/ artefact taggé my-app-1.2.3.war Co mme Repository nt dé plo ye r ? Dev zone Data centers www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 15. Supervision et Monitoring  Exposer des indicateurs métier  Logs vs. JSP vs. JMX www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 16. Supervision et Monitoring Exposer des indicateurs métier  Suivre les succès et échecs vécus par les utilisateurs www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 17. Supervision et Monitoring Logs de monitoring  Détail par invocation vs. moyenne par minute www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 18. Monitoring : logs vs. jsp vs. jmx JSP  Attention à la sécurité !  Human Friendly and/or Script Friendly /my-app/seye5E7E/jmx/cxf.jsp www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 19. Monitoring : logs vs. jsp vs. jmx JMX  Sécurité ++  Simple  Human Friendly and/or Script Friendly www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 20. Monitoring : logs vs. jsp vs. jmx JMX : Simple @ManagedResource public class DemoServiceImpl { private final AtomicInteger invocationCount = new AtomicInteger(); @ManagedAttribute public int getInvocationsCount() { return invocationCount.get(); } @ManagedOperation public void purge(){ // ... } www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 21. Monitoring : logs vs. jsp vs. jmx JMX : VisualVM www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 22. Monitoring : logs vs. jsp vs. jmx JMX : Hyperic HQ & cie www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 23. Monitoring : logs vs. jsp vs. jmx JMX & JSP Powered by JMX ! www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 24. La gestion des logs Exceptions java & stack trace vs. code erreur Troubleshooting vs. logs longue durée &audit www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 25. La gestion des logs 2010/04/12 14:37:19 [catalina-exec-14] WARN o.a.cxf.phase.PhaseInterceptorChain - Application {http://ws.xebia.fr/customer/v1_0}customerService#{http://ws.xebia.fr/customer/v1_0}getCustomer has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Exception getting customer '71' at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155) ~[cxf-rt-core-2.2.7.jar:2.2.7] at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86) ~[cxf-rt-frontend-jaxws-2.2.7.jar:2.2.7] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121) ~[cxf-rt-core-2.2.7.jar:2.2.7] at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60) ~[cxf-rt-frontend-jaxws-2.2.7.jar:2.2.7] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) ~[cxf-rt-core-2.2.7.jar:2.2.7] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) ~[cxf-rt-core-2.2.7.jar:2.2.7] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) ~[na:1.6.0_17] Exceptions & stack trace at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) ~[na:1.6.0_17] at java.util.concurrent.FutureTask.run(FutureTask.java:138) ~[na:1.6.0_17] at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) ~[cxf-rt-core-2.2.7.jar:2.2.7] at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) ~[cxf-rt-core-2.2.7.jar:2.2.7] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243) ~[cxf-api-2.2.7.jar:2.2.7] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110) [cxf-rt-core-2.2.7.jar:2.2.7] at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98) [cxf-rt-transports-http-2.2.7.jar:2.2.7] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:423) [cxf-rt-transports-http-2.2.7.jar:2.2.7] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:178) [cxf-rt-transports-http-2.2.7.jar:2.2.7] at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142) [cxf-rt-transports-http-2.2.7.jar:2.2.7] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) [cxf-rt-transports-http-2.2.7.jar:2.2.7] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103) [cxf-rt-transports-http-2.2.7.jar:2.2.7] at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) [servlet-api.jar:na] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) [cxf-rt-transports-http-2.2.7.jar:2.2.7] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:6.0.26] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.26] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343) [spring-security-web-3.0.2.RELEASE.jar:na] vs. at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:90) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188) [spring-security-web-3.0.2.RELEASE.jar:na] code erreur at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149) [spring-security-web-3.0.2.RELEASE.jar:na] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.26] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.26] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:6.0.26] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:6.0.26] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.26] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:6.0.26] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) [catalina.jar:6.0.26] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:6.0.26] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) [catalina.jar:6.0.26] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) [tomcat-coyote.jar:6.0.26] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) [tomcat-coyote.jar:6.0.26] at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396) [tomcat-coyote.jar:6.0.26] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_17] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_17] at java.lang.Thread.run(Thread.java:637) [na:1.6.0_17] Caused by: java.lang.RuntimeException: Exception getting customer '71' at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:101) ~[CustomerServiceImpl.class:na] at fr.xebia.ws.customer.v1_0.CustomerServiceImpl$$FastClassByCGLIB$$30f63c56.invoke(<generated>) ~[cglib-nodep-2.2.jar:na] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) ~[cglib-nodep-2.2.jar:na] at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:692) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at fr.xebia.audit.AuditAspect.logMessage(AuditAspect.java:139) ~[AuditAspect.class:na] at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17] at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17] at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:622) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:611) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625) ~[spring-aop-3.0.1.RELEASE.jar:3.0.1.RELEASE] at fr.xebia.ws.customer.v1_0.CustomerServiceImpl$$EnhancerByCGLIB$$184a797f.getCustomer(<generated>) ~[cglib-nodep-2.2.jar:na] at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17] at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17] at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173) ~[cxf-rt-core-2.2.7.jar:2.2.7] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89) ~[cxf-rt-core-2.2.7.jar:2.2.7] ... 62 common frames omitted Caused by: java.lang.RuntimeException: Too many concurrent access to ZeSlowService at fr.xebia.productionready.backend.zeslowservice.ZeSlowServiceBoundedImpl.find(ZeSlowServiceBoundedImpl.java:57) ~[ZeSlowServiceBoundedImpl.class:na] at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.updateCustomerWithZeSlowServiceData(CustomerServiceImpl.java:166) ~[CustomerServiceImpl.class:na] at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:99) ~[CustomerServiceImpl.class:na] ... 84 common frames omitted 2010/04/12 15:06:09 [catalina-exec-18] WARN o.a.cxf.phase.PhaseInterceptorChain - Application {http://ws.xebia.fr/customer/v1_0}customerService #{http://ws.xebia.fr/customer/v1_0}getCustomer has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Exception getting customer '1' at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155) Caused by: java.lang.RuntimeException: Exception getting customer '1' at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.getCustomer(CustomerServiceImpl.java:101) Caused by: java.lang.RuntimeException: Something went wrong at fr.xebia.ws.customer.v1_0.CustomerServiceImpl.doSomeWork(CustomerServiceImpl.java:66) www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 26. La gestion des logs >= WARN, compact stack trace, collected logs my-app.log only audit, collected my-app-audit.log 10x10Mo, rolling, NOT collected, my-app-troubleshooting.log mostly >= WARN my-app-troubleshooting-1.log ... my-app-troubleshooting-9.log logs-to-collect easy to collect log files my-app-audit-20100411.log my-app-audit-201004....log ... my-app-20100411.log my-app-201004...log ... www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 27. La gestion des logs  Audit par annotation @RolesAllowed("ROLE_USER") @Audited(message = "CustomerService.getCustomer(#{args[0]})") public Customer getCustomer(long id) throws MyException { // ... }  Exemple de message ... 2010/04/12-17:18:00:266 CustomerService.getCustomer(12) by ze-remote-app coming from 9.0.1.53 ... www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 28. La Robustesse  Dépendances inter-application : fail fast est-il synonyme de fragilité ?  Prévention des saturations et des effets "domino" : l'art du code défensif,  Les modes dégradés www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 29. La Robustesse  Dépendances inter-application : fail fast est-il synonyme de fragilité ?  Bloquer le démarrage pour mauvaise configuration  Ne pas bloquer le démarrage pour indisponibilité d’une dépendance www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 30. La Robustesse  Prévention des saturations et des effets "domino" : l'art du code défensif Sh or im t tim po ssi eou ble t i Sometimes ! s Presentation & Business Slow Layer Service Sometimes Presentation & Business Slow Layer Service limit concurrent invocations ! www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 31. La Robustesse Les modes dégradés  Mieux vaut-il un service limité ou un système en panne ? www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 32. L’organisation  Prévoir l’exploitation  Les développeurs en support niveau 3  You Build It, You Run It ! www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 33. L’organisation Prévoir l’exploitation  Dès la conception  Processus itératif www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 34. L’organisation Les développeurs en support niveau 3  Prendre conscience  Responsabiliser www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 35. L’organisation “You Build It You Run It !” Amazon www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010
  • 36. Formation ! Formation Applications Java Prêtes pour la Production Les 17 & 18 Mai 2010 ! www.xebia.fr / blog.xebia.fr 2 Sunday, June 13, 2010