You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by "Ate Douma (JIRA)" <je...@portals.apache.org> on 2008/06/13 14:06:45 UTC

[jira] Resolved: (JS2-888) Provide a HealthCheck functionality to validate if required resources are (still) available/online, like portlet applications and datasource

     [ https://issues.apache.org/jira/browse/JS2-888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ate Douma resolved JS2-888.
---------------------------

    Resolution: Fixed

Feature committed, also to the 2.1.2-POSTRELEASE and 2.1.3-POSTRELEASE branches.

This feature was provided by Ruben Carvalho, thanks Ruben!

> Provide a HealthCheck functionality to validate if required resources are (still) available/online, like portlet applications and datasource  
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JS2-888
>                 URL: https://issues.apache.org/jira/browse/JS2-888
>             Project: Jetspeed 2
>          Issue Type: New Feature
>    Affects Versions: 2.2
>            Reporter: Ate Douma
>            Assignee: Ate Douma
>             Fix For: 2.2
>
>
> This very useful feature for production environments will provide a dedicated pipeline (by default invokable through /healthcheck) and a corresponding HealthCheckValve.
> The HealthCheckValve is configurable with pluggable HealthCheckValidators to validate availability of specific resources, like required portlet applications and datasources.
> Base implementations for a PortletApplicationAvailableHeathCheckValidator and a DatasourceAvailableHealthCheckValidator will also be provided.
> The default valid/non-valid message returned by the HealthCheckValve (as plain/text) is also configurable allowing dedicated check routines/applications to periodically validate the status of the portal. 
> This new pipeline will be integrated and provided out-of-the-box, but by default check nothing, so the portal (if itself alive) will always return the configured "valid" message.
> To make this feature useful, override the portletApplicationValidator and databaseValidator bean definitions in the assembly pipelines.xml
> This feature will also be back-ported to the Jetspeed 2.1.2-POSTRELEASE and 2.1.3-POSTRELEASE branches.
> A (partly commented out) example of this will be added to the pipelines.xml and would be something like this (with in this example the maximum amount of output enabled):
>   <bean id="healthCheckValve" class="org.apache.jetspeed.pipeline.valve.HealthCheckValve" init-method="initialize">
>     <meta key="j2:cat" value="default" />
>     <constructor-arg index="0">
>       <!-- Validators -->
>       <list>
>         <ref bean="portletApplicationValidator" />
>         <ref bean="databaseValidator" />
>       </list>
>     </constructor-arg>
>     <constructor-arg index="1">
>       <!-- successMessage -->
>       <value>THE SERVER IS UP</value>
>     </constructor-arg>
>     <constructor-arg index="2">
>       <!-- failMessage -->
>       <value>THE SERVER IS DOWN</value>
>     </constructor-arg>
>     <constructor-arg index="3">
>       <!-- addValidationMessagesToResponse -->
>       <value>true</value>
>     </constructor-arg>
>     <constructor-arg index="4">
>       <!-- stopValidationOnError -->
>       <value>false</value>
>     </constructor-arg>
>   </bean>
>   <bean id="portletApplicationValidator" class="org.apache.jetspeed.healthcheck.validators.PortletApplicationAvailableHeathCheckValidator">
>     <meta key="j2:cat" value="default" />
>     <constructor-arg index="0">
>       <!-- requiredPortletApplications -->
>       <list>
>         <!-- names of the portlet applications which are required to be available -->
>         <value>j2-admin</value>
>         <value>demo</value>
>         <value>rss</value>
>       </list>
>     </constructor-arg>
>     <constructor-arg index="1">
>       <!-- numberOfRetries -->
>       <value>0</value>
>     </constructor-arg>
>     <constructor-arg index="2">
>       <!-- retryDelay -->
>       <value>0</value>
>     </constructor-arg>
>     <constructor-arg index="3">
>       <!-- portletRegistry -->
>       <ref bean="portletRegistry" />
>     </constructor-arg>
>     <constructor-arg index="4">
>       <!-- portletFactory -->
>       <ref bean="portletFactory" />
>     </constructor-arg>
>     <constructor-arg index="5">
>       <!-- stopValidationOnError -->
>       <value>true</value>
>     </constructor-arg>
>   </bean>
>   
>   <bean id="databaseValidator" class="org.apache.jetspeed.healthcheck.validators.DatasourceAvailableHealthCheckValidator">
>     <meta key="j2:cat" value="default" />
>     <constructor-arg index="0">
>       <!-- resources -->
>       <map>
>         <!-- entries to DataSourceValidationBean instances which should be checked
>              see (commented out) example below -->
>         <entry key="mydata">
>           <bean class="org.apache.jetspeed.healthcheck.validators.DataSourcesValidationBean">
>             <constructor-arg index="0">
>                <!-- Oracle database specific validation query -->
>                <value>SELECT * FROM SYS.DUAL</value>
>             </constructor-arg>
>             <constructor-arg index="1">
>               <list>
>                  <!-- list of datasources (all using the same validation query)
>                        which needs to be validated -->
>                  <bean class="org.springframework.jndi.JndiObjectFactoryBean">
>                     <property name="jndiName" value="java:comp/env/jdbc/mydata1"/>
>                  </bean>
>                  <bean class="org.springframework.jndi.JndiObjectFactoryBean">
>                     <property name="jndiName" value="java:comp/env/jdbc/mydata2"/>
>                  </bean>
>               </list>
>             </constructor-arg>
>           </bean>
>         </entry>       
>       </map>
>     </constructor-arg>
>     <constructor-arg index="1">
>       <!-- numberOfRetries -->
>       <value>0</value>
>     </constructor-arg>
>     <constructor-arg index="2">
>       <!-- retryDelay -->
>       <value>0</value>
>     </constructor-arg>
>     <constructor-arg index="3">
>       <!-- stopValidationOnError -->
>       <value>false</value>
>     </constructor-arg>
>     <constructor-arg index="4">
>       <!-- requireAllValid -->
>       <value>true</value>
>     </constructor-arg>
>   </bean>
>   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org