-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation adjusted, GH Action fine-tuned. Hoping for the best
- Loading branch information
Showing
7 changed files
with
130 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#Thu, 02 Dec 2021 15:11:36 +0000 | ||
version=-SNAPSHOT | ||
#Thu, 02 Dec 2021 16:56:19 +0100 | ||
version=3.0.5-SNAPSHOT | ||
grailsVersion=4.0.11 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
The following are some simple examples to give you a feel for the plugin. | ||
|
||
=== Service Queue Listeners | ||
|
||
[source,groovy] | ||
---- | ||
class ListeningService { | ||
static exposes = ['jms'] | ||
def onMessage(message) { | ||
assert message == 1 | ||
} | ||
} | ||
---- | ||
|
||
[source,groovy] | ||
---- | ||
class SomeController { | ||
def jmsService | ||
def someAction = { | ||
jmsService.send(service: 'listening', 1) | ||
} | ||
} | ||
---- | ||
|
||
=== Service Method Queue Listeners | ||
|
||
[source,groovy] | ||
---- | ||
import grails.plugin.jms.Queue | ||
class ListeningService { | ||
static exposes = ['jms'] | ||
@Queue | ||
def receive(message) { | ||
assert message == 1 | ||
} | ||
} | ||
---- | ||
|
||
[source,groovy] | ||
---- | ||
class SomeController { | ||
def jmsService | ||
def someAction = { | ||
jmsService.send(service: 'listening', method: 'receive', 1) | ||
} | ||
} | ||
---- | ||
|
||
=== Topic Listeners | ||
|
||
[source,groovy] | ||
---- | ||
import grails.plugin.jms.Subscriber | ||
class ListeningService { | ||
static exposes = ['jms'] | ||
@Subscriber | ||
def newMessages(message) { | ||
assert message == 1 | ||
} | ||
} | ||
---- | ||
|
||
[source,groovy] | ||
---- | ||
class SomeController { | ||
def jmsService | ||
def someAction = { | ||
jmsService.send(topic: 'newMessages', 1) | ||
} | ||
} | ||
---- | ||
|
||
=== Post Processing Messages | ||
|
||
[source,groovy] | ||
---- | ||
import javax.jms.Message | ||
class SomeController { | ||
def jmsService | ||
def someAction = { | ||
jmsService.send(service: 'initial', 1) { Message msg -> | ||
msg.JMSReplyTo = createDestination(service: 'reply') | ||
msg | ||
} | ||
} | ||
} | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
The plugin is available on Maven Central and should be a dependency like this: | ||
|
||
[source,groovy,subs="attributes"] | ||
---- | ||
dependencies { | ||
implementation 'io.github.gpc:jms:{version}' | ||
} | ||
---- | ||
|
||
In older versions of Gradle, replace `implementation` with `compile` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,4 @@ | ||
|
||
This plugin makes it easy to both send and receive JMS messages inside a Grails application. | ||
== Include in project | ||
|
||
The plugin is available on Maven Central and should be a dependency like this: | ||
|
||
[source,groovy,subs="attributes"] | ||
---- | ||
dependencies { | ||
compile 'io.github.gpc:jms:{version}' | ||
} | ||
---- | ||
|
||
In newer Gradle versions, replace `compile` with `implementation` | ||
|
||
== Examples | ||
|
||
The following are some simple examples to give you a feel for the plugin. | ||
|
||
|
||
=== Service Queue Listeners | ||
|
||
[source,groovy] | ||
---- | ||
class ListeningService { | ||
static exposes = ['jms'] | ||
def onMessage(message) { | ||
assert message == 1 | ||
} | ||
} | ||
---- | ||
|
||
[source,groovy] | ||
---- | ||
class SomeController { | ||
def jmsService | ||
def someAction = { | ||
jmsService.send(service: 'listening', 1) | ||
} | ||
} | ||
---- | ||
|
||
=== Service Method Queue Listeners | ||
|
||
[source,groovy] | ||
---- | ||
import grails.plugin.jms.Queue | ||
class ListeningService { | ||
static exposes = ['jms'] | ||
@Queue | ||
def receive(message) { | ||
assert message == 1 | ||
} | ||
} | ||
---- | ||
|
||
[source,groovy] | ||
---- | ||
class SomeController { | ||
def jmsService | ||
def someAction = { | ||
jmsService.send(service: 'listening', method: 'receive', 1) | ||
} | ||
} | ||
---- | ||
|
||
=== Topic Listeners | ||
|
||
[source,groovy] | ||
---- | ||
import grails.plugin.jms.Subscriber | ||
class ListeningService { | ||
static exposes = ['jms'] | ||
@Subscriber | ||
def newMessages(message) { | ||
assert message == 1 | ||
} | ||
} | ||
---- | ||
|
||
[source,groovy] | ||
---- | ||
class SomeController { | ||
def jmsService | ||
def someAction = { | ||
jmsService.send(topic: 'newMessages', 1) | ||
} | ||
} | ||
---- | ||
|
||
=== Post Processing Messages | ||
|
||
[source,groovy] | ||
---- | ||
import javax.jms.Message | ||
class SomeController { | ||
def jmsService | ||
def someAction = { | ||
jmsService.send(service: 'initial', 1) { Message msg -> | ||
msg.JMSReplyTo = createDestination(service: 'reply') | ||
msg | ||
} | ||
} | ||
} | ||
---- |