diff --git a/README.md b/README.md index 8a367c4..bc1a562 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ The Spring Integration Extensions project provides extension modules for [Spring * [XQuery][] Support * [Splunk][] Support * [Amazon Web Services (AWS)][] Support +* [MQ Telemetry Transport (MQTT)][] Support ## Samples @@ -133,4 +134,5 @@ The Spring Integration Extensions Framework is released under version 2.0 of the [Websockets]: http://www.html5rocks.com/en/tutorials/websockets/basics/ [XQuery]: http://en.wikipedia.org/wiki/XQuery [Splunk]:http://www.splunk.com/ -[Amazon Web Services (AWS)]: http://aws.amazon.com/ \ No newline at end of file +[Amazon Web Services (AWS)]: http://aws.amazon.com/ +[MQ Telemetry Transport (MQTT)]: http://mqtt.org/ \ No newline at end of file diff --git a/spring-integration-mqtt/README.md b/spring-integration-mqtt/README.md index 1a49cf9..986bfea 100644 --- a/spring-integration-mqtt/README.md +++ b/spring-integration-mqtt/README.md @@ -1,7 +1,7 @@ Spring Integration Mqtt Adapters ================================================= -`inbound` and `outbound` channel adapters are provided for Mqtt. The current implementation uses the [Eclipse Paho][] client. +`inbound` and `outbound` channel adapters are provided for [MQ Telemetry Transport (MQTT)][]. The current implementation uses the [Eclipse Paho][] client. Example configurations... @@ -73,4 +73,5 @@ For more information, please also don't forget to visit the [Spring Integration] [Spring Integration Pattern Catalog]: https://github.com/SpringSource/spring-integration-pattern-catalog [Stack Overflow]: http://stackoverflow.com/faq [Eclipse Paho]: http://www.eclipse.org/paho/ -[open paho bug]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382471 \ No newline at end of file +[open paho bug]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382471 +[MQ Telemetry Transport (MQTT)]: http://mqtt.org/ \ No newline at end of file diff --git a/spring-integration-mqtt/build.gradle b/spring-integration-mqtt/build.gradle index 7e53dda..313d539 100644 --- a/spring-integration-mqtt/build.gradle +++ b/spring-integration-mqtt/build.gradle @@ -1,12 +1,9 @@ -description = 'Spring Integration Mqtt Adapter' +description = 'Spring Integration MQTT Adapter' buildscript { repositories { maven { url 'https://repo.springsource.org/plugins-snapshot' } } - dependencies { - classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.5' - } } apply plugin: 'java' @@ -26,9 +23,9 @@ sourceCompatibility=1.6 targetCompatibility=1.6 ext { - junitVersion = '4.10' - log4jVersion = '1.2.12' - mockitoVersion = '1.9.0' + junitVersion = '4.11' + log4jVersion = '1.2.17' + mockitoVersion = '1.9.5' springVersion = '3.1.3.RELEASE' springIntegrationVersion = '3.0.0.BUILD-SNAPSHOT' @@ -63,7 +60,7 @@ dependencies { testCompile "log4j:log4j:$log4jVersion" testCompile "org.mockito:mockito-all:$mockitoVersion" testCompile "org.springframework:spring-test:$springVersion" - jacoco group: "org.jacoco", name: "org.jacoco.agent", version: "0.5.6.201201232323", classifier: "runtime" + jacoco group: "org.jacoco", name: "org.jacoco.agent", version: "0.6.2.201302030002", classifier: "runtime" } @@ -92,12 +89,6 @@ artifacts { archives javadocJar } -apply plugin: 'docbook-reference' - -reference { - sourceDir = file('src/reference/docbook') -} - apply plugin: 'sonar' sonar { @@ -174,7 +165,7 @@ task schemaZip(type: Zip) { task docsZip(type: Zip) { group = 'Distribution' classifier = 'docs' - description = "Builds -${classifier} archive containing api and reference " + + description = "Builds -${classifier} archive containing the api " + "for deployment at static.springframework.org/spring-integration/docs." from('src/dist') { @@ -184,10 +175,6 @@ task docsZip(type: Zip) { from (api) { into 'api' } - - from (reference) { - into 'reference' - } } task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) { @@ -262,5 +249,5 @@ task dist(dependsOn: assemble) { task wrapper(type: Wrapper) { description = 'Generates gradlew[.bat] scripts' - gradleVersion = '1.3' + gradleVersion = '1.6' } diff --git a/spring-integration-mqtt/gradle/wrapper/gradle-wrapper.jar b/spring-integration-mqtt/gradle/wrapper/gradle-wrapper.jar index 81dcde6..7f1e239 100644 Binary files a/spring-integration-mqtt/gradle/wrapper/gradle-wrapper.jar and b/spring-integration-mqtt/gradle/wrapper/gradle-wrapper.jar differ diff --git a/spring-integration-mqtt/gradle/wrapper/gradle-wrapper.properties b/spring-integration-mqtt/gradle/wrapper/gradle-wrapper.properties index 66b16f7..6281daf 100644 --- a/spring-integration-mqtt/gradle/wrapper/gradle-wrapper.properties +++ b/spring-integration-mqtt/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Sep 05 13:34:36 EDT 2012 +#Wed May 15 15:57:24 EDT 2013 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.1-bin.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip diff --git a/spring-integration-mqtt/gradlew b/spring-integration-mqtt/gradlew index cf12650..e61422d 100755 --- a/spring-integration-mqtt/gradlew +++ b/spring-integration-mqtt/gradlew @@ -101,7 +101,7 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else - warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT" + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi diff --git a/spring-integration-mqtt/gradlew.bat b/spring-integration-mqtt/gradlew.bat index 8a0b282..aec9973 100644 --- a/spring-integration-mqtt/gradlew.bat +++ b/spring-integration-mqtt/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/DefaultMqttPahoClientFactory.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/DefaultMqttPahoClientFactory.java index 1eda5d8..2445bb4 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/DefaultMqttPahoClientFactory.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/DefaultMqttPahoClientFactory.java @@ -27,6 +27,7 @@ import org.eclipse.paho.client.mqttv3.MqttException; /** * Creates a default {@link MqttClient} and a set of options as configured. * @author Gary Russell + * @author Gunnar Hillert * @since 1.0 * */ @@ -78,6 +79,11 @@ public class DefaultMqttPahoClientFactory implements MqttPahoClientFactory { this.userName = userName; } + /** + * Will be used to set the "Last Will and Testament" (LWT) for the connection. + * + * @see MqttConnectOptions + */ public void setWill(Will will) { this.will = will; } diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java index 0806980..5e21c72 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-integration-mqtt/src/main/resources/org/springframework/integration/mqtt/config/xml/spring-integration-mqttadapter.gif b/spring-integration-mqtt/src/main/resources/org/springframework/integration/mqtt/config/xml/spring-integration-mqttadapter.gif index 41b369f..210e076 100644 Binary files a/spring-integration-mqtt/src/main/resources/org/springframework/integration/mqtt/config/xml/spring-integration-mqttadapter.gif and b/spring-integration-mqtt/src/main/resources/org/springframework/integration/mqtt/config/xml/spring-integration-mqttadapter.gif differ diff --git a/spring-integration-mqtt/src/reference/docbook/SIAdapterLowerPrefix.xml b/spring-integration-mqtt/src/reference/docbook/SIAdapterLowerPrefix.xml deleted file mode 100644 index 151e09d..0000000 --- a/spring-integration-mqtt/src/reference/docbook/SIAdapterLowerPrefix.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - MqttAdapter Adapter - - The Spring Integration MqttAdapter Adapter provides... - - - - Outbound Channel adapter - - - Outbound Gateway - - - Inbound Channel Adapter - - - -
- Java Implementation - Each of the provided components will use the - org.springframework.integration.mqtt.core.MqttAdapterExecutor - class... - -
-
- Common Configuration Attributes - - Certain configuration parameters are shared amongst all MqttAdapter - components and are described below: - - - auto-startup - - Lifecycle attribute signaling if this component should - be started during Application Context startup. - Defaults to true. - Optional. - - - id - - Identifies the underlying Spring bean definition, which - is an instance of either EventDrivenConsumer - or PollingConsumer. - Optional. - - -
- -
- Outbound Channel Adapter - - The MqttAdapter Outbound channel adapter allows you to... - -
-
- Outbound Gateway - - Outbound gateways are similar to outbound channel adapters except that it can also be used to - get a result on the reply channel after performing - the given... - -
-
- Inbound Channel Adapter - - An inbound channel adapter is used to execute... - -
- -
diff --git a/spring-integration-mqtt/src/reference/docbook/history.xml b/spring-integration-mqtt/src/reference/docbook/history.xml deleted file mode 100644 index 549be21..0000000 --- a/spring-integration-mqtt/src/reference/docbook/history.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Change History - - - diff --git a/spring-integration-mqtt/src/reference/docbook/images/logo.png b/spring-integration-mqtt/src/reference/docbook/images/logo.png deleted file mode 100644 index 8c71c13..0000000 Binary files a/spring-integration-mqtt/src/reference/docbook/images/logo.png and /dev/null differ diff --git a/spring-integration-mqtt/src/reference/docbook/index.xml b/spring-integration-mqtt/src/reference/docbook/index.xml deleted file mode 100644 index d3fd4e8..0000000 --- a/spring-integration-mqtt/src/reference/docbook/index.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - Spring Integration MqttAdapter Adapter - MqttAdapter Adapter ${version} - Spring Integration - ${version} - - - - - - - - - - - - - - Gary Russell - - - © SpringSource Inc., 2012 - - - - - - - What's new? - - - For those who are already familiar with Spring Integration, this - chapter - provides a brief overview of the new features of version 2.2. If you are - interested in the changes and features, that were introduced in - earlier - versions, please take a look at chapter: - - - - - - - - - - Integration Adapters - - This section covers the various Channel Adapters and Messaging - Gateways provided - by Spring Integration to support Message-based communication with - external systems. - - - - - - Appendices - - Advanced Topics and Additional Resources - - - - diff --git a/spring-integration-mqtt/src/reference/docbook/resources.xml b/spring-integration-mqtt/src/reference/docbook/resources.xml deleted file mode 100644 index 109faa9..0000000 --- a/spring-integration-mqtt/src/reference/docbook/resources.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - Additional Resources - -
- Spring Integration Home - - The definitive source of information about Spring Integration is the - Spring Integration Home at - http://www.springsource.org. That site serves as a hub of - information and is the best place to find up-to-date announcements about the project as well as links to - articles, blogs, and new sample applications. - -
- -
diff --git a/spring-integration-mqtt/src/reference/docbook/whats-new.xml b/spring-integration-mqtt/src/reference/docbook/whats-new.xml deleted file mode 100644 index f037937..0000000 --- a/spring-integration-mqtt/src/reference/docbook/whats-new.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - What's new? - - This chapter provides an overview of the new features and improvements - that have been added to the MqttAdapter Adapter: - - - diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/BackTobackAdapterTests.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/BackTobackAdapterTests.java index 60e44f3..66e2ba3 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/BackTobackAdapterTests.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/BackTobackAdapterTests.java @@ -31,7 +31,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; /** * @author Gary Russell - * @since 3.0 + * @since 1.0 * */ public class BackTobackAdapterTests { diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/BrokerRunning.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/BrokerRunning.java index f7c5726..57587d8 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/BrokerRunning.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/BrokerRunning.java @@ -32,7 +32,7 @@ import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory; /** * @author Gary Russell - * @since 3.0 + * @since 1.0 * */ public class BrokerRunning extends TestWatcher { diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/MqttAdapterTests.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/MqttAdapterTests.java index bdce33f..92c44c4 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/MqttAdapterTests.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/MqttAdapterTests.java @@ -53,7 +53,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; /** * @author Gary Russell - * @since 3.0 + * @since 1.0 * */ public class MqttAdapterTests { diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParserTests.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParserTests.java index ec89563..5b3452f 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParserTests.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParserTests.java @@ -32,7 +32,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Gary Russell - * @since 3.0 + * @since 1.0 * */ @ContextConfiguration diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttOutboundChannelAdapterParserTests.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttOutboundChannelAdapterParserTests.java index be2552f..71a752b 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttOutboundChannelAdapterParserTests.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttOutboundChannelAdapterParserTests.java @@ -35,7 +35,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Gary Russell - * @since 3.0 + * @since 1.0 * */ @ContextConfiguration