Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:10
    spring-projects-issues labeled #32527
  • 13:07
    jGleitz opened #32527
  • 12:52
    spyro2000 commented #15397
  • 09:57
    atkawa7 commented #2001
  • 09:26

    snicoll on spring-framework-next

    Start building against Spring F… Adapt to Spring AOT changes Adapt build dependencies to htt… and 4 more (compare)

  • 09:16
    atkawa7 commented #7653
  • 07:07
    chadlwilson commented #32386
  • 06:35
    spring-projects-issues labeled #32526
  • 06:30
    dreis2211 opened #32526
  • 06:01
    snicoll commented #13113
  • Sep 27 20:46

    bclozel on main

    Polish See gh-32484 (compare)

  • Sep 27 20:41
    bclozel commented #32484
  • Sep 27 20:30
    bclozel closed #32484
  • Sep 27 20:30

    bclozel on main

    Auto-configure Observation supp… (compare)

  • Sep 27 19:55
    xenoterracide commented #13113
  • Sep 27 19:54
    xenoterracide commented #13113
  • Sep 27 17:22
    wilkinsona labeled #32525
  • Sep 27 17:22
    wilkinsona unlabeled #32525
  • Sep 27 17:22
    wilkinsona closed #32525
  • Sep 27 17:22
    wilkinsona commented #32525
praveenambati1233
@praveenambati1233
Gg
Asgar Javadov
@asgarj
@wilkinsona There's one nuance with management.endpoints.web.exposure.include is that it takes a comma-separated list. So in this case, if you add a new property source for each endpoint (in my case they are in different modules and each has its own EnvPostProcessor), then the one which is first in the order, is the one that's exposed, and the rest is not exposed. In this case, is it fair to solution to scan through environment.propertySources and find the first instance where management.endpoints.web.exposure.include is defined and alter (append new endpoint) it there? Or is there a better way?
Dave Jensen
@djensen47
Is there a Slack or is this the main chat for Spring Boot?
Mikael Elm
@mickeelm
I believe this is the official place
Shyam Sreenivasan
@vegeta03
Hi All,
Can anyone please tell steps on how to deploy SpringWebflux with ReactorNetty in production.
Stéphane Nicoll
@snicoll
@djensen47 this is the community channel for Spring Boot related questions. We don’t have slack.
Mikael Elm
@mickeelm
@vegeta03 your question is so broad, that it is impossible for anyone here to understand exactly what you want us to help you with. Have you built an application that you want to deploy, if so, with what kind of setup/infrastructure? Or, do you want to learn how to build an application with the named technologies?
Andy Wilkinson
@wilkinsona
@asgarj Given the complexity of your arrangement, it's starting to sound like you would be better off implementing your own condition.
Asgar Javadov
@asgarj
@wilkinsona The Endpoints that I'm adding are fine. I may choose not to put any condition on them. However, the problem is with PrometheusMetrics that has been changed to @ConditionalOnAvailableEndpoint which forces me to expose it in runtime at the beginning.
Andy Wilkinson
@wilkinsona
@asgarj I don't think I understand your problem then. Earlier you talked about a property source per endpoint, but now you're saying the problem is a single endpoint.
Tomas Hanus
@hanusto
@ravikancherla_gitlab / @wilkinsona I found the same issue (2.2.4) related to registration custom data types for Hibernate. I think that probably there is library now only with provided of jaxb module. But which ...
Vyacheslav N. Boyko
@bvn13
hi all. I need a help.
My issue is about springboot test does not import MessageSourceAutoConfiguration.
@ImportAutoConfiguration(classes = {
        MessageSourceAutoConfiguration.class
})
public class I18nConfig {
/* some beans */
}

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = I18nTest.TestConfig.class)
@ActiveProfiles("test")
public class I18nTest {

/* tests are here */

    @TestConfiguration
    @Import({
            I18nConfig.class
    })
    public static class TestConfig {

    }
}
and my test says me that MessageSource is instance of DelegatingMessageSource, messageSource=Empty MessageSource - but MessageSourceAutoConfiguration instantiates ResourceBundleMessageSource bean
why MessageSourceAutoConfiguration does not work this way?
molexx
@molexx

I want to run the same junit5 tests class 3 times, each time with a context property set to a different value. Is there a nice way to do that?

@ParameterizedTest is only method not class level, and whilst I could use @DirtiesContext(AFTER_EACH_TEST_METHOD)to recreate the context that is quite expensive to do per test and I can't see how to set the context property before the context is initialized.

Shyam Sreenivasan
@vegeta03
@mickeelm I have created an application with Spring Webflux MongoDB, I want to know that, do we deploy using tomcat like normal Spring MVC apps or is there a difference because of the NIO aspect of Webflux.
Thanks.
Mikael Elm
@mickeelm
Ah, sorry, lose the question mark on the end. Can't edit the post now
Ahmed Rebai
@Rebaiahmed
Builder Pattern is one of the Design Pattern in Java, It reduces the number of parameters required for a constructor or method invocation via custom types and parameter objects.
Anthony Lofton
@miller79
Question for the community but we are running into very slow spring boot startup times when deploying a spring boot docker image through kubernetes (up to 120 seconds). I have looked at the Spring Boot Benchmark that Dave Syer has provided (https://github.com/dsyer/spring-boot-startup-bench) but in my environment, the CPU settings used are still significantly faster than what have/use. Does anyone have any documentation/best practices or anything on improving Spring Boot startup times? We are also starting to evaluate GraalVM to see if we can get some performance improvements as well but wanting to get some feedback from the Spring Boot team if possible.
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