Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • 17:00
    izebit commented #3810
  • 16:59
    izebit commented #3810
  • 13:32

    OlgaMaciaszek on master

    Add instrumentation for Retryab… Merge remote-tracking branch 'o… Add more tests. and 1 more (compare)

  • 13:10

    OlgaMaciaszek on 2.2.x

    Add more tests. (compare)

  • 10:45
    spring-issuemaster labeled #1761
  • 10:43
    pivotal-issuemaster commented #1761
  • 10:42
    stokpop opened #1761
  • 09:10
    spring-issuemaster unlabeled #678
  • 09:10
    spring-issuemaster labeled #678
  • 09:09
    deftdawg commented #678
  • 08:54
    tommyk-gears synchronize #639
  • 06:44

    dependabot-preview[bot] on maven


  • 06:44
    dependabot-preview[bot] closed #807
  • 06:44
    dependabot-preview[bot] commented #807
  • 06:44
    dependabot-preview[bot] labeled #841
  • 06:44
    dependabot-preview[bot] opened #841
  • 06:44

    dependabot-preview[bot] on maven

    Bump spring-hateoas from 1.1.0.… (compare)

  • 02:19
    shivakrishna-k edited #1730
  • 02:08
    spencergibb labeled #678
  • 02:08
    spencergibb unlabeled #678
Marcin Grzejszczak
I need to see your code
@Configuration(proxyBeanMethods = false)
public class WireMockConfiguration implements SmartLifecycle {


    @Autowired(required = false)
    private Options options;

private void reRegisterServer() {
        if (log.isTraceEnabled()) {
            log.trace("Creating a new server at http port [" + this.wireMock.getServer().getPort() + "] and "
                    + "https port [" + this.wireMock.getServer().getHttpsPort() + "]");
        if (this.isRunning()) {
            if (log.isDebugEnabled()) {
                log.debug("Stopping server [" + this.server + "] at port [" + port(this.server) + "]");
        else if (this.server == null) {
            this.server = new WireMockServer(this.options);
            if (log.isDebugEnabled()) {
                log.debug("Created new server [" + this.server + "] at port [" + port(this.server) + "]");
so it should reuse your options to create a wiremockserver
why do you say that it's not working?
You could put a breakpoint to see if the server is created with your options
Mattias Sundling

annotations for the test class is as follows:

@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureWireMock(port = 0, files="classpath:/apptests/xxxIT")

With the bean I posted above, when fetching WireMockSpring.options() the container threads is still not affected when I'm running the tests.

Marcin Grzejszczak
sure, try putting a beakpoint n the reregisterserver method in the WireMockConfiguration class
to ensure that the options are passed to the wiremockserver object
Mattias Sundling
Will try it, brb.
Marcin Grzejszczak
and that the options contain your setup
Mattias Sundling

Hi, I am using the 'spring-cloud-contract-wiremock' dependency together with '@AutoConfigureWiremock' in one of our integration test suites.

I want to be able to increased its load capabilities. In the documentation, it says that I could create a bean in the context path of type Options to be able to configure this server more fine grained configurations.

When I introduce something like this:

public class WiremockConfig {

Options options() {
    return WireMockConfiguration.options().containerThreads(30);


and fetch the configuration through WireMockSpring.options() I can't see that the container threads are affected. Because there is very little documentation of configuring the wiremock instance here https://cloud.spring.io/spring-cloud-contract/reference/html/project-features.html#features-wiremock, I am asking in this chat. If it's ok?

Anyone got any suggestions on how I can increase the load capabilities of the wiremock instance created by '@AutoConfigureWiremock'? Thanks.

This was resolved by changing the name of the bean after pointed out by @marcingrzejszczak , as it was clashing. But furthermore, I replaced it with a WireMockConfigurationCustomizer-bean, where I increased the container threads instead.

Alper Kopuz
hello when consul is down do you believe that I should reregister my service at Spring Cloud Gateway ? It will poll consul and check if it's online or not and if it's not it will reregister to consul and it will reregister my service to consul
that's my plan. do you believe that I can accomplish that problem ?
Gayan Weerakutti

Adding spring-cloud-starter-aws-secrets-manager-config to 2.3.4.RELEASE - Hoxton.SR8, project throws the following:

com.amazonaws.util.EC2MetadataUtils : Unable to retrieve the requested metadata (/latest/meta-data/instance-id). 
Failed to connect to service endpoint: 

com.amazonaws.SdkClientException: Failed to connect to service endpoint: 
        at com.amazonaws.internal.EC2ResourceFetcher.doReadResource(EC2ResourceFetcher.java:100) ~[aws-java-sdk-core-1.11.792.jar:na]

Caused by: java.net.SocketTimeoutException: connect timed out

But downgrading the springCloudVersion to Hoxton.SR6 do fix it.

2 replies
Pablo Ramírez
Hi there.. i'm so confused with turbine, can you clarify me some basic aspects?.. I've a spring cloud running stack (i've some experience on it), config, registry, gateway and some api's. now I've created a new app with hystrixDashboard and turbine which works well showing dashboards directly from my api's hystrix.streams. My confussion is: ¿is the gateway the only hystrix.stream necessary to aggregate to turbine because of is the only consumer api which i have? (i'm not using feign clients for now, and i've configured Hystrix filter on gateway)
1 reply
Hi, when redirects following is enabled for the netty client, Spring Cloud Gateway doesn't send POST body to redirected location. Is that a bug or am I missing some configuration that needs to be set? Minimal demo of the problem can be found here: https://github.com/mbrkic4/spring-cloud-gateway-demo
1 reply
I want to deploy spring cloud application on K8s. How to decide K8s resource request and limit ?
Help please
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'reactiveHealthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/LegacyHealthEndpointCompatibilityConfiguration$LegacyReactiveHealthEndpointCompatibilityConfiguration.class]: Unsatisfied dependency expressed through method 'reactiveHealthIndicatorRegistry' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'reactiveHealthContributorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/ReactiveHealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'reactiveHealthContributorRegistry' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'configServerHealthIndicator' defined in class path resource [org/springframework/cloud/config/server/config/EnvironmentRepositoryConfiguration.class]: Unsatisfied dependency expressed through method 'configServerHealthIndicator' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.config.server.config.CompositeConfiguration': Unsatisfied dependency expressed through method 'setEnvironmentRepos' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultEnvironmentRepository' defined in class path resource [org/springframework/cloud/config/server/config/DefaultRepositoryConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: You need to configure a uri for the git repository.


Invalid config server configuration.


If you are using the git profile, you need to set a Git URI in your configuration. If you are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.

my application.yml is:
port: 8088
name: configserver
active: git
the command is: docker run -it -p 8888:8888 -v application.yml:/config/application.yml hyness/spring-cloud-config-server
Spencer Gibb
@noctambulo-12 can you format things with tripple backtick. Hard to read unformatted
´´´docker run -it -p 8888:8888 -v application.yml:/config/application.yml hyness/spring-cloud-config-server´´´
(code that executes) docker run -it -p 8888:8888 -v application.yml:/config/application.yml hyness/spring-cloud-config-server
(my application.yml is) server: port: 8088 spring: application: name: configserver profiles: active: git cloud: config: server: git: uri:https://github.com/nocturno/configserver.git username:correo@dominio.net password:*MiContraseña*
1 reply
Cesar Manuel Cruzata De la Cruz
Hello guys, I need to overwrite the registration behavior of the eureka clients: http://HOSTNAME:PORT to http://HOSTNAME ,ie, without port
Abhishek Jain

hi guys... i am using spring cloud gateway to proxy one of our service.. and we are using kubernetes...

so the issue is whenever my proxy service returns 302, the location header is set to the url of the service e.g.

and returned to the browser... but browser is cannot reach this url as it's internal kube service url..

what i want is to return the url of the ingress not the service...
any ideas??

Carlos Adolfo Ortiz Q
Hi I wonder if open feign is reactive enabled?
1 reply
help please
How can i i write files to disk from a springboot app docker image? Whats the best strategy to address this requirement?
the app has to upload and save images on disk and also display them on angular app and also the files should be downoloadedable from angular app
1 reply
Corneil du Plessis
What is the recommendation when deploying spring boot to OpenShift? Spring Boot buildImage or Fabric8? Is Spring Cloud Kuberneters 1.1.6 which is the latest release ready for Spring Boot 2.3?
5 replies
Saad Rashid

Hi, I am using Spring Cloud Netflix Zuul Gateway without Ribbon / Eureka, can I able to override default zuul timeout properties for specific routes ?


2 replies
Maryna Pashkouskaya
Hi, I'm using config server (spring-boot v.1.5.x) for serving properties from native file system. I observe that
it takes more then 15 seconds to complete get request for configuration. I was profiling the application and I found that the most time was consumed
by ConfigFileApplicationListener$Loader.load() method. In fact there are too many calls ClassPathResource.exist()
and ConfigFileApplicationListener$Loader.getResourceDescription() methods. Is there any plans to inprove config server performance for spring-boot v.1.5.x?
For instance: method ConfigFileApplicationListener$Loader.getResourceDescription() provides information that is useful only for log levels trace and debug
but it calls despite of the log level value.
2 replies
Vincent Simpson

Hello. I'm using the reactive WebClient in order to call other services from one service. Basically I'm writing an onboarding service that calls other services to execute steps. However, if one of the services throws an exception I'd like to rollback all of the calls I made to these external services. Is this something that's possible? Some pseudo code:

(synchronous flow)
Use Mono to call Service1 to persist some data (200)
Use Mono to call Service2 to persist some data (200)
Use Mono to call Service3 to persist some data (5xx)
Rollback persist to Service1
Rollback persist to Service2

Thiago Milczarek Sayao
Just starting with dataflow tasks, are they not spring boot apps?
1 reply
Lukas Kolisko
Hi, I would like to double-check my understanding of the spring cloud gateway httpclient.response-timeout parameter. Is the timeout supposed to be counted from the start of the request/subscription? Or is this "read-timeout" on the response (timeout between subsequent reads)? Looking into the NettyRoutingFilter it seems to be the first case.
2 replies

Hey all! I am not pretty sure. I have the following case:

  • I have the spring cloud gateway instance
  • And depends on some predicate I would like to or:
    -- Forward it to some downstream service and wait for the response // this is simple
    -- Or using spring cloud stream put it on RabbitMq and return HTTP 200 // this is not simple at least for me

Is it possible at all?

2 replies

Hmm then one more question. Is there any simple way to get the Security Context in Gateway if it acts as ResourceServer?

               .route(p -> p.predicate(this::makeDecisionBasedOnSecurityContext)

Where security is define as:

  public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
    return http.authorizeExchange(exchanges -> exchanges.anyExchange().authenticated())
11 replies
Lukas Kolisko
I have a question regarding ReactiveLoadBalancer API. In case there is no instance available for a request, then I am returning EmptyResponse. This works for ReactorLoadBalancerExchangeFilterFunction etc. However the BlockingLoadBalancerClient will of course fail in BlockingLoadBalancerClient with IllegalArgumentException in LoadBalancerUriTools.reconstructURI, because instance is null. I know I am a bit mixing there two worlds, but is there a way to handle this on the loadbalancer client level with custom exception? I do not see way to simply extend or wrap BlockingLoadBalancerClient. Thanks in advance for any hints.
1 reply
Chris Hansen

Hi all. I'm running into an issue where triggering a refresh scope doesn't trigger autoconfiguration for some of my projects. Debugging through the code, it looks like when the project is run initially as an executable fat jar, org.springframework.boot.loader.LaunchedURLClassLoader is used and spring.factories are found as normal, but when refresh scope is refreshed, either jdk.internal.loader.ClassLoaders.AppClassLoader is used and no spring.factories are found or TomcatEmbeddedWebappClassLoader is being used and it works correctly. I'm working on a minimal project to reproduce it, but anyone have ideas on when/why AppClassLoader wouldn't be able to find the spring.factories?

If I workaround by running java -cp ... com.foo.MyApplication instead of java -jar then AppClassLoader is used initially AND for refresh and everything works fine.

7 replies
Anand Shah

Hi all. I am trying to modify request body in streaming way so I am using something like this

exchange.mutate().request(new ServerHttpRequestDecorator(exchange.getRequest()) {
      public Flux<DataBuffer> getBody() {
          super.getBody().map(buf -> {
              var output = new DefaultDataBufferFactory().allocateBuffer();
               // My logic here to read buf & pupulate output buffer
                return  output;

I am expecting very large body stream (1 GB bytes) so I am updating body in streaming way to keep memory pressure under control. This approach works for few bytes (2-3 MB) and then it gets stuck with no more calls to .map method

6 replies
Camilo Pereira

Hello, I've been working with the sping gateway for a several months already and we have created several interesting patterns in our gateway. One I would like feedback about is the routing to a local endpoint that always returns 200 and then we use the modify response filter to build the whole response:

    public RouteLocator loanList(RouteLocatorBuilder builder) {
        return builder.routes()
            .route(p -> p
                //matching incoming request predicates
                .path(String.format("%s/loan-list", GATEWAY_ROOT_PATH_V1)).and()
                .filters(f -> f
                    .modifyResponseBody(String.class, String.class, createResponse())
                 //this redirects the route to a spring boot controller in the gateway that simply returns 200 OK.

When I built this it was the easiest way I found to create a complex response object built from data retrieved from several internal services and making sure that the endpoint never fails if one of the internal calls was not successful. The createResponse() method in modifyResponseBody is fetching data async and also providing default values in case the request to the internal service fails.

Is there a better alternative for this type of dynamic routing, where I don't necessarely want to proxy into an internal service but instead build the response myself?

Camilo Pereira
by the way, if u are using Datadog, make sure you are using the latest version of dd-trace-java. We had an issue where the gateway will eventually died after a few hours of traffic.
This message was deleted
2 replies