spring-restcontroller

How To Stream Chunked Response With Spring Boot @RestController

纵饮孤独 提交于 2020-12-05 11:07:21
问题 I have spent like a day on this and I am unable to find a solution that works. In our application we have a couple of endpoints that can return large responses. I have been trying to find a mechanism that allows us to stream the response as we process the result of a database query. The main goals are to limit peak memory usage (not need the entire response in memory) on the service side and to minimize the time to first byte of response (the client system has a timeout if the response doesn

XmlElement(name=“custom_name”) not working in spring boot integrated with rest services

半城伤御伤魂 提交于 2020-12-03 07:12:22
问题 I am almost new to rest services world,here i am trying to change the field name displayed in the output xml. Not sure,am i following the right method,any help is a good thing. Activity.java import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class Activity { private int activityId; private