New REST and SOAP APIs released for Ehcache

Ehcache Server and Standalone Server have been released to Sourceforge Downloads. The server provides RESTful and SOAP APIs to Ehcache. It is available as a WAR which works with all app servers, or standalone using Glassfish V3 embedded.

New in this release is integration with Terracotta Server Array for coherent, scalable and HA caching. Also the Ehcache core has been upgraded to version 2.0, Jersey to 1.1.5, Metro to 2.1.5 and for standalone, Glassfish to V3 embedded.

This release has been performance tested against memcache and gives comparable over-the-network performance. Coupled with the simplicity of coding in your HTTP client of choice in your programming language of choice and easily getting the benefits of Terracotta Server Array backing it, this is a killer combination.

See the Ehcache Server documentation to get started or download it now.

Due to an issue with external repository handling, these have not yet been released to Maven. Sonatype are completing a project for Sun whereby they will be adding their artifacts to the Central repository. This is expected to be completed this week or next, so the Maven artifacts will be released then.

Interestingly, it can take a little bit of work to tune your Java HTTP client for speed. The following code snippet shows two recommended optimisations for the Apache HTTP client: turning off the staleness check (you would catch the exception on connection clone in production code and open a new one) and ignoring cookies.

HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter("http.connection.stalecheck", false);
for (int i = 0; i < cacheOperations; i++) {
    String url = new StringBuffer(cacheUrl).append('/').append(keyBase).append(i).toString();
    HttpMethod httpMethod = new GetMethod(url);
    httpMethod.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
    httpClient.executeMethod(httpMethod);
}
LOG.info(cacheOperations + " gets: " + stopWatch.getElapsedTime() + "ms");

By Greg Luck

As Terracotta’s CTO, Greg (@gregrluck) is entrusted with understanding market and technology forces and the business drivers that impact Terracotta’s product innovation and customer success. He helps shape company and technology strategy and designs many of the features in Terracotta’s products. Greg came to Terracotta on the acquisition of the popular caching project Ehcache which he founded in 2003. Prior to joining Terracotta, Greg served as Chief Architect at Australian online travel giant Wotif.com. He also served as a lead consultant for ThoughtWorks on accounts in the United States and Australia, was CIO at Virgin Blue, Tempo Services, Stamford Hotels and Resorts and Australian Resorts and spent seven years as a Chartered Accountant in KPMG’s small business and insolvency divisions. He is a regular speaker at conferences and contributor of articles to the technical press.

5 comments

  1. Pingback: STEVEN
  2. Pingback: Cabinets
  3. Pingback: EDGAR
  4. Pingback: Ducati

Comments are closed.