-
Notifications
You must be signed in to change notification settings - Fork 14
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
Pluggable Streamer Prototype in Java #85
base: main
Are you sure you want to change the base?
Changes from 1 commit
8dd16eb
bec69ac
7bcd7e8
a9e46f4
bb09183
6289d26
6e19af5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,9 +81,9 @@ public UStatus addForwardingRule(Route in, Route out) { | |
} | ||
|
||
TransportListener listener = new TransportListener(in, out); | ||
UUri uri = UUri.newBuilder().setAuthority(out.getAuthority()).build(); | ||
UUri out_uri = UUri.newBuilder().setAuthority(out.getAuthority()).build(); | ||
|
||
UStatus result = in.getTransport().registerListener(uri, listener); | ||
UStatus result = in.getTransport().registerListener(out_uri, listener); | ||
|
||
if (result.getCode() != UCode.OK) { | ||
return result; | ||
|
@@ -112,6 +112,13 @@ public UStatus deleteForwardingRule(Route in, Route out) { | |
return UStatus.newBuilder().setCode(UCode.INVALID_ARGUMENT).build(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. who cares? if you can't delete, if there is nothing to delete, it is fine. |
||
} | ||
|
||
|
||
// Unregister the listener with the transport | ||
listeners.stream() | ||
.filter(p -> p.getInputRoute().equals(in) && p.getOutputRoute().equals(out)) | ||
.forEach(p -> in.getTransport().unregisterListener(UUri.newBuilder().setAuthority(out.getAuthority()).build(), p)); | ||
stevenhartley marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if unregister fails? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocking behaviour of the unregister method depends on its implementation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now this is only pseudo code and not intended to be used to build an actual streamer. |
||
|
||
// Remove the listener from the list | ||
if (listeners.removeIf(p -> p.getInputRoute().equals(in) && p.getOutputRoute().equals(out))) { | ||
return UStatus.newBuilder().setCode(UCode.OK).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.
I am recalling @sophokles73's feedback from about a week ago as I was implementing
up-streamer-rust
.It seems to me this would nab you the Request, Response, and Notification messages headed to
out.getAuthority()
, but not Publish messages originating fromin.getAuthority()
.I think we may need to modify:
and add:
and make some corresponding changes to
TransportListener
to allow us to configure it for dropping Publish messages or all non-Publish messages.Still tooling around with this over on
up-streamer-rust
, but wanted to make this comment before I forget 🙂