The native RabbitMQ Grails plugin provides easily consumable messaging functionality.
Add to BuildConfig:
The RabbitMQ Native plugin enables integration of Grails applications with the RabbitMQ broker using the Java library provided by RabbitMQ.This plugin takes a lot of its inspirations from the official Grails RabbitMQ plugin, but it is not a fork of that plugin and it has some major differences and a lot of added functionality.The major features are listed below:
- Ability to connect to several RabbitMQ servers from a single application.
- Supports SSL and automatic reconnection.
- Ability to configure queues and exchanges from the application config.
- Ability to bind queues to exchanges without also defining the exchange.
- New artefact type for handling incoming messages called "consumers".
- Consumers can define message handlers for specific data types, along with 3 general types of handler method parameter lists.
- Consumers support automatic RPC behavior by passing along the return value of a consumer to the client.
- Ability to add custom message converters for automatic type conversion. Has 5 built-ins: Integer, List, Map, GString, and String.
- Support for subscribing directly to exchanges in consumers for all exchange types.
- Consumers are started as late as possible to ensure the application is ready to handle incoming messages.
- An option is available to manually start consumers to ensure that messages are not consumed until the application is ready.
- Connections and consumers can be stopped manually.