0

I have a websocket connection on between a client and a server. My server is linked and connected to a database as well (postgresql).

My question is: Is there a way to have a event trigger from the database to the server, so that the server can start a method according to that event.

I'm using Quarkus for this project. My server side is written using netty socket.io and my client side is written using socket.io-client-java.

Let me know if you need any details.

Slaymut
  • 11
  • 4
  • What is your concrete use-case for something like this? Which event do you plan to fire in postgres? – triplem Nov 26 '21 at 21:09
  • @triplem I plan on firing an event when a new data has been added to my table, as if it would say "Hey, there's new data, you need to check for it and retrieve it". I need to know when new data is stored so my app works in real time. This data will be fetched by the server and sent to the client so he can use it – Slaymut Nov 28 '21 at 14:28
  • Please provide enough code so others can better understand or reproduce the problem. – Community Dec 01 '21 at 08:27
  • There are, as seen in the answer below, some ways to do this. Question is, if this is really the way to go. In a perfect world, you would send an event from the application writing to the DB (and this should only be your app anyways) and fetch this event to send this to the client app via web-sockets. – triplem Dec 01 '21 at 21:23

0 Answers0