Notifier - The Best HTML Notification System for Web Applications

Currently, I am developing a notification system using Play Framework 2.3 (Java) in combination with MySQL.

The system is designed to retrieve notifications from a "notifications" table stored in MySQL database.

I initially attempted to use AJAX polling where periodic asynchronous requests are made every 30 seconds to check for new notifications in the table. However, due to performance issues, particularly under heavy user loads, I am seeking alternative solutions.

Could anyone suggest the most effective approach to implement such a system? Are there any recommended Java libraries that would simplify this process?

Thank you for your help and insights.

Answer №1

Upon further examination, it seems that you are utilizing the Play Framework, a platform I am unfamiliar with. However, after a quick investigation, I discovered that the Play Framework also supports websocket functionality:

---- Previous response below ----

If you are working with JEE7, have you considered implementing websockets? Although this may limit compatibility to more modern browsers that support websockets, it can enhance performance due to its bidirectional connection and reduced overhead.

You can explore more about websockets in JEE7 here:

http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm

I found this example particularly informative:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing jQuery for automatic redirection in place of performing regular AJAX requests

My form validation script using bootstrapvalidator () performs an ajax call upon successful validation (e.g., checkbox checked, not empty). However, I encountered a problem when trying to integrate it with the ICheck plugin (). Instead of executing the aj ...

Incorporate JSON information into a sleek Bootstrap modal interface

I am looking to load a JSON file to generate a list within a Bootstrap Modal. The setup I have allows for the modal to appear when clicking on a person's image. <li class="project span3" data-type="pfa"> <a data-toggle="modal" data-targe ...

Press the button to switch between displaying one component and hiding another component within reactjs

I am working on a project with two distinct buttons: one for grid view and another for list view. <button onClick={() => setClassName('jsGridView')} title="Grid View" > <IoGrid className="active" s ...

Is there a way to retrieve the width of the parent element in ReactJS from a child component?

The issue has been fixed: I forgot to include .current in my ref... I am trying to determine the width of the element that will hold my component. I came across a solution on SO, but unfortunately it did not work for me as it returned undefined: import R ...

The installed extension on the Selenium Firefox WebDriver fails to initiate

My current setup includes: Selenium Firefox WebDriver v.3.8.1 Firefox Browser version 43 XPI-file with a Firefox add-on I have executed the extension in two different ways: using 'jpm' and through Selenium Firefox WebDriver program in Java. ...

Discovering all the links present on a webpage using node.js

Currently, I am diving into node.js (webdriver) and encountering some challenges. Despite my efforts to search online for examples of the tasks I need help with, I have come up empty-handed. One example that has me stumped is how to log all links from a pa ...

Can JSON-formatted JavaScript variables be inserted and utilized in MongoDB?

I am currently in the process of formatting a large JavaScript file so that I can insert it into a MongoDB collection and retrieve it using AJAX. However, I am encountering issues with the syntax. Here is an example snippet: var MyData = [ { Elements: ...

Vue and Axios encountered a CORS error stating that the 'Access-Control-Allow-Origin' header is missing on the requested resource

I've encountered the error above while using Axios for a GET request to an external API. Despite consulting the Mozilla documentation, conducting thorough research, and experimenting with different approaches, I haven't made any progress. I&apos ...

Developing a Form Submission Feature Using JQuery Mobile

I'm having trouble submitting a form using JQuery Mobile. Currently, my code looks like this: <form action="#pagetwo" method="post" name="myform"> <input type="text" name="myname"> <input type="submit" value="submit" /> ... and th ...

Ensure that the flex item spans the entire width of the page

I'm struggling to make my audio-player resize properly to fit the full width of my page. I can't seem to figure out what I'm missing or doing wrong... (Current Look) I'm attempting to utilize HTML custom controls to design my JSON Aud ...

Problem with logging in using ajax

I'm attempting to implement an on-page login feature. It functions perfectly without the use of ajax. Below is my login.php code; if($_POST) { $username =$_POST["username"]; $password =$_POST["password"]; $query = $handler->query("SE ...

The browser does not automatically set the Cookie

Trying to login involves making an API call using a POST HTTP request. post( postLogin(email), JSON.stringify({password: passwd}), { headers: { "Content-Type":"application/json" }, credentials: 'include' // also attempted with &a ...

Navigating with Anchors, Styling and jQuery

Firstly: Apologies in advance for any language errors as English is not my native tongue. :) The Scenario Here's the deal: I'm attempting to create a single button that, when clicked by the user, automatically scrolls down to the next DIV. Each ...

Is React failing to identify parameters?

working on my react project, I have an App component which is responsible for rendering multiple child components. Here's how it looks: App render() { return ( //JSX inside <BrowserRouter> <div> <Heade ...

How to retrieve the $0 element using Python Selenium

There is an unnamed element I can only access with a dollar sign: console.log($0); "100" In Python Selenium, how can I retrieve this element? I attempted the following: my_value=driver.find_element(By.NAME,"$0") However, it resulted i ...

Encountered an issue with setting the property of "something" to undefined when attempting to generate an array sorted by dates

After seeking help from @Kato on Stack Overflow regarding sorting a Firebase AngularFire array into weeks and days, I encountered an error where I cannot set a property of "something" that is undefined. To provide more context, I created a detailed Plunke ...

Fetching Unicode block specials using axios in getStaticProps with Next.js

Click here to view the code and data results My attempt using the fetch method was successful, but I encountered issues when trying to use 'axios' ...

Selenium automation script for updating user passwords automatically

In the process of developing an automation script for the password change feature, I am sourcing test data from an Excel file. While I have successfully created a test script for the typical scenario, my current challenge involves verifying that the system ...

Failure to successfully transmit data from Ajax to PHP script

When I click on a button in my HTML page, I am trying to retrieve information from my PHP code, but it is not connecting properly. The front page displayed in index.php is as follows: <!DOCTYPE html> <html> <head> <link rel="styleshe ...

Techniques in Android Studio

As a beginner in the world of Java and Android development, I am currently learning how to write code for Android using Android Studio. I have a specific question that I hope someone can help me with. I am working on creating a supply list where users can ...