Today we are going to talk about a very valuable feature available for Managed Backendless and Backendless PRO users called Low Priority Tasks. In this article, we’ll look at how it works and what is it best used for.
Backendless custom business logic (custom event handlers and custom API services) tasks are put into a single queue and executed by a dedicated service called CodeRunner. In Backendless Cloud, these tasks do not have any kind of priority and are executed according to the task’s position in the queue. But there are cases when the CodeRunner queue is spammed with “heavy” requests which take 10 or even 20 seconds to execute, i.e. getting hundreds or even thousands of records with multiple relations, utility requests to delete thousands outdated records in a table, etc.
Today we are going to demonstrate how to create a simple event handler to track subscriber statistics on your various messaging channels. This gives you the ability to easily track the number of subscribers for each of your channels to help you manage channel load and gauge user interest in specific topics. Used in combination with API usage tracking, you will have a great sense of what your users are doing within your app.
To start, we will create a new application and call it Messaging_Statistics.
In Java, entity objects are classes that represent data from your table. From an object-oriented perspective, these objects are built to encapsulate your data in the real-world problem domain. There are two different ways you can work with entity objects:
The first approach is more flexible, but it doesn’t offer security for the type values. Also, it’s possible to make a mistake setting the data. It also requires you to remember the names of the columns.
The second approach is much more appealing in terms of the readability and understandability of the code. It also offers type safety.
The main drawback here is the necessity to write data binding objects (or entity objects if you prefer) that will represent the particular table. And what if you have a very large number of tables in your application, and every table consists of many columns? The amount of such tedious work could be significant. But don’t fret, Backendless is already doing it for you!