Communication Plugin for GRAILS
Reliable and Agile

Blog Archives:

Communication Plugin for GRAILS

We @iconnect use Grails framework extensively and are constantly improving the way we work with grails.Grails supports component based architecture in the form of Plugins. This Post is about a Grails Plugin we have built internally called communication plugin.

Grails already has different plugins for communication purposes such as email, sms, push notifications, etc. We have build an abstraction on top of these in the form of communication plugin. It supports grails >= 3.1 and above. This plugin provides a common interface for creating notifications with a type. types can be SMS,EMAIL,PUSH etc. For each type we have supplied an implementation. The project does not need to worry about the implementation , it just creates a notification via given service and supply the correct type.

 

New Types and their implementation can be added as required. For SMS we have used SMS Gupshups apis in the implementation. Email uses any SMTP gateway and its properties can be supplied through by the project. We have Push notifications support as well and 2 implementations for it are GCM & Firebase both google variants.

Another goal of the plugin is to make sending such notifications asynchronously and avoid any wait time for the clients of the plugin. A job runs to execute all the newly saved notifications and can keep track of all sent/erred ones. Bulk notifications can also be sent using this job – upto 200 push notifications can be sent at a time for firebase & GCM. Methods are also available to view notification history between specific dates in the Service provided in plugin.