Archive for April, 2013

This Week in Grails (2013-15)

Saturday, April 20th, 2013

The Groovy team released Groovy 2.0.8 and 2.1.3 this week.

Peter Ledbrook wrote up some thoughts about the future of Grails on his blog.

Check out this recent GGUG talk on Grails services, command objects and design approaches.


If you want to keep up with these “This Week in Grails” posts you can access them directly via their category link or in an RSS reader with the feed for just these posts.


Translations of this post:



Plugins

There were 3 new plugins released:

  • grooscript-vertx version 0.2.5. Convert your Groovy files to Javascript
  • search-fields version 0.1. Auto-generate search query based on DSL in domain classes
  • yui-war-minify version 1.2. Runs yui-compressor on css and javascript resources at WAR creation time

and 11 updated plugins:

  • build-info version 1.2.4. Provides a controller/view that display basic information about the war file
  • coffeescript-resources version 0.3.8. Create coffeescript modules that automatically compiles on every file change with jCoffeeScript
  • cxf version 1.1.1. Expose Grails services as SOAP web services via CXF
  • cxf-client version 1.5.3. Use existing (or new) Apache CXF wsdl2java generated content to invoke SOAP services
  • easyui version 0.9. Supplies jQuery EasyUI resources and taglibs
  • ember-templates-precompiler version 0.4.1. Precompiles EmberJS powered Handlebars templates
  • envers version 2.1.0. Integrates with Hibernate Envers
  • filterpane version 2.1.3. Adds filtering capabilities
  • gson version 1.1.4. Provides alternate JSON (de)serialization using Google’s Gson library
  • paypal version 0.6.9. Adds PayPal integration
  • uploadr version 0.7.3. HTML5 Drag and Drop file uploader

Interesting Tweets

User groups and Conferences

This Week in Grails (2013-14)

Sunday, April 14th, 2013

SpringSource has moved from VMware to EMC as part of Pivotal. Check out Adrian Colyer’s blog post for information about how this will affect Grails, Groovy, and Spring and what the future looks like for us.

The Groovy team did an extensive interview with ZeroTurnaround, lots of interesting stuff there.

Happy Birthday to Grails, the 0.1 release was 7 years ago.

I wrote a blog post about a new plugin that integrates Netty with Grails. It will probably take an integration into Grails core to see real benefits, but there should be some opportunities to improve scalability and performance with this plugin.


If you want to keep up with these “This Week in Grails” posts you can access them directly via their category link or in an RSS reader with the feed for just these posts.


Translations of this post:



Plugins

There were 3 new plugins released:

  • domain-locking version 0.3. Provides an easy way to use optimistic/pessimistic lock
  • nettymvc version 0.1. Adds support for using Netty in Grails
  • typescript version 0.4.1. Helps you manage typescript code in your Grails application

and 16 updated plugins:

  • facebook-sdk version 0.4.10. Allows your application to use the Facebook Platform and develop Facebook apps on Facebook.com or on web sites (with Facebook Connect)
  • file-server version 0.2. Serves files from any directories on disk
  • force-response-download version 0.1.5. Forces the browser to open a dialog for downloading content produced within controller actions
  • geasyui version 0.8. Supplies jQuery EasyUI resources and taglibs
  • geb version 0.9.0. Geb is a library for headless web browsing on the JVM, suitable for automation and functional web testing
  • gorm-interceptors version 0.1.1. Interceptors for GORM methods (excluding find, countBy, addTo, removeFrom methods)
  • gson version 1.1.3. Provides alternate JSON (de)serialization using Google’s Gson library
  • handlebars-resources version 0.3.6. Supports using Handlebars.js templates with the Grails Resources Plugin
  • plastic-criteria version 0.8. Mock Grails Criteria for Unit Tests
  • remote-pagination version 0.4.3. Provides tags for pagination and to sort columns without page refresh using Ajax and loads only the list of objects needed
  • sharding version 1.0. Defines multiple database shards to horizontally scale data
  • slug-generator version 0.3.1. Generates unique slugs for String properties, for example to generate unique ‘nice’ urls for access to domain objects
  • spring-security-twitter version 0.5. Twitter authentication as extension to the Spring Security Core plugin
  • uploadr version 0.7.2. HTML5 Drag and Drop file uploader
  • vaadin version 1.7.3. Adds Vaadin (http://vaadin.com/) integration
  • zkui version 0.5.6. Seamlessly integrates ZK with Grails’ infrastructures; uses the Grails’ infrastructures such as GSP, controllers rather than zk’s zul as in ZKGrails plugin

Interesting Tweets

Jobs



User groups and Conferences

Grails and Netty

Monday, April 01st, 2013

With all of the buzz about the Play vs Grails Smackdown at Devoxx last week, and this framework benchmark comparison from TechEmpower, I thought it would be interesting to look again at Rossen Stoyanchev’s demo project that integrates Spring MVC with Netty. He had mentioned it on the SpringSource internal developer list and I bookmarked it for later since I was curious about Netty.

I spent the weekend converting Rossen’s code to work with Grails, and created a plugin, borrowing some code from the Spring mock Servlet API classes and also from Tomcat. It’s a weird plugin in that it runs concurrently with the regular web app on a different port. I’m currently taking advantage of the work that Grails does, e.g. creating the Spring ApplicationContext, compiling GSPs in production WARs, etc. But it should be easy enough to get it to run standalone. It’s similar to the Dropwizard plugin, which also adds an alternative and higher-performance request path within a Grails application.

Netty is a generic (but high-performance) network library, so it doesn’t have extensive support for the Servlet API. But it does support HTTP, and that’s what Rossen’s code and my version add – a bridging layer between the lower-level Netty approach and the Servlet API. Ideally this provides a performance and scalability boost from Netty’s non-blocking IO, with the familiarity of the request/response/session approach in the Servlet API.

Most everything works in the plugin, but there are some omissions. There’s no support for SSL, and file upload isn’t implemented. You can do all of the usual Grails stuff, i.e. use controllers, services, GORM, etc. There is support for HTTP Sessions, although they’re not serialized to disk at shutdown and there’s no support for distributed sessions. But other than these items, making requests on the Netty port should work pretty much the same as requests on the servlet container port.

You can install the plugin in the usual way, i.e. add this to BuildConfig.groovy

compile ':nettymvc:0.1'

It will start a server socket on port 8080 by default, but you can configure that in Config.groovy, e.g.

grails.plugin.nettymvc.port = 8090

The plugin page is here and the source is here. Please try it out and let me know if there are issues or if you have suggestions for improvements, ideally in the form of pull requests of course 🙂

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.