title: How to send SSE on every DB change
body: <p>I have controller:</p>
  
  <pre><code>     @GET
         @Path("/info")
          @Produces(SseFeature.SERVER_SENT_EVENTS)
          public EventOutput findInfoFromDb() {
               new Thread(new Runnable() {
              @Override
              public void run() {
                  try {
                      Thread.sleep(1000);
        final OutboundEvent.Builder eventBuilder = new OutboundEvent.Builder();
   Optional objectDTO = finder.findObject();
          eventBuilder.name("object");
          eventBuilder.mediaType(MediaType.APPLICATION_JSON_TYPE);
          eventBuilder.data(ObjectDTO.class, objectDTO);
  OutboundEvent event = eventBuilder.build(); 
  eventOutput.write(event);
          } catch (InterruptedException ex) {
              ex.printStackTrace();
          } catch (IOException ex) {
              ex.printStackTrace();
          }
      }                }).start();
              return eventOutput;
          }
  </code></pre>
  
  <p>The problem I am facing is that every time I change sth in DB - I get several responses. How can I compare these objects I am getting from DB in aim to show only the changed one, without refreshing the page?  </p>