Spring Initializer - Zipkin Server missing? - spring-boot

Can't see Zipkin Server when using Spring Initializer . Has it been removed? What is the alternative?

Zipkin Server is not part of Spring initializers. You have to use the official release of the Zipkin server
https://github.com/openzipkin/zipkin#quick-start
And custom servers are not supported anymore meaning you can't use #EnableZipkinServer anymore since 2.7
https://github.com/openzipkin/zipkin#quick-start

Lately I have been trying the same and couldn't find that option in initializer. I am just posting this if anyone encounters the same issues and lands on this page. You can refer below sample GitHub project which is consists of four micro services ( zipkin server, client, rest service, and Eureka ) using Edgware release with latest version of sleuth.
Sample Zipkin Server/Client

Create spring starter project and add the below dependencies manually.
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-server</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
<version>2.12.0</version>
</dependency>

Related

What is the web dependency in the Kotlin Spring Boot tutorial?

In the Kotlin Spring Boot tutorial it asks you to include the web dependency, like this:
but in the actual Spring Boot initializr, I don't see that:
What's the web dependency that's required? Is it Spring Web Starter? Is this tutorial out of date and/or obsolete?
spring web starter is the one you need to select it's what they refer to in the tutorial.
its the full name for it.
if you look in the tutorial they later show the pom.xml There you can see that they have declared the:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
and the tuturial still seems okey so go for it.

Integration of Resilience 4j and Prometheus

How to integrate Resilience-4J and Prometheus with micro-services.
I have integrated Micro-services with resilience 4j and also with Prometheus .
My problem is ,in Prometheus i am not getting any resilience query,only HTTP and other which comes default are populating .
Kindly help
Steps that i have implemented so far are listed below...
1>created micro-services
2>Integrate micro-services with Resilience 4j by following steps
i>dependency in pom.xml file
ii>created separate class of Circuit-breaker and retry module.
iii>After that i have added Prometheus by adding its jar
which is...
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
3>In Prometheus Dashboard resilience queries/matrices are not populating.
i.e # HELP resilience4j_circuit-breaker_calls Circuit Breaker Call Stats
# TYPE resilience4j_circuit-breaker_calls gauge
resilience4j_circuit-breaker_calls{name="backendB",call_result="successful",} 0.0
resilience4j_circuit-breaker_calls{name="backendB",call_result="failed",} 0.0
Kindly help.
Thanks in Advance
i have also added below dependencies for resilience 4j and Prometheus integration...
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-metrics</artifactId>
<version>0.16.0</version>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-prometheus</artifactId>
<version>0.16.0</version>
</dependency>
want resilience matrices on Prometheus dashboard.
Do you use a Framework like Spring Boot 1 or Spring Boot 2?
If that's the case you can have a look at our demo which also includes a Grafana Dashboard for Prometheus.
https://github.com/resilience4j/resilience4j-spring-boot2-demo
If you want to use Micrometer you should not add resilience4j-prometheus or resilience4j-metrics. resilience4j-prometheus uses the Prometheus Java library and resilience4j-metrics uses Dropwizard Metrics.
You should add resilience4j-micrometer instead. But it's not necessary if you use our Spring Boot 2 starter.

Spring Boot 2 and ResourceServerProperties

We have Spring Boot Application(version 1.5.8). We tried to check if it's compatible with upcoming Spring Boot 2 release (currently it's M5).
And two classes are missing in spring-boot-autoconfigure dependency(UserInfoTokenServices and ResourceServerProperties).
Are there any replacements of them?
Thanks
Try it this. it's helped me with Oauth2 after migration to SpringBoot 2.
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
Quoting Spring Boot 2.0.0.M5 release notes
Functionality from the Spring Security OAuth project is being migrated
to core Spring Security. OAuth 2.0 client support has already been
added and additional features will be migrated in due course.
If you depend on Spring Security OAuth features that have not yet been
migrated you will need to add
org.springframework.security.oauth:spring-security-oauth2 and
configure things manually. If you only need OAuth 2.0 client support
you can use the auto-configuration provided by Spring Boot 2.0. We’re
also continuing to support Spring Boot 1.5 so older applications can
continue to use that until an upgrade path is provided.
I think you have to define oauth2 dep, like
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-security</artifactId>
</dependency>

spring actuator for standalone spring boot application

we have standalone spring boot application which triggers some quartz jobs based on triggers. it is standalone jar file , no application server involved.
i am planning to add Spring actuator to it. is it possible to add actuator to spring boot application which is not running on any application server.
i did search in google and spring.io website but haven't found any relevant info. if i can add can someone help me how to do it or any link for documentation.
Thanks
Try adding the spring-boot-starter-web dependency to your pom.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
I had the same issue and this resolved it for me.

Spring Boot Deployment Strategy

Am implementing the swagger 2 using Spring Boot. Using Dependencies-
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.4.0</version>
</dependency>
It works good. But want to implement swagger in such a way that in production
swagger does not get deployed. Also will it be possible to host the swagger build differently than the application build on different host machines?
There are two approaches to do this.
Maven profile
By intrudue a maven profile like 'swagger' and add the springfox-swagger-ui related depdencenty to this maven profile. As maybe you need to use some swagger annotations in the java code, so it cannot eliminate the springfox-swagger2 dependency.
Spring profile( should be more better than option 1 )
For a standard spring-boot swagger2 config class, for example you can add the #Profile("swagger") annoation to enable the swagger2 integration only when add the spring.profiles.active=swagger in app running.
For the different host machines, I has no idea about that, but as my understanding, swagger will select all the spring boot endpoints so suppose you cannot leave them alone. But there is a library which can provides a way to publish springfox-swagger2 on spring boot actuator. so you can add management.port=8181 property in application.properties to makes spring-boot-actuator run on another TCP port.

Resources