microsoft / azure-spring-boot Goto Github PK
View Code? Open in Web Editor NEWSpring Boot Starters for Azure services
License: MIT License
Spring Boot Starters for Azure services
License: MIT License
Looking at the project, most modules bring a few classes and there are also some common concepts in azure-spring-common
.
Given the surface area and the size of the project, it would be doable to move all the auto-configuration code to a single module (with optional dependencies). The starters would remain the same (and the solution 100% backward compatible).
I also think having them together should improve testing of the "platform"
If you do that, starters cloud move to azure-spring-boot-starters
. See also #159
Line 191 of DocumentDbTemplate
class
final String query = "SELECT * FROM root r WHERE r.id='" + dbName + "'";```
Is it vulnerable of SQL injection?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (validate) on project demo-documentdb: Failed during checkstyle execution: Unable to find configuration file at location: ../config/checkstyle.xml: Could not find resource '../config/checkstyle.xml'. -> [Help 1]
version 0.1.4
If this property is keyvault specific, it should be under the azure.keyvault
namespace IMO. If it isn't, I'd still rename it as the intend of the prefix is to define an origin for the feature rather than translating the property name itself.
The samples extends from spring-boot-starter-parent
to (I suppose) reproduces what would happen with a blank app generated from start.spring.io.
If that's the intend, they shouldn't have override of maven plugin versions and dedicated pluginsManagement
. IMO, this is a bit confusing because the first objective is clearly not achieved so it's not obvious why they inherit from starter-parent. Not doing that would move the checkstyle and findbugs config in the parent, making the sample more succinct and easier to apprehend.
cd azure-spring-boot-starters\documentdb\spring-data-azure-documentdb
mvn package
There will be below warnings.
[WARNING] Javadoc Warnings
[WARNING] D:\azure-spring-boot-starters\documentdb\spring-data-azure-documentdb\src\main\java\com\microsoft\azure\spring\data\documentdb\core\mapping\BasicDocumentDbPersistentProperty.java:36: warning - @propertyDescription is an unknown tag.
[WARNING] D:\azure-spring-boot-starters\documentdb\spring-data-azure-documentdb\src\main\java\com\microsoft\azure\spring\data\documentdb\core\mapping\BasicDocumentDbPersistentProperty.java:36: warning - Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
[WARNING] D:\azure-spring-boot-starters\documentdb\spring-data-azure-documentdb\src\main\java\com\microsoft\azure\spring\data\documentdb\core\mapping\BasicDocumentDbPersistentProperty.java:36: warning - Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
[WARNING] D:\azure-spring-boot-starters\documentdb\spring-data-azure-documentdb\src\main\java\com\microsoft\azure\spring\data\documentdb\core\mapping\BasicDocumentDbPersistentProperty.java:36: warning - @propertyDescription is an unknown tag.
[WARNING] D:\azure-spring-boot-starters\documentdb\spring-data-azure-documentdb\src\main\java\com\microsoft\azure\spring\data\documentdb\core\mapping\BasicDocumentDbPersistentProperty.java:36: warning - Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
[WARNING] D:\azure-spring-boot-starters\documentdb\spring-data-azure-documentdb\src\main\java\com\microsoft\azure\spring\data\documentdb\core\mapping\BasicDocumentDbPersistentProperty.java:36: warning - Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
[WARNING] D:\azure-spring-boot-starters\documentdb\spring-data-azure-documentdb\src\main\java\com\microsoft\azure\spring\data\documentdb\core\mapping\BasicDocumentDbPersistentProperty.java:36: warning - Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
[WARNING] D:\azure-spring-boot-starters\documentdb\spring-data-azure-documentdb\src\main\java\com\microsoft\azure\spring\data\documentdb\core\mapping\BasicDocumentDbPersistentProperty.java:36: warning - Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
AADAuthenticationFilterTest
has a check before every method that does not validate. I guess that's an oversight of some kind.
[ERROR] MavenInvocationException: Error when invoking Maven, consult the invoker log file: D:\azure-spring-boot-starters\azure-mediaservices-spring-boot-starter-sample\target\invoker\maven-javadoc-plugin1034693639.txt
[WARNING] Creating fake javadoc directory to prevent repeated invocations: D:\azure-spring-boot-starters\azure-mediaservices-spring-boot-starter\target\apidocs
[ERROR] Error fetching link: D:\azure-spring-boot-starters\azure-mediaservices-spring-boot-starter\target\apidocs/package-list. Ignored it.
each group in application.properties has a role_group attached to it so it can be used in PreAuthorize annotation.
Relates to #132
There is some noise in each starter currently:
properties
(the two maven one can be replaced by java.version
btw)licenses
developers
scm
dependencyManagement
checkstyle
, findbugs
and spring-boot
plugin (As for the latter, we already discussed that it's a duplication since you inherit from Spring Boot's parent).You could have a azure-samples
root directory with all the samples in them. That way they are easier to find and you can move that noise to the parent.
Currently, we introduce WingtiptoysApplication.java and then UserRepository.java and finally User.java. Can we reverse the order of these classes?
When I use DocumentDbRepository.findAll()
method to select all entities, exception occurs:
{"message":"Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to true, specify x-ms-documentdb-partitionkey, or revise your query to avoid this exception."}
As docs says, the CosmosDB saves data and index them with partition keys. And when running query, the REST API requires specific the partition key or enable crosspartitionkey flag. But in the lib, it set the options to null
, make the call failed.
In my thought, there should be two methods:
findAll()
to enable setEnableCrossPartitionQuery(true)
Messages from Spring Data team.
We should also talk about an alignment with Spring Data Kay (the 2.0 branch effectively) as it contains quite a few API changes in the mapping context and repository APIs. Ideally you'd continue to work on the 0.x branch of yours for Boot 1.5 support as 1.5 will live for quite a bit of time due to support guarantees we provide. However, the main development will happen in 2.0 and we should make sure you have a compatible version of that available as well.
travis build
KeyVaultPropertyInitializer
adapts the Environment
so the intend would be more clear if it was implementing EnvironmentPostProcessor
.
There is no starter for the active directory integration. That's fine if you don't but currently the autoconfigure
module brings a bunch of dependencies so it isn't an autoconfigure
module anymore.
spring-web
, spring-security
, jackson
, powermock
(I guess it's missing a test
scope!). The sample brings more dependencies and it isn't clear what's optional and what's required IMOauto configuration optional dependencies - per the guidelines ( https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-auto-configuration.html ) it can be advisable to express dependencies from autoconfig pom as optional. This can allow the autoconfig code to be included on the class path and it will be ‘harmless’ if the dependant jar is not there ( see 44.4.2 in that doc). In your case I see the dependency from the servicebus autoconfig pom onto the azure-servicebus jar as currently non optional.
related to that you don’t necessarily actually need a starter jar if there aren’t lots of other dependencies to include. See section 44.4 of that document. If all your starter pom does is point at the auto configuration jar (servicebus starter pom, for example) then you could choose just to have the auto configure jar. (the servicebus starter does this: https://github.com/Microsoft/azure-spring-boot-starters/blob/master/azure-servicebus-spring-boot-starter/pom.xml ). This is only a suggestion though.
The Spring Data integration for DocumentDB is not tied to the Spring Boot support and should have a different release cycle.
Release should match a Spring Data release train so maintenance branches would have a different lifecycle as well.
I'd argue that the auto-configuration should be kept here, in azure-autoconfigure
if #158 is accepted
azure spring boot starters not available in Spring Initializr as mentioned in readme.md file
It looks like you attempted to do something similar to spring-boot-dependencies
which is the BOM of a "platform" (with stronger semantics). This project is more narrowed and its bom should only expose dependency management for the artifacts that the project produces (so in this case, azure artifacts). It should not have an opinion about third party dependencies (otherwise including that BOM in a project potentially overrides decisions that were made about them)
For versions that match the version of the project (everything in an ideal world except maybe Microsoft-specific jars that the starters require), I'd set them explicitly rather than using ${bom.version}
. If you're including the bom for Azure X.Y.Z, it should be X.Y.Z. and nothing else (Maven does not allow to override that property, which is good so it's not strictly necessary but the intent is more clear if you hardcode the current version).
Here is an example of BOM for reference: http://repo.spring.io/release/org/springframework/spring-framework-bom/4.3.8.RELEASE/spring-framework-bom-4.3.8.RELEASE.pom
I have forked latest master and when attempting to run mvn clean install I get below error. Looks like dependency was not added in parent starter , I tried to fix and publish PR but i couldn't find spring-social-microsoft-graph dependency in maven repository. Hence raising the issue.
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for com.microsoft.azure:spring-social-microsoft-graph:jar is missing. @ com.microsoft.azure:microsoft-graph-spring-boot-autoconfigure:[unknown-version], C:\Users\rajakolli\git\azure-spring-boot-starters\microsoft-graph\microsoft-graph-spring-boot-autoconfigure\pom.xml, line 61, column 21
[ERROR] 'dependencies.dependency.version' for com.microsoft.azure:microsoft-graph-spring-boot-autoconfigure:jar is missing. @ com.microsoft.azure:microsoft-graph-spring-social-starter:[unknown-version], C:\Users\rajakolli\git\azure-spring-boot-starters\microsoft-graph\microsoft-graph-spring-social-starter\pom.xml, line 46, column 21
[ERROR] 'dependencies.dependency.version' for com.microsoft.azure:microsoft-graph-spring-social-starter:jar is missing. @ line 48, column 21
@
[ERROR] The build could not read 3 projects -> [Help 1]
[ERROR]
[ERROR] The project com.microsoft.azure:microsoft-graph-spring-boot-autoconfigure:0.1.4 (C:\Users\rajakolli\git\azure-spring-boot-starters\microsoft-graph\microsoft-graph-spring-boot-autoconfigure\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for com.microsoft.azure:spring-social-microsoft-graph:jar is missing. @ com.microsoft.azure:microsoft-graph-spring-boot-autoconfigure:[unknown-version], C:\Users\rajakolli\git\azure-spring-boot-starters\microsoft-graph\microsoft-graph-spring-boot-autoconfigure\pom.xml, line 61, column 21
[ERROR]
[ERROR] The project com.microsoft.azure:microsoft-graph-spring-social-starter:0.1.4 (C:\Users\rajakolli\git\azure-spring-boot-starters\microsoft-graph\microsoft-graph-spring-social-starter\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for com.microsoft.azure:microsoft-graph-spring-boot-autoconfigure:jar is missing. @ com.microsoft.azure:microsoft-graph-spring-social-starter:[unknown-version], C:\Users\rajakolli\git\azure-spring-boot-starters\microsoft-graph\microsoft-graph-spring-social-starter\pom.xml, line 46, column 21
[ERROR]
[ERROR] The project com.microsoft.azure:microsoft-graph-spring-social-starter-sample:0.0.1-SNAPSHOT (C:\Users\rajakolli\git\azure-spring-boot-starters\microsoft-graph\microsoft-graph-spring-social-starter-sample\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for com.microsoft.azure:microsoft-graph-spring-social-starter:jar is missing. @ line 48, column 21
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
I am using the following code to try pageable:
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@Bean
public CommandLineRunner init(UserRepository repository) {
return (args) -> {
repository.deleteAll();
for (int i = 0; i < 100; i++) {
repository.save(new User(String.valueOf(i), "firstName", "lastName"));
}
System.out.println(repository.findAll(new PageRequest(1, 10)));
};
}
}
Then I get exceptions as java.lang.UnsupportedOperationException: findAll(Pageable pageable) not supported yet.
.
The whole logs are:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.6.RELEASE)
2017-08-02 15:01:55.009 INFO 19780 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication on Zhiyuan-Work with PID 19780 (C:\Users\t-zhzhe\Desktop\demo\target\classes started by t-zhzhe in C:\Users\t-zhzhe\Desktop\demo)
2017-08-02 15:01:55.014 INFO 19780 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default
2017-08-02 15:01:55.152 INFO 19780 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@61009542: startup date [Wed Aug 02 15:01:55 CST 2017]; root of context hierarchy
2017-08-02 15:01:58.834 INFO 19780 --- [ main] c.m.azure.documentdb.DocumentClient : Initializing DocumentClient with serviceEndpoint [https://spring.documents.azure.com:443/], ConnectionPolicy [ConnectionPolicy [requestTimeout=60, mediaRequestTimeout=300, connectionMode=Gateway, mediaReadMode=Buffered, maxPoolSize=100, idleConnectionTimeout=60, userAgentSuffix=;;azure-documentdb-spring-boot-starter/0.1.4;b283874abd22954131daae5647d03ae3395d9f6e753089e4837e80fdbe0c2b92, retryOptions=com.microsoft.azure.documentdb.RetryOptions@5cc69cfe, enableEndpointDiscovery=true, preferredLocations=null]], ConsistencyLevel [Session]
2017-08-02 15:02:00.978 INFO 19780 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2017-08-02 15:02:01.863 INFO 19780 --- [ main] c.m.a.d.internal.ServiceJNIWrapper : Microsoft.Azure.Documents.ServiceInterop.dll exists in working directory.
2017-08-02 15:02:01.863 INFO 19780 --- [ main] c.m.a.d.internal.ServiceJNIWrapper : DocumentDB.Spatial.Sql.dll exists in working directory.
2017-08-02 15:02:01.868 INFO 19780 --- [ main] c.m.a.d.internal.ServiceJNIWrapper : ServiceJNI has loaded.
2017-08-02 15:02:10.069 INFO 19780 --- [ main] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-08-02 15:02:10.082 ERROR 19780 --- [ main] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:735) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:716) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:703) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:304) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at com.example.demo.DemoApplication.main(DemoApplication.java:17) [classes/:na]
Caused by: java.lang.UnsupportedOperationException: findAll(Pageable pageable) not supported yet.
at com.microsoft.azure.spring.data.documentdb.repository.support.SimpleDocumentDbRepository.findAll(SimpleDocumentDbRepository.java:72) ~[spring-data-azure-documentdb-0.1.4.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:504) ~[spring-data-commons-1.13.6.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:489) ~[spring-data-commons-1.13.6.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461) ~[spring-data-commons-1.13.6.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56) ~[spring-data-commons-1.13.6.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57) ~[spring-data-commons-1.13.6.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at com.sun.proxy.$Proxy47.findAll(Unknown Source) ~[na:na]
at com.example.demo.DemoApplication.lambda$init$0(DemoApplication.java:28) [classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:732) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
... 6 common frames omitted
2017-08-02 15:02:10.083 INFO 19780 --- [ main] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@61009542: startup date [Wed Aug 02 15:01:55 CST 2017]; root of context hierarchy
2017-08-02 15:02:10.086 INFO 19780 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
Relates to #128
The essence of the bom is to provide dependency management for "your own modules". Strictly speaking, the starters and artifacts that are managed here. However, it is clear you have the authority of having an opinion about Azure related jars as well (since that decision doesn't exist elsewhere).
I think it would help users if artifacts such as adal4j
, azure-keyvault
, azure-storage
, azure-media
, azure-servicebus
were added. To some extend I'd assume that dependency management for spring-social-microsoft-graph
and spring-data-azure-document-db
.
If this is accepted, the artifactId of the boml has to change as azure-spring-boot-starters-bom
does not reflect the goal anymore. Spring should definitely be there as the bom provides dependency management for the Spring Support. Perhaps something like azure-spring-boot-bom
would be better?
If we extend that though a bit, this repository could become the place for Spring Boot support for Azure. Maybe azure-spring-boot
would therefore a better name for this repository?
We can create custom functions in Spring Data's Repository e.g. List<User> findUserByFirstName(String firstName)
, which is a key feature of Spring Data. Can we implement such feature in our DocumentDB starter?
This isn't related to spring boot per se so IMO it shouldn't be here.
findOne
should return null
when no document is found with the given id
. https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/repository/CrudRepository.html#findOne-ID-
Instead it is throwing an exception:
java.lang.RuntimeException: findById exception
at com.microsoft.azure.spring.data.documentdb.core.DocumentDbTemplate.findById(DocumentDbTemplate.java:117)
at com.microsoft.azure.spring.data.documentdb.repository.support.SimpleDocumentDbRepository.findOne(SimpleDocumentDbRepository.java:64)
⋮
Caused by: com.microsoft.azure.documentdb.DocumentClientException: Message: {"Errors":["Resource Not Found"]}
The keyvault Spring Boot integration defines a number of properties but they have no metadata so no IDE inspection. I see why you don't have a @ConfigurationProperties
object for this feature (since adding the KeyVaultPropertySource
to the Environment
is happening very early) but you can write manual meta-data for those.
It would be better if GitHub labels are assigned to each Issue and pull request so that it will be easier to filter
support batch operation
When I try to create a new Document DB, it couldn't be found when searching in Azure Portal.
You should tell user the relationship of Cosmos DB and Document DB.
Provide option to set azure-storage version in POM.xml like how in spring boot we can override the default version
example if i want to use storage version 5.3.1 instead of 5.3.0
I am expecting something like below in properties tag
5.3.1
The package spring-data-azure-documentdb
is specified for non-spring-boot users, so we'd better make their dependency tree clean.
The current name doesn't feel right (it doesn't matter how the entry is going the be named ultimately).
I thought we'd agree on moving all the code in that module. Again, please do not design the module based on the entries on start.spring.io as it is totally unrelated IMO.
All the code should move there and the starters should have no code.
Also, I'd change the spring.boot.autoconfigure
package to spring.autoconfigure
e:\javasrc\azure-spring-boot-starters\azure-documentdb-spring-boot-starter-sample>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Azure Document DB Spring Boot Starter Sample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ azure-documentdb-spring-boot-starter-sample ---
[INFO] Deleting e:\javasrc\azure-spring-boot-starters\azure-documentdb-spring-boot-starter-sample\target
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (validate) @ azure-documentdb-spring-boot-starter-sample ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.263 s
[INFO] Finished at: 2017-07-24T18:16:58+08:00
[INFO] Final Memory: 20M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (validate) on project azure-documentdb-spring-boot-starter-sample: Failed during checkstyle configuration: cannot initialize module Header - Unable to find: config/java.header -> [Help 1]
Most API changes should relate to Spring Data Starter.
The spring AppContext fails to initialize when configured for a subscription client using an access key that does not have Send access on the topic.
With the change to the TopicClient
from @Scope("prototype")
, the TopicClient
is eagerly created, even if it is not autowired in to any beans. As such, a MessageSender
is created to support the TopicClient
, which results in
AuthorizationFailedException: Unauthorized access. 'Send' claim(s) are required to perform this operation.
We're having to stick with 0.1.5
until this is resolved.
According to the best practices document: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-performance-improvements#reusing-factories-and-clients it states that QueueClient (and I'm assuming TopicClient and SubscriptionClient) are thread safe.
I understand that this may just be referring to the .NET SDK.
If this also applies to the Java SDK, then the beans in ServiceBusAutoConfig can be scoped as singleton instead of prototype.
Seems the DocumentDbRepositoryFactoryBean needs a default constructor, I am trying to use in a good old spring project (4.3.10.RELEASE) I get:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.microsoft.azure.spring.data.documentdb.repository.support.DocumentDbRepositoryFactoryBean]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.microsoft.azure.spring.data.documentdb.repository.support.DocumentDbRepositoryFactoryBean.()
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1147)
... 65 more
Caused by: java.lang.NoSuchMethodException: com.microsoft.azure.spring.data.documentdb.repository.support.DocumentDbRepositoryFactoryBean.()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
... 66 more
Before adding the DocumentDb starter dependency, you should remind user to start with a spring boot project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.