| Subcribe via RSS or via Email

Terracotta and Wicket (the next generation)

November 5th, 2008 Posted in Java, Wicket

Edit: with the 1.1.3 release you should follow the instructions on this post.  It is no longer required for you to set up the page store yourself.

The new terracotta wicket-tim is out!

Any wicket and terracotta users will know that the previous wicket-tim had issues under heavy load, which is why some months ago I set about creating something better, with lots of help from the wicket community, especially Stefan Fussenegger, we created a new in-memory page map which can cope with high load.

To use this you will need to add the wicket-tim to your classpath, if you are using maven then add this to your pom.xml file:

	org.terracotta.modules
	tim-wicket
	1.1.1

And follow the installation instructions.

In your tc-config.xml you will need to include the wicket-tim module, you can find instructions on how to do this here and here.

Then in your wicket application class you need to use the new page map:

public ISessionStore newSessionStore() {
     return new SecondLevelCacheSessionStore(this,
       new TerracottaPageStore(100));
}

The 100 in the page store parameter is the number of pages (or versions of pages) of history to keep inthe page map, and can be set to anything you feel is appropriate.

The page map is stored in the httpsession so you will need to make sure that httpsession clustering is working correctly.  If you are using tomcat then terracotta should do this automatically.

Feedback and bug reports are welcome, particularity about the user configurable number of pages history.  If we remove this then it will be possible to use byte-code instrumentation to automatically add in the TerracottaPageStore, meaning that the wicket-tim wont need adding onto your application build path.

Richard

8 Responses to “Terracotta and Wicket (the next generation)”

  1. Stefan Fussenegger Says:

    Hi Richard. Thanks for your all the great work and the credit. Regards, Stefan


  2. Orion Letizi Says:

    Very cool stuff, Richard. I’ve been noting your progress here:

    http://www.terracotta.org/web/display/orgsite/Community+Highlights

    The next site push will include this update.

    Also, I’m still working on the Terracotta Champions thing we talked about. Sorry it’s been slow in coming, but it is coming.

    Cheers,
    Orion


  3. Eugene Kuleshov Says:

    By the way, you could intercept newSessionStore() method in your tim-wicket and provide this Terracotta-specific implementation automatically. So, user won’t have to change his application to work in Terracotta.


  4. Richard Says:

    Eugene, I did know that, but I could not think of a way for the user to specify the number to keep in history if i did that. I had been thinking of just removing the ability of the user to set that. What are your thoughts?


  5. A simple wicket and terracotta example | Richard Wilkinson's Blog Says:

    [...] the publication of the updated wicket terracotta plugin I have been working on a simple example [...]


  6. Eugene Kuleshov Says:

    You could stick that number into system properties or tc.properties, or maybe bug Terracotta folks to implement support for the custom namespaces for tc-config.xml, so you could stick your tim configuration in there. The Terracotta Spring integration is doing something like that, but it is using hardcoded schema.


  7. Richard Says:

    I was playing around with it last night and I think I can get it working automatically. Since the asm stuff modifies the WebApplication class, you should still be able to override it in your own WebApplication if you need to.


  8. Updated terrcotta wicket-tim | Richard Wilkinson's Blog Says:

    [...] The code will now automatically configure your application to use the correct page store, with a default of 100 pages history per page map.  If you need to override this value then you can override the the newSessionStore method in your WebApplication class, as in the previous version (see this post). [...]


Leave a Reply

retaggr