Dynamic timeout for each api in spring eureka - spring-cloud

I am facing timeout problem while downloading excel reports from my web application. The application is follows microservices archtecture build using spring-cloud. The Api timed out as i had set the ribbon timeout to
ribbon.ReadTimeout= 40000
ribbon.ConnectTimeout= 40000
Now if i increase the timeout in application.properties, then it will be reflected in entire application. I need different timeout for UI and downloading reports.
Is there a way to set dynamic timeouts for different api's in spring cloud? Please guide

Related

Jasper Server Asynchronous report execution not working with multiple server instances

I'm implementing the Asynchronous report execution with Jaspersoft and follow the docs. I have 2 jasper server instances and traffic is manage through a load balancer and the load balancer supports only round-robin policy.
According to documentation, reportExecutions API (http://:/jasperserver[-pro]/rest_v2/reportExecutions) successfully returns a requestId. But report polling service (http://:/jasperserver[-pro]/rest_v2/reportExecutions/requestID/status/) always gives 404 resource.not.found error.
When server running on a single instance, all APIs are working properly.
I'm using the TIBCO jasperserver 7.1.0 Enterprise edition.
According to this, the issue is in cookies. Getting "Cookie" header from response of the reportExecutions API and adding it to polling request will solve the issue.

Spring boot API timeout and HTTP timeout in weblogic

I am in the process of setting up a spring rest api using spring boot.
This will be deployed on weblogic server.
this api will perform a db operation which can potentially take anywhere between a few seconds to an hour.
Am planning to use spring's 'DeferredResult' and 'ForkJoinPool' to trigger the database operation asynchronously.
I would like to perform a timeout and inform the end user if I dont get a response from the db operation after lets say 30 seconds.
So I will be setting this configuration for my rest api to timeout after 30 seconds.
My question : are there any weblogic http timeouts that could occur ?
If yes then my api configured timeout would need to be less than the server timeout
or
I would need to increase the server timeout such that it is greater than the API timeout .
Any thoughts on the approach would be great .

Increasing GWT Timeout on JBoss Server

We are working on a GWT based web application hosted on JBoss 5.2.0.1. We are using Java/Spring on the server side.
One of the Async services takes more than 5 minutes to return the response from the server, and this leads to error (on production environment):
com.google.gwt.user.client.rpc.StatusCodeException: 504
Gateway Time-out
The gateway did not receive a timely response from the upstream server or application.
The issue doesn't occur when the JBoss is hosted on my local machine. I am suspecting this is some server side setting on production environment which is causing the timeout.
I referred to a couple of questions on SO and the solutions are related to setting timeout with RequestBuilder.setTimeoutMillis(). However, I am not completely convinced that this is related to changes on client side (since the code works fine on my local, where only JBoss configuration may differ from the production)
Any pointers are appreciated. TIA.
It turned out that the there was a timeout set on the gateway. The gateway would return HTTP 504 error in case there is no response returned by the server withing the set timeout (which was 5 minutes)

spring cloud configuration client spamming our configuration server

We have a set of micro services which obtain their configuration from a configuration server that we have created. Our configuration server uses mongo as the backing store for configuration files and we run it in a redundant configuration so that if any of the configuration servers fail then we can fail over to another.
Now the configuration for each service is that it uses discovery to get the location of the configuration server. We can see that each service obtains a reference ants the proper configuration data for the server and that all services start correctly with this data.
Now one thing that we noticed is that the services regularly request their configurations from the configuration server every 3 mins. This is being done at the configuration client level and not in our code base.
This get request from every service at that rate is causing quite a bit of load on the configuration service. Is this expected and if so how can be lower the rate of these pings?
One additional issue is that if we make a health request to any service, this triggers a request to get the services configuration from the remote configuration service.
The combination of both of these elements is driving our configuration server into the ground since they are 5 requests/sec on the server.

Remote logging: rsyslog vs. RESTful API

I'm working with Django and Loggly, and I need to decide between using Loggly with rsyslog or with its RESTful API. For the second option, I'd use grequests, sending a single request at a time (i.e., just to make the calls non-blocking, but I wouldn't send requests in bulk).
What are the advantages of using rsyslog over the RESTful API and vice versa?
Haven't tested it yet, but using the syslog approach has several advantages:
You can centralize logs at a system level, without particular
configurations on the django app
Logging is decoupled from the django app, you can set it to log to file,
a remote syslog server or loggly, without touching the django app
It should be faster if using UDP
If using a centralized syslog server, you only have to set the loggly
agent there
On the other hand, using the RestAPI would couple the app to the loggly implementation, and it could raise some errors while trying to report errors (DNS resolution failures, network problems, etc)