Skip to content

Commit

Permalink
Documentation adjusted, GH Action fine-tuned. Hoping for the best
Browse files Browse the repository at this point in the history
  • Loading branch information
sbglasius committed Dec 2, 2021
1 parent fbd9ba4 commit d593202
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 126 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ jobs:
echo "${SECRING_FILE}" | base64 -d > "${GITHUB_WORKSPACE}/secring.gpg"
echo "Publishing Artifacts for $RELEASE_VERSION"
(set -x; ./gradlew -Pversion="${RELEASE_VERSION}" -Psigning.secretKeyRingFile="${GITHUB_WORKSPACE}/secring.gpg" publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon)
echo "Publishing Documentation"
./gradlew asciidoctor -Pversion="${RELEASE_VERSION}"
- name: Bump patch version by one
uses: actions-ecosystem/action-bump-semver@v1
id: bump_semver
Expand All @@ -48,7 +46,7 @@ jobs:
level: patch
- name: Set version in gradle.properties
env:
NEXT_VERSION: ${{ steps.bump_semver.next_version }}
NEXT_VERSION: ${{ steps.bump_semver.new_version }}
run: |
echo "Preparing next snapshot"
./gradlew snapshotVersion -Pversion="${NEXT_VERSION}"
Expand All @@ -62,7 +60,8 @@ jobs:
- name: Build documentation
env:
RELEASE_VERSION: ${{ steps.get_version.outputs.version-without-v }}
run: ./gradlew asciidoctor -Pversion="${RELEASE_VERSION}"
run: |
./gradlew asciidoctor -Pversion="${RELEASE_VERSION}"
- name: Export Gradle Properties
uses: micronaut-projects/github-actions/export-gradle-properties@master
- name: Publish to Github Pages
Expand All @@ -73,7 +72,7 @@ jobs:
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
FOLDER: build/asciidoc
DOC_FOLDER: latest
COMMIT_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ secrets.GIT_USER_NAME }}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
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 added src/docs/asciidoc/api/.ignore
Empty file.
104 changes: 104 additions & 0 deletions src/docs/asciidoc/examples.adoc
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
}
}
}
----
10 changes: 9 additions & 1 deletion src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= JMS Plugin
:version: 3.0.1-SNAPSHOT
:version: x.y.z
:source-highlighter: coderay
:imagesdir: ./images

Expand All @@ -8,6 +8,14 @@

include::introduction.adoc[]

[[installation]]
== Installation
include::installation.adoc[]

[[examples]]
== Examples
include::examples.adoc[]

[[springJms]]
== Spring JMS

Expand Down
11 changes: 11 additions & 0 deletions src/docs/asciidoc/installation.adoc
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`
118 changes: 0 additions & 118 deletions src/docs/asciidoc/introduction.adoc
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
}
}
}
----

0 comments on commit d593202

Please sign in to comment.