Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create a function that periodically checks for an event, in a Spring REST API application

 
Arvind Ik Chari
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am working on a Spring based REST API Java web app.

In it, there is a requirement for periodically checking for occurrence of an event, for example - insertion of a new message in a message queue.

How do I create such a function? I want this function to be constantly running-- I should not need to invoke it as such, and it should be constantly running (as long as the app itself is running).

Thanks,
Arvind.
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why is the requirement of doing it with REST API?
this should like a scheduler job that can be easily configured using spring batch or spring TaskExecutor.

Also, since you mentioned "monitoring insertion of message in message queue" it sound what you are trying to re-invent is MDB in EJB or Spring MDP.

-P
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then it's not a REST API.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic