• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

possible to send push notification back to the user interface from spring boot app or activeMQ?

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to figure out how to send push notifications back to the client in the following ActiveMQ scenario:

I have a spring boot web application #1 deployed on tomcat on RHEL server. From the user interface (this consists of Javascript,jQuery,HTML,CSS), user clicks on a request files button, which calls
a RESTful webservice (a stored procedure gets called  and a unique identifier(number) is returned). I send this identifier as a message to ActiveMQ because the overall
process could take 20-30 minutes.

With the help of this identifier I can check the status of the query from the database table.By status of the query I mean COMPLETE, ERROR, STARTED, NOT YET STARTED.I've
used this approach in my second spring boot web application as explained below.

I have another spring boot web application #2 which is deployed on the RHEL server.This acts a a consumer and keep on listnening to the ActiveMQ queue.
With the help of the identifier from ActiveMQ ,as soon as this app sees the status as COMPLETE, it grabs records from 3 tables,convert the records into 3 csv files,
convert these 3 csv files into  a zip file and put it somewhere on the same server.

The zip file generated in the last step is not available immediately as soon as user clicks on the request files button from the spring boot web app #1.

I am wondering since I've two separate spring boot web applications, is it possible to send push notifications to the user interface of spring boot web application #1
so that user is  aware that their request is not yet completed and they need to wait? Is there something that ActiveMQ does to accomplish this?

Let me know if I can answer any questions relate to this.
 
Saloon Keeper
Posts: 5718
144
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server-sent events are one way to accomplish this. Check the Spring documentation to see how (or if) it supports those. A framework-agnostic approach with full source code is provided in https://coderanch.com/t/685060/java/web-app-Server-Events-SSE
 
Jack Tauson
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:Server-sent events are one way to accomplish this. Check the Spring documentation to see how (or if) it supports those. A framework-agnostic approach with full source code is provided in https://coderanch.com/t/685060/java/web-app-Server-Events-SSE



Thank you. Here it says SSE is not supported in IE. So is this going to be a problem if my users might use IE?

https://en.wikipedia.org/wiki/Server-sent_events
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!