I’m new to aws x-ray and trying to use x-ray with AOP based approach in a springboot application. I was able to get the traces in the aws console, but traces doesn’t show inner method call method2() details. Am I missing anything here. Controller class Aspect Class When I hit http://localhost:8080/xray/method1 endpoint, AWS Xray Console doesn’t show method2() details Answer
Tag: spring
How to design my process – loop over a list(cannot use simple ListItemReader because list not at root level) + 1 query for each item – spring batch
If some of you could help me design my spring batch process it would be nice 😀 I need to perform ETL by consuming a REST API & then store some data from it. This process must be daily & Spring Batch seems perfect to achieve what I want since we already are using Spring framework for a lots of
Is it possible in main app to use dependancies from added dependancies?
The problem I have is that I have a Library which I want to use in the Main App. In the Library I have added external libraries, and the question is, is it possible to use directly code of this external libraries in Main App despite of that these libraries are not added directly to Main App but to my
How to set a list as an Enum constant argument?
How do I pass a List type value in the constant parameter? In this case, this parameter is only for the PARS() constant. Update: I ended up not mentioning it in the post but it’s a list of object and not a string. Answer Enums are objects instantiated from a class, like other objects and classes. So if you have
Spring Boot. Forward on RestController
I am implementing a mechanism for replacing short links. I need to forwarded request to another controller. I found examples how to do it in spring on models, but I don’t understand how to do it in RestControllers Example what i found (use models) Or maybe I’m looking in the wrong direction and I need to make a filter? UPD.
Spring Boot: Custom exception adds prefix to the exception message
In a Spring Boot app, I created a custom GlobalExceptionHandler and add the following method to handle ConstraintViolationException for invalid file type during upload process: My buildErrorResponse works correctly and build proper responses for other handle methods. However, It adds “uploadFile.file:” prefix to my error message. My questions: Is there any problem with my handleConstraintViolationException implementation? If not, how can
How to refactor the deprecated method .exchange()?
I have next method that uses in AbstractWebClient. How can I refactor it to get rid of deprecated .exchange() and save availability to work in abstract way? Answer You can use retrieve() method as suggested in exchange() documentation something like below:
Autowiring a javax.inject.provider in a unit-test with spring context
While playing around with the javax provider, I have created a spring configuration file with the following two Beans: I am injecting these two beans in two different services like so: The implementation works as expected and my depending controllers also return the data in the anticipated format. Now I wanted to add a few unit-tests for my implementation, by
Filter Key from a hashmap Map<String, List> when a string matches one of the elements in the list
I’m fairly new to java in general so help is very appreciated. I have a structure like this: This hashmap has values like this: I’m trying to filter the key of this hashMap when one of the elements matches an element of the list. I’ve tried this so far based on similar solutions I found: I expecto to get: getKey(1234)
Order between @ControllerAdvice and custom Aspect
tl;dr How can I define the order of custom aspects and the @ControllerAdvice? Detailed description I want to decorate various methods (like normal REST-Calls or a @JmsListener) with MDC information on controller-level. The idea is: I, as a developer, don’t have to think about the MDC data in my controller-methods. I want extra MDC-information (e.g. the userId) and I can