spring-cloud | Spring Cloud Microservices - Full Stack Technology | Application Framework library
kandi X-RAY | spring-cloud Summary
kandi X-RAY | spring-cloud Summary
"Spring Cloud Microservices - Full Stack Technology and Case Analysis" and "Spring Cloud Microservices Getting Started and Advanced" supporting source code
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Check if rate limit is allowed
- Extract a set of all the placeholder keys from a property string .
- Update and calculate the config changes .
- Fallback response .
- Do a scan for classes .
- Send a text message
- Sets the default limits .
- Get the thread pool .
- Do process process .
- This method is called when the join method is invoked .
spring-cloud Key Features
spring-cloud Examples and Code Snippets
Community Discussions
Trending Discussions on spring-cloud
QUESTION
Latest Update (with an image to hope simplify the problem) (thanks for feedback from @Mahmoud)
Relate issue reports for other reference (after this original post created, it seem someone filed issues for Spring Cloud on similar issue, so also update there too):
https://github.com/spring-cloud/spring-cloud-task/issues/793 relate to approach #1
https://github.com/spring-cloud/spring-cloud-task/issues/792 relate to approach #2
Also find a workaround resolution for that issue and update on that github issue, will update this once it is confirmed good by developer https://github.com/spring-cloud/spring-cloud-task/issues/793#issuecomment-894617929
I am developing an application involved multi-steps using spring batch job but hit some roadblock. Did try to research doc and different attempts, but no success. So thought to check if community can shed light
Spring batch job 1 (received job parameter for setting for step 1/setting for step 2)
...ANSWER
Answered 2021-Aug-15 at 13:33
- Is above even possible setup?
yes, nothing prevents you from having two partitioned steps in a single Spring Batch job.
- Is it possible to use JobScope/StepScope to pass info to the partitionhandler
yes, it is possible for the partition handler to be declared as a job/step scoped bean if it needs the late-binding feature to be configured.
Updated on 08/14/2021 by @DanilKo
The original answer is correct in high - level. However, to actually achieve the partition handeler to be step scoped, a code modification is required
Below is the analyze + my proposed workaround/fix (maybe eventually code maintainer will have better way to make it work, but so far below fix is working for me)
Issue being continued to discuss at: https://github.com/spring-cloud/spring-cloud-task/issues/793 (multiple partitioner handler discussion) https://github.com/spring-cloud/spring-cloud-task/issues/792 (which this fix is based up to use partitionerhandler at step scope to configure different worker steps + resources + max worker)
Root cause analyze (hypothesis)The problem is DeployerPartitionHandler utilize annoation @BeforeTask to force task to pass in TaskExecution object as part of Task setup
But as this partionerHandler is now at @StepScope (instead of directly at @Bean level with @Enable Task) or there are two partitionHandler, that setup is no longer triggered, as @EnableTask
seem not able to locate one partitionhandler
during creation.
Resulted created DeployerHandler faced a null with taskExecution
when trying to launch (as it is never setup)
Below is essentially a workaround to use the current job execution id to retrieve the associated task execution id From there, got that task execution and passed to deploy handler to fulfill its need of taskExecution reference It seem to work, but still not clear if there is other side effect (so far during test not found any)
Full code can be found in https://github.com/danilko/spring-batch-remote-k8s-paritition-example/tree/attempt_2_partitionhandler_with_stepscope_workaround_resolution
In the partitionHandler method
QUESTION
This is regarding a Spring Cloud Config Server hobby project (with @EnableConfigServer
).
Yesterday, the application could be started.
Today, the application failed to start because of a Git communication error.
From GitHub's official blog post, it is mentioned that SHA-1 is no longer supported starting from 15 March 2022. And that explains the results I'm getting these 2 days.
March 15, 2022
Changes made permanent.
We’ll permanently stop accepting DSA keys. RSA keys uploaded after the cut-off point above will work only with SHA-2 signatures (but again, RSA keys uploaded before this date will continue to work with SHA-1). The deprecated MACs, ciphers, and unencrypted Git protocol will be permanently disabled.
Even if I didn't delete the existing SSH key, it still failed to start today. But anyway, now the only key under the "Deploy keys" section of the repository settings is an SSH key that was added after the March 15, 2022 cut off date.
Dependency versionsDependency Management:
Dependency Version spring-cloud-dependencies Hoxton.SR12Dependency:
Dependency Version spring-cloud-config-server (Managed) Spring application configurationsapplication.yml
:
ANSWER
Answered 2022-Mar-16 at 14:07I have a same problem.
See https://github.com/spring-cloud/spring-cloud-config/issues/2061
For right now, I have a dirty workaround: use https uri, username and password(maybe personal secret token).
QUESTION
I got this below error when run the API-GATEWAY, I tried so many ways but I couldn't solve this issue.
Description:
Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.
Action:
Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
Main Class
...ANSWER
Answered 2021-Aug-01 at 06:17Please note that Spring Cloud Gateway is not compatible with Spring MVC (spring-boot-starter-web
). This is outlined in section "How to include Spring Cloud Gateway in the official reference documentation":
Spring Cloud Gateway is built on Spring Boot 2.x, Spring WebFlux, and Project Reactor. As a consequence, many of the familiar synchronous libraries (Spring Data and Spring Security, for example) and patterns you know may not apply when you use Spring Cloud Gateway.
Additionally, it is stated that:
Spring Cloud Gateway requires the Netty runtime provided by Spring Boot and Spring Webflux. It does not work in a traditional Servlet Container or when built as a WAR.
As already suggested by the error message, you would need to remove the dependency on spring-boot-starter-web
. You can list all your direct and transitive dependencies with the following command:
QUESTION
I wan to implement a Junit 5 test into Gradle project. I tried this:
Gradle configuration:
...ANSWER
Answered 2021-Dec-22 at 21:35GeneratePdf
does not match the default name pattern for test classes. The default pattern is Test*|*Test|*Tests
.
You can change it in your Gradle file with
QUESTION
I am trying to compile an existing Spring Boot project using JDK 17 and Maven 3.8.4 and I keep getting this error.
Unable to make field private com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs accessible: module jdk.compiler does not "opens com.sun.tools.javac.processing" to unnamed module @521e3470
The problem also occurs with older versions of Maven like 3.6. It also happens with JDK 16. It does not matter what version of Java is configured in the pom.xml via the java.version
, maven.compiler.source
, and maven.compiler.target
. only the JDK version being used to do the compiling... displayed in the mvn -v
command.
The project compiles fine using JDK 15. The error happens immediately when compiling starts, right after the INFO message stating how many classes are being compiled. Happens in both my Windows laptop and Ubuntu CI server.
Any ideas what this could be?
EDIT: adding more of the POM file.
...ANSWER
Answered 2021-Nov-23 at 13:39The problem is the usage of lombok project which in this case being used not the most recent version.
QUESTION
I have a React application based on Typescript which is hosted on my PC. I use Spring gateway to forward requests to another microservice. GET requests are working fine but for POST requests I get:
Access to XMLHttpRequest at 'http://1.1.1.1:8080/api/support/tickets/create' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I'm hitting this Spring Cloud Gateway issue: https://github.com/spring-cloud/spring-cloud-gateway/issues/229
Spring cloud configuration:
...ANSWER
Answered 2022-Jan-31 at 06:44It seems that your issue is about local development only.
Create react app solves precisely this by supporting the dev server to serve as a proxy to your API endpoint.
Just add the API domain in the proxy
key in package.json. More on this here
For production you should either host them both under the same domain (using a reverse proxy to route static content vs api request based on the URL path), or find a permanent cors friendly solution on your backend.
Cors is a browser feature and cannot be disabled. Though, when not using the POST method you can get around the preflight but you still can't access the response body without the proper headers set
QUESTION
I have Spring Gateway application with the following Gradle dependencies:
...ANSWER
Answered 2022-Jan-20 at 11:40Is it possible to use Spring Authorization server without exposing it to outside?
The Spring Authorization Server is implementing the OAuth2 protocol. If we look at the specs, we can see that it's naturally a client, which wants to authenticate itself: https://datatracker.ietf.org/doc/html/rfc6749#section-1.2. In your setup, it seems like that client is not the gateway itself, but lets say an app. So if that app should use the Spring Authorization Server, it would authenticate with it (most of the time, that means acquiring a token), before the first interaction with the gateway happens. So to answer that question, if you want to use OAuth2 as it was meant to be used, you would need a direct connection between the app and the Spring Authorization Server, which means, it needs to be exposed to the outside. This makes perfect sense, since OAuth2 is meant to be used not with a single service, but with lots of different services, e.g. to allow single-sign-on.
What is the proper way to implement this?
You could setup your own Spring Authorization Server, implement your custom Authorization Code Grant logic, so that a client can authenticate itself and acquire a token. This could for example be a JSON Web Token (JWT). This can (should) be independent from your gateway and other services.
To authorize requests at the gateway, there are different ways. You could implement a logic yourself, which reads a JWT from the request and authorize it with the Spring Authorization Server or another identity provider, which you might have. You can also use Spring Cloud Security with the Spring Authorization Server, which is described here: https://spring.io/blog/2019/08/16/securing-services-with-spring-cloud-gateway. This is definitely a proper way to implement it.
One more thing: as you can see, OAuth2 comes with a price, being that it is not trivial to understand and configure. You must understand it in detail, before you deploy such a setup. On the other hand, its a solid standard and you can have feature like single-sign-on out of the box. So if you only need authorization for single or multiple apps to a single service, there are probably easier ways to gain a token and secure an app and OAuth2 is maybe overkill. But OAuth2 really pays off, if you have lots of services and lots of apps which should be authenticated with a central (sometimes company-wide) solution.
QUESTION
I am following this article ,for submit a job to an existing Dataproc cluster via a Dataproc API
For the following line of code :
...ANSWER
Answered 2022-Jan-14 at 19:22The method com.google.api.gax.core.GoogleCredentialsProvider$Builder com.google.api.gax.core.GoogleCredentialsProvider$Builder.setUseJwtAccessWithScope(boolean)
was introduced in com.google.api:gax
in version 2.3.0.
Can you
run
mvn dependency:tree
and confirm that your version ofcom.google.api:gax
is above version 2.3.0?upgrade all Google libraries to the latest version?
Here is a similar issue found on the internet.
QUESTION
I have small project in spring boot with oauth2, i want to run resource server
settings:
- Java 17
- spring-boot-starter-parent version 2.5.6
- spring-cloud-dependencies version 2020.0.4
- spring-boot-starter-oauth2-resource-server
- spring-security-oauth2-autoconfigure
When i want to run my app i have exception:
...ANSWER
Answered 2021-Dec-31 at 03:05consider add xml lib in dependency, as:
QUESTION
I have s SpringBoot app. with this dependencies:
...ANSWER
Answered 2021-Dec-23 at 23:57Based on the error message, remove the JavaMailSender
constructor argument in the NotificationService
constructor (assuming you are not using that in the NotificationService
).
In case you wanted to use the JavaMailSender
in the NotificationService
, you would need to create a Bean
of type JavaMailSender
which can be injected in the NotificationService
. For AWS-SES, you can do so by defining the following bean in your configuration.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spring-cloud
You can use spring-cloud like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-cloud component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page