1
votes

After a stream is being processed (applying filter and etc), can each of the remaining items in the processed stream trigger events directly instead of being written to a sink?

I have a bunch of devices keep reporting status to the hazelcast jet stream server. The server performs some filtering on the stream and only keeps devices that are really in bad shape. I want these devices directly trigger some maintenance events instead of being written to a sink (e.g. IMAP). Currently, what I am doing is to sink the stream to a IMAP and register listeners on the map. However, I am not sure if this is the best practice for my use case. I mainly have two concerns:

  1. I don't necessarily need to store those devices. All I need is to tell some other service the device needs to be maintained.
  2. Doc says heavy logic shouldn't be put in the listener. What should I do if the task triggered by the event is comprehensive?
1

1 Answers

2
votes

Looks like what you need is a custom sink, see our Reference Manual section on the topic. In the receiveFn you can notify the other service about the device.