We keep exploring the async features of Grails. This Grails Guide shows to handle a common scenario. A user registers himself in an application and the app sends the user a welcome email; asynchronously.
Great talk by @bitboss in the latest GR8Conf EU. A must watch to understand Grails 3 Events. Specially interesting to watch the first part of his talk where he reasons the why?. Why using events allows a lower coupling than other async vehicles such as Promises.
Github repository with sample code shown during the talk.
Starting with Grais 3.2.8 autowiring of GORM entities is disabled. Injection of services in domain classes was often used in combination of
beforeUpdate methods. etc.
In this Grails guide, you learn how to react to GORM events synchronously and asynchronously without the need of responding to those events inside your domain classes. No excuse to inject services in your domain classes 🚫.
I've talked in previous issues about RxGORM. RxJava plugin for Grails aims to:
Integrate RxJava with the controller layer of Grails to complete the picture and enable complete end-to-end integration of RxJava with Grails.
@graemerocher and the rest of the OCI Grails team keep navigation the Grails ship across the asynchronous and event-based world.
Checkout a Gist Example if you are curious.
I normally don't link to Milestone releases but 3.3 is a big milestone for Grails with mayor improvements and features:
Test your app with 3.3.0 and give feedback. You can download 3.3.0.M1 with SDK and compare to see the necessary changes.
Dan Bunker offers a Grails 2 course which introduces:
- Grails Tools
- Grails Domain Classes and GORM
- Grails Controllers and GSP
- Grails Spring Security
Through the course he uses the Grails Database Migration Plugin which is a must whether you are using Grails 2 or Grails 3.
He also describes Cross-site scripting (XSS) attacks and how to prevent them in the context of a Grails app.
@mikehoss42's blog post illustrates how to send and consume Events between two services. An excelent post to get started with Grails 3 Events
@goeh talk at GR8Conf shows how to communicate with events in Grails. Grails 3 includes event support based on the Reactor library. The slides are a great introduction of events in Grails 3 and contain some nice code examples about how to trigger and receive events. How to consume event replies or event trigger events after commits.
I attended @goeh talk at Greach, Cut your application to pieces . I was amazed by the incredible separation of concerns that he has achieved with the use plugins in Grails. I imagine he is working in migrating every plugin to grails 3 and taking advantage of events in Grails 3. That will be the cherry on top of the cake.
With tips such as:
Grails will use the value defined by the grails.codegen.defaultPackage value in grails-app/conf/application.yml to decide which package to use.
This tutorial remembered me one of the greatest Software Web applications produced in Spain; the defunct and missed Ducksboard
Hosted in the Qafqaz University tomorrow takes place a Grails & Groovy Event in Azerbaijan. I count myself among those who are worried about Groovy's community size. Finding this event encouraged me about Groovy's reach.
I normally don't link directly to the Grails Docs. However, the newly docs in Asciidoc are awesome and the asynchronous programming section worth reading several times. I probably comeback to other parts such as Events in futures issues. In the meanwhile go ahead and check the Promises section.
This talk by @smaldini is a bit old; Devox 2013. However, it presents the ideas behind the Grails 2 Events Plugin which clearly have passed through Grails 3 Events.
Checkout the Slides and if you using Grails 2 give it a try.
Another @graemerocher's talk at SpringOne2GX 2015. He explains about Traits, Events, Code generation and plugins in Grails 3 application. These features allow to build decoupled applications with multi project builds.
Watch this video because he goes deep into best practices. You will learn: additional ways to trigger and consume events in Grails 3, how to configure the load order of a plugin, The @Enhances annotation and in general a better understanding of what a Trait is and how to use it.
Check out the Grails 3 inside out slides
GORM became so good that it has eventually got a life of its own outside Grails. Same as the assets-pipeline. It is still core to Grails but you can use GORM outside a Grails app.
Moreover, it features other implementations than Hibernate; such as Neo4j, Casandra, Redis, MongoDB.
If you ever need to introduce someone to GORM or sharpen your GORM skills, this @jeffscottbrown's video is probably what you need.
Checkout the slides too.
I have not installed Spring Boot Admin. But just by looking at its README file, it seems to be a great way to centralize the monitoring of multiple Spring Boot / Grails applications.
This is a simple admin interface for Spring Boot applications.
This application provides a simple UI to administrate Spring Boot applications. > It provides the following features for registered application.
- Show health status
- Show details, like
- JVM & memory metrics
- Counter & gauge metrics
- Datasource metrics
- Cache metrics
- Show build-info number
- Follow and download logfile
- View jvm system- & environment-properties
- Support for Spring Cloud's postable /env- &/refresh-endpoint
- Easy loglevel management (currently for Logback only)
- Interact with JMX-beans
- View thread dump
- View traces
- Hystrix-Dashboard integration
- Download heapdump
- Notification on status change (via mail, Slack, Hipchat, ...)
- Event journal of status changes (non persistent)
Grails 3 Event system is one of the best features in the framework to create reusable and decoupled functionality. We use Events in our Grails 3 app and this talk was highlighted in my GGX personal agenda. @bitboss talk did not disappoint. It is a must watch for anyone using or planning to use Events in a Grails 3 app.
Check out the talk slides
Want to learn more about Events. Back in issue #9 I linked to @goeth's talk Event-Driven plugins with grails 3.
When you picture how microservices communicate, you are probably thinking about an exchange of HTTP requests between each other. @bitboss in his talk at GR8Conf EU explains the problems you may face if you choose that route ( Service discover, timeouts, Errors, Latency, Load Balancing, Stability ...). He pitches the use of an Event-Driven Architecture.
Moreover, he praises Grails Events system. He demos how to replace a Spring Boot microservice with a Grails application in an application composed of several microservices. He shows how to use RabbitMQ Native Plugin and Grails Events. Sample Repository.
He uses, the recently updated, RabbitMQ Native Grails Plugin.
Back in issue #2 I linked to a Grails Event in Azerbaijan.@ziyaaskerov, @S_V_J_P and the rest of the crew stroke back. This time with a Grails Conference the past 29 of October.
One of the talks had a provocative name: Build Instagram with Grails in 60 Minutes. This link will get you to the Github repository of the demo they produced.
If you speak Azerbaijani, checkout the video