How do I dynamically populate a list with data from a JSON file at regular intravels in Spring boot. [@Schedule]How do I create a Java string from the contents of a file?How to parameterize @Scheduled(fixedDelay) with Spring 3.0 expression language?Posting a File and Associated Data to a RESTful WebService preferably as JSONHow do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?How do I write JSON data to a file?How to prettyprint a JSON file?How to configure port for a Spring Boot applicationrxJava Schedulers Use CasesHow to send the Multipart file and json data to spring bootHow to dynamically populate javascript file directly from spring boot java controller in json format?
Have 1.5% of all nuclear reactors ever built melted down?
What is the function of the corrugations on a section of the Space Shuttle's external tank?
Ingress filtering on edge routers and performance concerns
When the Torah was almost lost and one (or several) Rabbis saved it?
Best material to absorb as much light as possible
Can I tell a prospective employee that everyone in the team is leaving?
Why does Mjolnir fall down in Age of Ultron but not in Endgame?
What does the view outside my ship traveling at light speed look like?
Where have Brexit voters gone?
Is the Indo-European language family made up?
Is there an online tool which supports shared writing?
Can the product of any two aperiodic functions which are defined on the entire number line be periodic?
role of -られ, -し, and construction of the phrase
How to attach cable mounting points to a bicycle frame?
Melodic minor Major 9 chords
How to let other coworkers know that I don't share my coworker's political views?
Ethical issue - how can I better document what is happening?
Why were helmets and other body armour not commonplace in the 1800s?
How to respond to upset student?
Which European Languages are not Indo-European?
What is a Power on Reset IC?
How to draw Sankey diagram with Tikz?
Make 24 using exactly three 3s
Parallel fifths in the orchestra
How do I dynamically populate a list with data from a JSON file at regular intravels in Spring boot. [@Schedule]
How do I create a Java string from the contents of a file?How to parameterize @Scheduled(fixedDelay) with Spring 3.0 expression language?Posting a File and Associated Data to a RESTful WebService preferably as JSONHow do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?How do I write JSON data to a file?How to prettyprint a JSON file?How to configure port for a Spring Boot applicationrxJava Schedulers Use CasesHow to send the Multipart file and json data to spring bootHow to dynamically populate javascript file directly from spring boot java controller in json format?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
How do I dynamically populate a list with data from a JSON file at regular intervals in Spring boot.
I'm thinking it can be done using @Schedule.
Task: To create an api which performs some computations on data received from a json file and dynamically change the output as new data adds.
I've been able to create an api which takes in a POST request from Postman which in turn populates my List and performs the computation, but i need to automate this process using a file, which will dynamically get new data.
But could someone please highlight the exact procedure to do this.
java json spring rest spring-boot
add a comment |
How do I dynamically populate a list with data from a JSON file at regular intervals in Spring boot.
I'm thinking it can be done using @Schedule.
Task: To create an api which performs some computations on data received from a json file and dynamically change the output as new data adds.
I've been able to create an api which takes in a POST request from Postman which in turn populates my List and performs the computation, but i need to automate this process using a file, which will dynamically get new data.
But could someone please highlight the exact procedure to do this.
java json spring rest spring-boot
add a comment |
How do I dynamically populate a list with data from a JSON file at regular intervals in Spring boot.
I'm thinking it can be done using @Schedule.
Task: To create an api which performs some computations on data received from a json file and dynamically change the output as new data adds.
I've been able to create an api which takes in a POST request from Postman which in turn populates my List and performs the computation, but i need to automate this process using a file, which will dynamically get new data.
But could someone please highlight the exact procedure to do this.
java json spring rest spring-boot
How do I dynamically populate a list with data from a JSON file at regular intervals in Spring boot.
I'm thinking it can be done using @Schedule.
Task: To create an api which performs some computations on data received from a json file and dynamically change the output as new data adds.
I've been able to create an api which takes in a POST request from Postman which in turn populates my List and performs the computation, but i need to automate this process using a file, which will dynamically get new data.
But could someone please highlight the exact procedure to do this.
java json spring rest spring-boot
java json spring rest spring-boot
edited Mar 24 at 3:08
Sidd
asked Mar 24 at 2:59
SiddSidd
62
62
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
As @Scheduled is an asynchronous operation it won't produce output for rest response.
Here could be following ways to process JSON file.
- You can define an endpoint to submit JSON file.
- Do computations and store in DB and then return the response immediately. But in case JSON file processing takes a long time then you should do computations in a background thread and return "In Progress" response to the user.
- Define a separate API for fetching the list of data collected through JSON.
Thanks you for the information Gaurav. 1. I have created an endpoint [POST request] where i submit Json. 2. Done. 3. Done. Now how would i work through a procedure where it reads the submitted Json file after every few (30) seconds.
– Sidd
Mar 24 at 15:47
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55320361%2fhow-do-i-dynamically-populate-a-list-with-data-from-a-json-file-at-regular-intra%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As @Scheduled is an asynchronous operation it won't produce output for rest response.
Here could be following ways to process JSON file.
- You can define an endpoint to submit JSON file.
- Do computations and store in DB and then return the response immediately. But in case JSON file processing takes a long time then you should do computations in a background thread and return "In Progress" response to the user.
- Define a separate API for fetching the list of data collected through JSON.
Thanks you for the information Gaurav. 1. I have created an endpoint [POST request] where i submit Json. 2. Done. 3. Done. Now how would i work through a procedure where it reads the submitted Json file after every few (30) seconds.
– Sidd
Mar 24 at 15:47
add a comment |
As @Scheduled is an asynchronous operation it won't produce output for rest response.
Here could be following ways to process JSON file.
- You can define an endpoint to submit JSON file.
- Do computations and store in DB and then return the response immediately. But in case JSON file processing takes a long time then you should do computations in a background thread and return "In Progress" response to the user.
- Define a separate API for fetching the list of data collected through JSON.
Thanks you for the information Gaurav. 1. I have created an endpoint [POST request] where i submit Json. 2. Done. 3. Done. Now how would i work through a procedure where it reads the submitted Json file after every few (30) seconds.
– Sidd
Mar 24 at 15:47
add a comment |
As @Scheduled is an asynchronous operation it won't produce output for rest response.
Here could be following ways to process JSON file.
- You can define an endpoint to submit JSON file.
- Do computations and store in DB and then return the response immediately. But in case JSON file processing takes a long time then you should do computations in a background thread and return "In Progress" response to the user.
- Define a separate API for fetching the list of data collected through JSON.
As @Scheduled is an asynchronous operation it won't produce output for rest response.
Here could be following ways to process JSON file.
- You can define an endpoint to submit JSON file.
- Do computations and store in DB and then return the response immediately. But in case JSON file processing takes a long time then you should do computations in a background thread and return "In Progress" response to the user.
- Define a separate API for fetching the list of data collected through JSON.
answered Mar 24 at 5:25
Gaurav SrivastavGaurav Srivastav
1,3641614
1,3641614
Thanks you for the information Gaurav. 1. I have created an endpoint [POST request] where i submit Json. 2. Done. 3. Done. Now how would i work through a procedure where it reads the submitted Json file after every few (30) seconds.
– Sidd
Mar 24 at 15:47
add a comment |
Thanks you for the information Gaurav. 1. I have created an endpoint [POST request] where i submit Json. 2. Done. 3. Done. Now how would i work through a procedure where it reads the submitted Json file after every few (30) seconds.
– Sidd
Mar 24 at 15:47
Thanks you for the information Gaurav. 1. I have created an endpoint [POST request] where i submit Json. 2. Done. 3. Done. Now how would i work through a procedure where it reads the submitted Json file after every few (30) seconds.
– Sidd
Mar 24 at 15:47
Thanks you for the information Gaurav. 1. I have created an endpoint [POST request] where i submit Json. 2. Done. 3. Done. Now how would i work through a procedure where it reads the submitted Json file after every few (30) seconds.
– Sidd
Mar 24 at 15:47
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55320361%2fhow-do-i-dynamically-populate-a-list-with-data-from-a-json-file-at-regular-intra%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown