Skip to content

[ZEPPELIN-6340] Add ZeppelinEventBus and update NotebookServer to handle NoteRemoveEvent - #5441

Open
seung-00 wants to merge 1 commit into
apache:masterfrom
seung-00:ZEPPELIN-6340
Open

[ZEPPELIN-6340] Add ZeppelinEventBus and update NotebookServer to handle NoteRemoveEvent#5441
seung-00 wants to merge 1 commit into
apache:masterfrom
seung-00:ZEPPELIN-6340

Conversation

@seung-00

@seung-00 seung-00 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What is this PR for?

This PR is the first step toward migrating Zeppelin’s listener-based event handling to an EventBus model, as outlined in the proposal. It sets up the EventBus infrastructure and migrates NoteRemoveEvent handling to it.

Key changes:

  • Added the ZeppelinEventBus class
  • Added RxJava 3 as a dependency of the zeppelin-zengine module
  • Added the zeppelin.eventbus.enabled feature flag
  • Updated NotebookServer to handle NoteRemoveEvent through ZeppelinEventBus when the feature flag is enabled

This PR supersedes #5085. The original branch had fallen behind the current codebase, and the implementation has since changed, so I opened a new PR.

What type of PR is it?

Improvement

Todos

  • Refactor other NoteEventListener methods and additional listeners to EventBus

What is the Jira issue?

How should this be tested?

  • Run the existing test suite against the updated code
  • Verify the note deletion flow through the UI

Screenshots (if appropriate)

Questions:

  • Does the license files need to update? N
  • Is there breaking changes for older versions? N
  • Does this needs documentation? N

@seung-00
seung-00 force-pushed the ZEPPELIN-6340 branch 4 times, most recently from 73168af to 4ff5711 Compare August 29, 2026 14:46
@seung-00
seung-00 force-pushed the ZEPPELIN-6340 branch 2 times, most recently from 54049f1 to 58118cb Compare September 7, 2026 05:03

@tbonelee tbonelee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few thoughts on subscription registration, since 6341, 6346 and 6348 will likely follow this PR as their model.

observe(NoteEvent.class) receives every subtype of NoteEvent. Once 6348 adds NoteCreatedEvent, this subscription gets it too and falls through to the else branch in handleNoteEvent, logging "Unknown event type" for what is normal behavior. Each new event also means another ticket editing the same if-else chain.

The try/catch in the lambda is load-bearing in a way that is easy to miss. LambdaObserver disposes the subscription when the consumer throws and forwards the error to RxJavaPlugins.onError, which by default only reaches stderr, so a dead subscription leaves no trace in the logs.

Would something like subscribe(Class<T>, Consumer<T>) on EventBus work here? Subscribing by concrete type lets ofType() do the filtering instead of instanceof, and the try/catch sits in the bus once however many subscriptions there are. One caveat: Consumer would need to be io.reactivex.rxjava3.functions.Consumer, since java.util.function.Consumer cannot throw checked exceptions and handlers would go on catching IOException themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants