How can I listen to endpoint events from a unique URL using Java?

This topic was automatically generated from Slack. You can find the original thread here.

I have a unique url for trigger , using that is there any way to listen to that endpoint events and get them in my local system using java.

yes, you can emit the HTTP request to an SSE destination. Your Java code can subscribe to the SSE stream to receive events (see docs)

It is giving me 404 error . These are my configurations

image.png

image.png

image.png

image.png

Hi here’s an end to end example of an HTTP triggered workflow emitting events to SSE listeners:

Workflow: https://pipedream.com/new?h=tch_mp7f6q

HTML:

!DOCTYPE html
<html>

<head>
  <meta charset="utf-8" />
  <title>SSE test</title>
  <script type="text/javascript">
    const eventSource = new EventSource(
      "http://sdk.m.pipedream.net/pipelines/p_wOCOJD8/sse"
    );

    eventSource.addEventListener("events", function (e) {
      console.log("New event from HTTP test event stream: ", e);
    });

  </script>
</head>

<body>
  <div id="app"></div>
</body>

</html>

Can I do the same using java application?

Yes, I believe so. You’ll need to find a library or package to subscribe to SSE channels, but you should be able to.