File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes How to create a function that periodically checks for an event, in a Spring REST API application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to create a function that periodically checks for an event, in a Spring REST API application" Watch "How to create a function that periodically checks for an event, in a Spring REST API application" New topic
Author

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

Arvind Ik Chari
Greenhorn

Joined: Dec 02, 2012
Posts: 13
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

Joined: Feb 10, 2001
Posts: 635
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


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61209
    
  66

Then it's not a REST API.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to create a function that periodically checks for an event, in a Spring REST API application