Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:09
    khalilovF1994 commented #13165
  • 06:57
    spring-projects-issues labeled #33498
  • 06:55
    RaviTeja51 opened #33498
  • 03:22
    kse-music commented #33491
  • 02:34
    wangliang181230 commented #33491
  • 02:21
    wangliang181230 commented #33491
  • Dec 08 23:53
    mxsb commented #33493
  • Dec 08 23:49
    mxsb ready_for_review #33493
  • Dec 08 23:48
    mxsb synchronize #33493
  • Dec 08 23:02
    scottfrederick commented #33459
  • Dec 08 22:49
    welsh commented #33459
  • Dec 08 22:45
    scottfrederick commented #33493
  • Dec 08 21:42
    pascalgosselin commented #33496
  • Dec 08 21:33
    scottfrederick closed #33496
  • Dec 08 21:33
    scottfrederick commented #33496
  • Dec 08 21:32
    scottfrederick labeled #33496
  • Dec 08 21:32
    scottfrederick unlabeled #33496
  • Dec 08 21:31
    mxsb converted_to_draft #33493
  • Dec 08 21:22
    pascalgosselin closed #33496
  • Dec 08 21:22
    pascalgosselin commented #33496
Brian Clozel
@bclozel
@miller79 GraalVM is super nice, but it's really a different problem space. Profiling what's happening for your app at startup time might uncover the issue. Do you have logs, profiling data that we could take a look at?
Anthony Lofton
@miller79
@bclozel I can grab some of our tests, but specifically the issue is based on the CPU allocated to the startup of the application. There was a specific amount we could allocate that would allow the application to boot in 1-2 seconds. But once we hit that threshold, it would increase significantly (up to 120 seconds). The application we were testing with specifically was a basic Spring Boot application through start.spring.io with just Spring Web. We ran a docker image of it with a setting similar to this: docker run --cpus=".4" spring_min:latest and it showed similar startup times locally. I'll post more information about our tests when I can get the latest copy of it.
Anthony Lofton
@miller79
@bclozel I have checked in a benchmark application to directly show the performance we are seeing here: https://github.com/miller79/spring-boot-benchmark I have ran on my box with .4 CPU and seeing 30 seconds plus start up time. This is as bare of an application I could create but would like some feedback on if there are any other enhancements we can do to increase performance. My current CPU is an i7-7600U @ 2.8GHz with 16 GB of ram.
Anthony Lofton
@miller79
I don't have the benchmark code from these tests we have done here but here is some comparisons someone has done in our Org comparing with other frameworks with relatively small amount of code: https://github.com/miller79/spring-boot-benchmark/blob/master/various-framework-benchmark.md
Rüdiger zu Dohna
@t1
I'm evaluating RFC-7807 Problem Details to return a standardized http body to describe the exact reason for an error code.
I wrote a very basic PoC implementation also for Spring Boot: https://github.com/t1/problem-details
I've already commented on a related issue: spring-projects/spring-boot#19525
What do you all think of this? Is it worth investigating further? Error handling is nothing fancy, but I think it deserves more love :-)
Heaven31415
@Heaven31415
Hello.
gintautassulskus-elsevier
@gintautassulskus-elsevier
hi all, do you know what happened to ConfluentSchemaRegistryClient which is part of spring-cloud Finchley but no longer in Hoxton?
looks like the spring-cloud-stream-schema dependency is gone
Stefano De Angelis
@deanstef
Hi guys! I need help for my spring boot application. I am working on a backend REST API server. This server exposes a number of resources that must be protected with authentication and authorization rules. The API will be consumed by mobile applications who offer Social Login (Facebook, google) and username and password login. How should I handle this problem authenticating users? I have already used JWT authentication which is fine. But now I need to work with different tokens (coming from Facebook and Google) and I have no idea how to manage them. I read something about OAUTH2 but it is very confusing too me. Thank you in advance !
Konstantin Bläsi
@konstantinblaesi
@deanstef maybe get to know oauth2 first https://www.youtube.com/watch?v=996OiexHze0
looks like they also have another video targeted at spring + oauth2 , not sure how good that one is :) https://www.youtube.com/watch?v=TaZqDrwBWwA
Stefano De Angelis
@deanstef
@konstantinblaesi thank you! I already know quite well, at least theoretical, how OAUTH2 works. My problem is the integration with spring. Particularly how to manage external OAuth2 providers as Google or Facebook. I am looking for standard solutions/best practices
boda2004
@boda2004
Stefano De Angelis
@deanstef
@boda2004 as far as I can see this is just for Stateful services, am I right?
boda2004
@boda2004
@deanstef i tend to think that session or state is not required, but would have to take a look at sources. OTOH https://docs.spring.io/spring-security-oauth2-boot/docs/current/reference/html/boot-features-security-oauth2-resource-server.html does not imply any state, bearer token would be fine, so unless you want to use refresh tokens you should be fine
Alphalatot
@Alphalatot
hello guys, i am learning spring webflux and i have problem on custom Constraint Validator
image.png
i am wondering if that is a good practice ?
image.png
my goal is to throw group of errors
image.png
Stefano De Angelis
@deanstef
@boda2004 I hope the configuration of a ResourceServer is enough but I am afraid for single Authorisation Providers like Google or Facebook it requires more configuration. However I will try to follow the spring documentation
hyginous29
@hyginous29

Hi Team

I am getting error for , this example is from the Spring boot docs. any help appreciated

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'local.server.port' in value "${local.server.port}"
    at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:178) ~[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE]
    at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124) ~[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE]
    at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:236) ~[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE]
    at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE]
    at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]"

Test

@SpringBootTest(classes = { TestApplication.class}, webEnvironment = RANDOM_PORT)
public class ELFSpringWebAutoConfigurationTest {

    @LocalServerPort
    int port;

    @Autowired
    TestRestTemplate restTemplate;

    @Test
    void testRestCall() {
        assertThat(this.restTemplate.getForObject("http://localhost:" + port + "/",
                String.class)).contains("Hello, World");
    }

}
boda2004
@boda2004
@hyginous29 see https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/web/server/LocalServerPort.html
effectively you have @Value(value="${local.server.port}") int port;
so you have to define it somehow
ah, my bad, missed webEnvironment = RANDOM_PORT. disregard my comment
hyginous29
@hyginous29
yeah, its RANDOM_PORT
hyginous29
@hyginous29
Ignore, it works .. i had TestApplication class which SpringBootApplication, which was in src/test. once i moved to src/main , it works.
marios sofocleous
@sofocleous2_twitter
Hi team ! any idea how to implementa "store and forward" pattern in spring boot to store request and retry?
@bclozel Hi Brian, do u have any idea how to implement "store and forward" pattern in Spring boot to store request and retry?
Brian Clozel
@bclozel
@sofocleous2_twitter like a proxy?
marios sofocleous
@sofocleous2_twitter
This is a reusable component(lib) which will be included in various microservices to take care of rest requests (webclient) that fail either in upstream or downstream service by storing the request and forwarding once services are available.Initially I was thinking about using resilient operator in webclient(retry) but we are missing the case that upstream fails , so we need to store the request and use callbacks but not sure how to implement this efficiently
@bclozel This is a reusable component(lib) which will be included in various microservices to take care of rest requests (webclient) that fail either in upstream or downstream service by storing the request and forwarding once services are available.Initially I was thinking about using resilient operator in webclient(retry) but we are missing the case that upstream fails , so we need to store the request and use callbacks but not sure how to implement this efficiently
Brian Clozel
@bclozel
if upstream fails, retry should still work; it's up to the client to define what failure means
if it's a shared concern amongst services, maybe spring cloud gateway is a better fit here
marios sofocleous
@sofocleous2_twitter
But how come the retry works if the upstream fails ? could u please elaborate on that?
we already an API gateway so I dont think spring cloud gateway would be an option.
*got
If retry still works on failure (upstream) that would be nice but I dont understand how it works..
Brian Clozel
@bclozel
what's a failure in your case? the server is missing? or responds with a HTTP 500 status?
if this is a common use case, maybe your API gateway can handle retries?
marios sofocleous
@sofocleous2_twitter
a failure would be either a response with HTTP 500 status of a failure of upstream(caller) server itself. The requirement to create a shared lib that will be included in different microservices to take care the above. So I dont understand how retry would be possible if caller fails without persisting the request somehow..
*or
a response with HTTP 500 status OR a failure of upstream(caller) server itself.
Brian Clozel
@bclozel
retry resubscribes to the publisher, which means the request is re-created and sent again, it's not stored
marios sofocleous
@sofocleous2_twitter
But what happens if the caller (upstream) is down due to failure ? the is lost right?
Brian Clozel
@bclozel
what do you mean by caller? the client sending a request to your app (and your app is itself sending a request to another service?)
marios sofocleous
@sofocleous2_twitter
By caller i mean another microservice. This is a communication between microservices
Brian Clozel
@bclozel
so a service calling your app?