I’m new to Spring and even newer to WebClient. I want to filter the body of a Get response repeatedly with one second intervals for 2 minute duration using Springs’ WebClient. I’m performing a get request which returns an empty JSON list of strings. At some moment of time the body is going to be populated and I want to
Tag: spring
Mongo aggregate sum of two Strings
I am trying to sum one field in Mongo. If it is an Integer there is no issue, but the problem is that it is String and I get 0 for totalAmount amountField is a String, how can I sum it in this implementation Answer You are getting String amountField. Simply you can convert this String to Integer by using
Spring SFTP : Unable to rename .writing file
I am using Spring SFTP integration to transfer the file and many time I got this error. It seems two threads are trying to transfer same file and conflict with each other 2020-08-03 08:31:55,766 INF [task-scheduler-8 ] o.s.i.ftp.session.FtpSession – File has been successfully transferred from: ./abc.ext.200803 2020-08-03 08:31:55,849 INF [task-scheduler-7 ] o.s.i.ftp.session.FtpSession – File has been successfully transferred from: ./abc.ext.200803
Is correct to have private method in service layer? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question I am developing a service using Java and Spring Framework, I have business logic at the service layer, but I
Spring 5.x and CDI 2.x Integration Options
Considering Spring’s 5.x baseline and CDI’s baseline 2.x, what more viable options should I consider to integrate them into a project with JSF 2.3, since JSF 2.3 is coupled with the CDI? Bridges? Custom Bean Factories? Others? Answer We use bean producers to access Spring objects in CDI. As in the architecture we used there is an interface layer between
WebClient – adding defaultHeaders
I’m trying to put multiple headers into defaultHeaders(), But I don’t have idea how to create Consumer object from return of createHeaders() method I can build my header in that way: but how to wrap it into Consumer? Answer Clearly the method doc says that it needs a Consumer of some Type. So you can create an anonymous class implementing
Apache Camel custom Service and shutdown
I have implemented a Camel Service , but when i try to shutdown my route , it’s impossible …. I have to kill the process. What i have missed ? First I create a class which implements camel.Service : …
Why is @Validated required for validating Spring controller request parameters?
With the following validation setup in an annotated MVC controller: @Validated on the controller is required for the method parameter since it’s not a “complex” object. In comparison, the @Valid annotation on the setOther method works without the @Validated annotation. Why is @Validated required? Why not enable it by default? Is there a cost to its use? edit Note that
How to properly filter Spring REST data
I have a Spring Data REST service with a single @Entity and Repository. When I run $ curl localhost:8080/api I get all the data stored in my repository and it works as expected. I also have a small React front end and I display that data there. My question is: Where should I filter the data? For example maybe I
create file with webHdfs
I would like to create a file to hdfs with webhdfs, I wrote the function below In the last print I don’t see my file… Any idea ? Answer