-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Spring Boot migration -- JMS for Service Bus and Metrics #11031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
saragluna
merged 7 commits into
Azure:master
from
saragluna:feature/spring-boot-jms-and-metrics
May 27, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ec597d7
add servicebus-jms starter and metrics starter
saragluna 726753f
add azure-spring-boot dependency in jacoco
saragluna dc5a725
upgrade spring-jms version and define spring modules verion in versio…
saragluna 89ee152
add CHANGELOG.md
saragluna 8a8b8f5
add configurations for JavaDoc plugins and entries in jacoco-test-cov…
saragluna ff384f9
Merge branch 'master' into feature/spring-boot-jms-and-metrics
saragluna 2d2e849
Merge branch 'master' into feature/spring-boot-jms-and-metrics
saragluna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
3 changes: 3 additions & 0 deletions
3
sdk/spring/azure-spring-boot-starter-active-directory/CHANGELOG.md
This file contains hidden or 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,3 @@ | ||
| # Release History | ||
|
|
||
| ## 2.2.5-beta.1 (Unreleased) |
This file contains hidden or 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,3 @@ | ||
| # Release History | ||
|
|
||
| ## 2.2.5-beta.1 (Unreleased) |
This file contains hidden or 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,47 @@ | ||
| #Azure Metrics Spring Boot Starter client library for Java | ||
|
|
||
| ## Key concepts | ||
|
|
||
| ## Getting started | ||
|
|
||
| ## Examples | ||
| ### Add the dependency | ||
|
|
||
| `azure-spring-boot-metrics-starter` is published on Maven Central Repository. | ||
| If you are using Maven, add the following dependency. | ||
|
|
||
| [//]: # ({x-version-update-start;com.azure:azure-spring-boot-metrics-starter;current}) | ||
| ```xml | ||
| <dependency> | ||
| <groupId>com.microsoft.azure</groupId> | ||
| <artifactId>azure-spring-boot-metrics-starter</artifactId> | ||
| <version>2.2.5-beta.1</version> | ||
| </dependency> | ||
| ``` | ||
| [//]: # ({x-version-update-end}) | ||
|
|
||
| ### Add the property setting | ||
|
|
||
| Open `application.properties` file and add below properties with your instrumentation key. | ||
|
|
||
| ``` | ||
| management.metrics.export.azuremonitor.instrumentation-key=<your-instrumentation-key-here> | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
| If the JDK version you use is greater than 1.8, You may meet this problem: | ||
| ``` | ||
| NoClassDefFoundError: javax/xml/bind/JAXBException | ||
| ``` | ||
|
|
||
| To solve this issue, you need to add the dependency below into your classpath: | ||
| ``` | ||
| <dependency> | ||
| <groupId>javax.xml.bind</groupId> | ||
| <artifactId>jaxb-api</artifactId> | ||
| <version>2.3.0</version> | ||
| </dependency> | ||
| ``` | ||
|
|
||
| ## Next steps | ||
| ## Contributing |
This file contains hidden or 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,143 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-client-sdk-parent</artifactId> | ||
| <version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} --> | ||
| <relativePath>../../parents/azure-client-sdk-parent</relativePath> | ||
| </parent> | ||
|
|
||
| <groupId>com.microsoft.azure</groupId> | ||
| <artifactId>azure-spring-boot-metrics-starter</artifactId> | ||
| <version>2.2.5-beta.1</version> <!-- {x-version-update;com.microsoft.azure:azure-spring-boot-metrics-starter;current} --> | ||
|
|
||
| <name>Azure Metrics Spring Boot Starter</name> | ||
| <description>Spring Boot Starter for Micrometer Metrics</description> | ||
| <url>https://github.com/Azure/azure-sdk-for-java</url> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter</artifactId> | ||
| <version>2.2.0.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter;external_dependency} --> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-validation</artifactId> | ||
| <version>2.2.0.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-validation;external_dependency} --> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.microsoft.azure</groupId> | ||
| <artifactId>azure-spring-boot</artifactId> | ||
| <version>2.2.5-beta.1</version> <!-- {x-version-update;com.microsoft.azure:azure-spring-boot;current} --> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.micrometer</groupId> | ||
| <artifactId>micrometer-registry-azure-monitor</artifactId> | ||
| <version>1.3.0</version> <!-- {x-version-update;spring_io.micrometer:micrometer-registry-azure-monitor;external_dependency} --> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-actuator-autoconfigure</artifactId> | ||
| <version>2.2.0.RELEASE</version> <!-- {x-version-update;org.springframework.boot:spring-boot-actuator-autoconfigure;external_dependency} --> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-enforcer-plugin</artifactId> | ||
| <version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} --> | ||
| <configuration> | ||
| <rules> | ||
| <bannedDependencies> | ||
| <includes> | ||
| <include>com.microsoft.azure:*</include> | ||
| <include>io.micrometer:micrometer-core:[1.3.0]</include> <!-- {x-include-update;spring_io.micrometer:micrometer-core;external_dependency} --> | ||
| <include>io.micrometer:micrometer-registry-azure-monitor:[1.3.0]</include> <!-- {x-include-update;spring_io.micrometer:micrometer-registry-azure-monitor;external_dependency} --> | ||
| <include>org.springframework.boot:spring-boot-actuator-autoconfigure:[2.2.0.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-actuator-autoconfigure;external_dependency} --> | ||
| <include>org.springframework.boot:spring-boot-starter:[2.2.0.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter;external_dependency} --> | ||
| <include>org.springframework.boot:spring-boot-starter-validation:[2.2.0.RELEASE]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-validation;external_dependency} --> | ||
| </includes> | ||
| </bannedDependencies> | ||
| </rules> | ||
| </configuration> | ||
| </plugin> | ||
| <!-- START: Empty Java Doc --> | ||
| <!-- The following code will generate an empty javadoc with just a README.md. This is necessary | ||
| to pass the required checks on Maven. The way this works is by setting the classesDirectory | ||
| to a directory that only contains the README.md, which we need to copy. If the classesDirectory | ||
| is set to the root, where the README.md lives, it still won't have javadocs but the jar file | ||
| will contain a bunch of files that shouldn't be there. The faux sources directory is deleted | ||
| and recreated with the README.md being copied every time to guarantee that, when building locally, | ||
| it'll have the latest copy of the README.md file. | ||
| --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-javadoc-plugin</artifactId> | ||
| <version>3.1.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-javadoc-plugin;external_dependency} --> | ||
| <executions> | ||
| <execution> | ||
| <id>attach-javadocs</id> | ||
| <goals> | ||
| <goal>jar</goal> | ||
| </goals> | ||
| <configuration> | ||
| <skip>true</skip> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-jar-plugin</artifactId> | ||
| <version>3.1.2</version> <!-- {x-version-update;org.apache.maven.plugins:maven-jar-plugin;external_dependency} --> | ||
| <executions> | ||
| <execution> | ||
| <id>empty-javadoc-jar-with-readme</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>jar</goal> | ||
| </goals> | ||
| <configuration> | ||
| <classifier>javadoc</classifier> | ||
| <classesDirectory>${project.basedir}/javadocTemp</classesDirectory> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-antrun-plugin</artifactId> | ||
| <version>1.8</version> <!-- {x-version-update;org.apache.maven.plugins:maven-antrun-plugin;external_dependency} --> | ||
| <executions> | ||
| <execution> | ||
| <id>copy-readme-to-javadocTemp</id> | ||
| <phase>prepare-package</phase> | ||
| <configuration> | ||
| <target> | ||
| <echo>Deleting existing ${project.basedir}/javadocTemp</echo> | ||
| <delete includeEmptyDirs="true" quiet="true"> | ||
| <fileset dir="${project.basedir}/javadocTemp"/> | ||
| </delete> | ||
| <echo>Copying ${project.basedir}/README.md to | ||
| ${project.basedir}/javadocTemp/README.md | ||
| </echo> | ||
| <copy file="${project.basedir}/README.md" tofile="${project.basedir}/javadocTemp/README.md"/> | ||
| </target> | ||
| </configuration> | ||
| <goals> | ||
| <goal>run</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <!-- END: Empty Java Doc --> | ||
| </plugins> | ||
| </build> | ||
| </project> |
1 change: 1 addition & 0 deletions
1
sdk/spring/azure-spring-boot-starter-metrics/src/main/resources/metrics.enable.config
This file contains hidden or 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 @@ | ||
| dummy |
3 changes: 3 additions & 0 deletions
3
sdk/spring/azure-spring-boot-starter-servicebus-jms/CHANGELOG.md
This file contains hidden or 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,3 @@ | ||
| # Release History | ||
|
|
||
| ## 2.2.5-beta.1 (Unreleased) |
53 changes: 53 additions & 0 deletions
53
sdk/spring/azure-spring-boot-starter-servicebus-jms/README.md
This file contains hidden or 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,53 @@ | ||
| #Azure Service Bus JMS Spring Boot Starter client library for Java | ||
|
|
||
| ## Key concepts | ||
| With this starter you could easily use Spring JMS Queue and Topic with Azure Service Bus. | ||
|
|
||
| ### Java agent based monitoring | ||
|
|
||
| Azure Application Insights has released one Java agent that can be used to capture metrics inside JVM. Consider use the Java agent based approach. | ||
|
|
||
| Refer following document for more details: | ||
|
|
||
| https://docs.microsoft.com/azure/azure-monitor/app/java-in-process-agent | ||
|
|
||
|
|
||
| ## Getting started | ||
|
|
||
| ### Add the dependency | ||
|
|
||
| `azure-servicebus-jms-spring-boot-starter` is published on Maven Central Repository. | ||
| Add the following dependency to your project: | ||
|
|
||
| [//]: # ({x-version-update-start;com.azure:azure-spring-boot-metrics-starter;current}) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This version tag's artifact doesn't match the artifactId below. |
||
| ```xml | ||
| <dependency> | ||
| <groupId>com.microsoft.azure</groupId> | ||
| <artifactId>azure-servicebus-jms-spring-boot-starter</artifactId> | ||
| <version>2.2.5-beta.1</version> | ||
| </dependency> | ||
| ``` | ||
| [//]: # ({x-version-update-end}) | ||
|
|
||
|
|
||
| ## Examples | ||
| These code [Service Bus Queue Sample](../../azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-queue/) | ||
| and [Service Bus Topic Sample](../../azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-topic/) | ||
| respectively demonstrates how to use Spring JMS Queue and Topic for Azure Service Bus via the Starter. | ||
|
|
||
| Running these samples will be charged by Azure. You can check the usage and bill at this [link](https://azure.microsoft.com/account/). | ||
|
|
||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ## Next steps | ||
|
|
||
| ### Allow telemetry | ||
| Microsoft would like to collect data about how users use this Spring boot starter. Microsoft uses this information to improve our tooling experience. Participation is voluntary. If you don't want to participate, just simply disable it by setting below configuration in `application.properties`. | ||
| ``` | ||
| azure.servicebus.allow-telemetry=false | ||
| ``` | ||
| When telemetry is enabled, an HTTP request will be sent to URL `https://dc.services.visualstudio.com/v2/track`. So please make sure it's not blocked by your firewall. | ||
| Find more information about Azure Service Privacy Statement, please check [Microsoft Online Services Privacy Statement](https://www.microsoft.com/privacystatement/OnlineServices/Default.aspx). | ||
|
|
||
| ## Contributing | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/CC @kushagraThapar
The only library that uses io.micrometer:micrometer-core and io.micrometer:micrometer-registry-azure-monitor dependencies is Cosmos. Could cosmos also be updated to use the 1.3.0 versions? I would prefer that, whenever possible, that we update the common version of an external dependency rather than declare library specific ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I don't see a reason why cosmos can't update the micrometer dependency to 1.3.0 version. As you mentioned @JimSuplizio this is not a blocker for this PR, and can be done later, but we should definitely have one common version.