Skip to content

Commit

Permalink
Merge e269988 into 3d818f3
Browse files Browse the repository at this point in the history
  • Loading branch information
sonus21 committed Dec 11, 2019
2 parents 3d818f3 + e269988 commit ad8e010
Show file tree
Hide file tree
Showing 121 changed files with 4,083 additions and 1,302 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
env:
ORG_GRADLE_PROJECT_sonatypeUsername=xxx
ORG_GRADLE_PROJECT_sonatypePassword=xxx
USER_NAME=rqueue

cache:
directories:
Expand Down
46 changes: 40 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Rqueue is an asynchronous task executor(worker) built for spring framework based

### Adding a task
Rqueue supports two types of tasks.
1. Execute method as soon as possible
2. Delayed tasks (task that would be scheduled at given delay)
1. Execute tasks as soon as possible
2. Delayed tasks (task that would be scheduled at given delay, run task at 2:30PM)


### Task execution configuration
Expand All @@ -33,14 +33,14 @@ Add Dependency
* Get latest one from [Maven central](https://search.maven.org/search?q=g:com.github.sonus21%20AND%20a:rqueue-spring-boot-starter)
* Gradle
```groovy
implementation 'com.github.sonus21:rqueue-spring-boot-starter:1.2-RELEASE'
implementation 'com.github.sonus21:rqueue-spring-boot-starter:1.3-RELEASE'
```
* Maven
```xml
<dependency>
<groupId>com.github.sonus21</groupId>
<artifactId>rqueue-spring-boot-starter</artifactId>
<version>1.2-RELEASE</version>
<version>1.3-RELEASE</version>
<type>pom</type>
</dependency>
```
Expand All @@ -51,14 +51,14 @@ Add Dependency
Get latest one from [Maven central](https://search.maven.org/search?q=g:com.github.sonus21%20AND%20a:rqueue-spring)
* Gradle
```groovy
implementation 'com.github.sonus21:rqueue-spring:1.2-RELEASE'
implementation 'com.github.sonus21:rqueue-spring:1.3-RELEASE'
```
* Maven
```xml
<dependency>
<groupId>com.github.sonus21</groupId>
<artifactId>rqueue-spring</artifactId>
<version>1.2-RELEASE</version>
<version>1.3-RELEASE</version>
<type>pom</type>
</dependency>
```
Expand Down Expand Up @@ -242,6 +242,40 @@ factory.setMessageConverters(messageConverters);

More than one message converter can be used as well, when more than one message converters are provided then they are used in the order, whichever returns **non null** value is used.

## Monitoring Queue Statistics
NOTE: Rqueue support micrometer library for monitoring.

**It provides 4 types gauge of metrics.**
```
1. queue.size : number of tasks to be run
2. dead.letter.queue.size : number of tasks in the dead letter queue
3. delayed.queue.size : number of tasks scheduled for later time, it's an approximate number, since some tasks might not have moved to be processed despite best efforts
4. processing.queue.size : number of tasks are being processed. It's also an approximate number due to retry and tasks acknowledgements.
```

**Execution and failure counters can be enabled (by default this is disabled).**

We need to set count.execution and count.failure fields of RqueueMetricsProperties
```
1. execution.count
2. failure.count
```

All these metrics are tagged

**Spring Boot Application**
1. Add micrometer and the exporter dependencies
2. Set tags if any using `rqueue.metrics.tags.<name> = <value>`
3. Enable counting features using `rqueue.metrics.count.execution=true`, `rqueue.metrics.count.failure=true`

**Spring Application**

1. Add micrometer and the exporter dependencies provide MeterRegistry as bean
2. Provide bean of RqueueMetricsProperties, in this bean set all the required fields.


[![Grafana Dashboard](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/grafana-dashboard.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/grafana-dashboard.png)



## Support
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'nebula.optional-base' version '5.0.2'
}
allprojects {
apply plugin: 'idea'
Expand All @@ -9,6 +10,7 @@ allprojects {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'jacoco'
apply plugin: 'nebula.optional-base'
sourceCompatibility = 1.8
targetCompatibility = 1.8

Expand All @@ -20,7 +22,7 @@ allprojects {

subprojects {
group = 'com.github.sonus21'
version = '1.2-SNAPSHOT'
version = '1.3-RELEASE'

dependencies {
// https://mvnrepository.com/artifact/org.springframework/spring-messaging
Expand Down Expand Up @@ -52,7 +54,7 @@ subprojects {
}

def publishedProjects = subprojects.findAll({ subproject ->
subproject.pluginManager.hasPlugin('java') && !subproject.name.endsWith("example")
subproject.pluginManager.hasPlugin('java') && !subproject.name.endsWith("example") && !subproject.name.contains("test")
})

task jacocoMerge(type: JacocoMerge) {
Expand Down
Binary file added docs/static/grafana-dashboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions gradle/code-signing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ artifacts {
archives javadocJar
}


ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
ext.isReleaseVersion = !version.endsWith("SNAPSHOT") && !"rqueue".equals(System.getenv("USER_NAME"))
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
Expand Down
5 changes: 5 additions & 0 deletions rqueue-spring-boot-example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM tomcat:8.0.51-jre8-alpine
RUN rm -rf /usr/local/tomcat/webapps/*
ARG WAR_FILE=build/libs/*.war
COPY ${WAR_FILE} /usr/local/tomcat/webapps/ROOT.war
CMD ["catalina.sh","run"]

0 comments on commit ad8e010

Please sign in to comment.