Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Server-sent events

Hi, is there a working example of Server-sent events available please?
I see some limited documentation here:
https://docs.developers.symphony.com/developer-tools/developer-tools/bdk-2.0/bdk-1.0/bot-sdk#real-time-events
And the BDK generator (symphony-bfk-cli --bot) creates a Java project with classes called SimpleEventPublisher (extending SsePublisher), however I cannot see in that project how to invoke the sending of an event. The corresponding extension app template (symphony-bdk-cli --app) does not appear to have an example which connects to the server project.
Any help you can provide would be appreciated!

Votes Newest

Answers


Hi Graham, publishing an event to suscribers in a class extending SsePublisher is pretty straightforward, you have to do the following:

SimpleEvent event = new SimpleEvent();
event.setId("myId");
event.setType("event1");
event.setPayload("This event occurred at " + LocalTime.now().toString());
this.publishEvent(event);

To suscribe to this event, the client app must implement the EventSource class such as:

const evtSource = new EventSource("http://localhost:8080/mybotapp/secure/events/event1")

Note: This code is part of the BDK 1.0 that is generated from the bdk-cli tool. This version is not supported anymore by our engineering team but is still available on a as-is basis. The Bot Developer Kit (BDK) has been re-architectured in a 2.0 version where the support of SSE has not been migrated.

  
  
Posted 2 years ago
Edited 2 years ago
Olivier Poupeney
10 × 1 Administrator