-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for SSE heartbeats #22
Conversation
@Scheduled(initialDelay = 15000, fixedRateString = "${fint.provider.sse.heartbeat:15000}") | ||
public void sendHeartbeat() { | ||
log.debug("Heartbeat"); | ||
Multimap<String, FintSseEmitter> toBeRemoved = MultimapBuilder.hashKeys().linkedListValues().build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MultimapBuilder gives me a warning in intellij:
MultimapBuilder is marked unstable
Might not be a problem? I like the toBeRemoved.forEach... syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's due to the @Beta
annotation on that method. Shouldn't be a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, just merge it when you are ready.
According to javadoc on ResponseBodyEmitter.complete() there is no need to invoke this on IOExceptions. Furthermore, according to javadoc on ResponseBodyEmitter.onCompletion(), this handler is called on both timeouts and errors in addition to normal completions.
This feature adds periodic heartbeat events to the SSE streams. It requires adapters to update to SSE libraries supporting empty events.
FINTLabs/fint-sse#1
FINTLabs/Fint.Sse#3