Spring Boot Data Mongo Native TimeSeries Collections - spring

I'm looking at the latest spring data documentation for mongo and it states:
Create a Time Series Collection derived from an Annotation
#TimeSeries(collection="weather", timeField = "timestamp")
public class Measurement {
String id;
Instant timestamp;
// ...
}
template.createCollection(Measurement.class);
However, I don't see #TimeSeries in any of the spring annotations. What dependency are they using here? I'm using spring boot framework, is it possible they updated spring data but not spring boot data?

What worked is to mimic the instructions on the springframework documentation with the latest snapshots of the spring boot packages.
Add the snapshots repositories to any pom that references the snapshot versions.
...
<repositories>
<repository>
<id>spring-snapshots</id>
<url>https://repo.spring.io/snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>https://repo.spring.io/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
Set the spring boot version, currently:
<spring.boot.version>2.6.0-SNAPSHOT</spring.boot.version>
Set the spring boot starter data mongodb version, currently:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>2.5.3</version>
</dependency>
Edit - if you're using Spring Cloud, your application will throw compatibility errors between the SNAPSHOT and Spring Cloud at run time unless you update your yaml config files with the following:
spring:
cloud:
compatibility-verifier:
enabled: false

Related

Vaadin 23 + spring-boot 3.0.2 application not launching

We have a vaadin application on version 23 which was using spring-boot version 2.7.3.
We have some old library high vulnerabilities reported by static scan. so to fix that we tried to use the spring-boot version 3.0.2 with the same application. the application build successfully and also it shows that the application started on port xxxx but the application is not launching and also there are no errors on the console. It just shows the following message:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Feb 02 16:32:45 CET 2023
There was an unexpected error (type=Not Found, status=404).
No message available
Is it possible to use spring-boot 3.0.2 with vaadin 23?
the application should be accessible on localhost.
You cannot use Vaadin 23 with Spring Boot 3.
Spring Boot 3 support comes with Vaadin 24. The most recent version is 24.0.0.alpha9.
Make sure you add the pre-release repositories:
<repositories>
<!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
<!-- Main Maven repository -->
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-prereleases</id>
<url>
https://maven.vaadin.com/vaadin-prereleases/
</url>
</repository>
<!-- Repository used by many Vaadin add-ons -->
<repository>
<id>Vaadin Directory</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>
https://maven.vaadin.com/vaadin-prereleases/
</url>
</pluginRepository>
</pluginRepositories>

Spring Data MongoDB v3.x

The documentation has details of migration from 2.x to 3.x https://docs.spring.io/spring-data/mongodb/docs/current-SNAPSHOT/reference/html/#upgrading.2-3
However, i cannot find the 3.x maven dependency https://mvnrepository.com/artifact/org.springframework.data/spring-data-mongodb
The latest available is only 2.2.6.RELEASE
Is 3.x not available as of now?
The Spring Data Neumann Release is not GA yet. Please have a look at the wiki for more information on the planned timeline.
Release candidates and snapshot builds are available via repo.spring.io.
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>spring-milestones</id>
<name>libs-milestone</name>
<url>https://repo.spring.io/libs-milestone</url>
</repository>
<repository>
<snapshots />
<id>spring-snapshots</id>
<name>libs-snapshot</name>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>

spring data lovelace m3 and spring boot 2.0

I am using spring boot 2.0.5-RELEASE, and trying to use spring data Lovelace-M3 for it's MongoDB transaction support with MongoTransactionManager class, i added the lovelace-m3 dependency with release train repository as follow :
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Lovelace-M3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-libs-release</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
But maven doesn't download the jar of lovealace, only the pom, can't find anywhere lovelace classes. I don't know what i am missing here.
Milestone version does not publish on https://repo.spring.io/libs-release.
Please add the following code into your ...
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Also, if you need to use milestones plugin, you can add the following code:
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Spring boot 2.0 does not support Spring data lovelace, if someone want to enjoy MongoDB 4 Transaction feature he needs to wait for Spring boot 2.1 unfortunately.
See : https://github.com/spring-projects/spring-boot/issues/14644

how to access kafka with acl in my storm jar?

Before I use kafka with no any SASL or ACL,it works fine, now i built SASL_PLAINTEXT for my kafka cluster,how to access my kafka cluster in my storm jar?
My storm version:1.1.0
Kafka version:0.10.1
I use HDP-2.6.3.0-235
any suggestions would be helpful.thanks
These are the steps I followed to get storm running with kafka in a secured environment
1.You need to use hdp specific dependencies for storm to enable the security protocol property
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>hortonworks.extrepo</id>
<name>Hortonworks HDP</name>
<url>http://repo.hortonworks.com/content/repositories/releases</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>hortonworks.other</id>
<name>Hortonworks Other Dependencies</name>
<url>http://repo.hortonworks.com/content/groups/public</url>
</repository>
</repositories>
and then include the hdp specific dependency for storm[change it as per your hdp version]
<storm-core.version>1.1.0.2.6.2.37-3</storm-core.version>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>${storm-core.version}</version>
<scope>provided</scope>
</dependency>
2.Now you need use the security protocol property while creating spouts(it will not be availaible unless using hdp specific repo)
spoutCfg.securityProtocol = "SASL_PLAINTEXT";
3.Use acl command on your topic by giving the appropriate storm user
bin/kafka-acls.sh --authorizer-properties zookeeper.connect=localhost:2181 --add --allow-principal User:storm-user --allow-principal User:zriskcanvas --consumer --producer --group=* --topic testTopic
4.Make sure the storm jaas-conf is getting passed to each node with the user mentioned in ACL

Spring SAML2 Sample Compilation Errors

I have downloaded Spring SAML2 core and sample projects. When trying to compile the sample project in eclipse, it shows errors.
For example, in the class org.springframework.security.saml.web.MetadataController there are references to MetadataGenerator.setEntityAlias(..) that do not resolve.
I checked the source code of MetadataGenerator in SAML2 Core project and there is no such method.
What am I missing?
It worked for me with 1.0.0.RC2 and not later versions.
Pointing to the following repository:
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>

Resources