question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

event filtering beyond Java Type based filter

See original GitHub issue

Hi, all, Can event bus dispatch events beyond Java Type based filter? For example, I have the following scenario. QuoteEventListener only want to listen events filtering by ticker instead of just java type QuoteEvent.class.

// stock quote event
public class QuoteEvent {
    private final String ticker;
    private final double price;
    public QuoteEvent(String ticker_, double price_) {
        ticker = ticker_;
        price = price_;
    }
    public String getTicker() {
        return ticker;
    }
    public double getPrice() {
        return price;
    }
}

QuoteEventListener listener1 = new QuoteEventListener("MSFT");
QuoteEventListener listener2 = new QuoteEventListener("GOOG");


EventBus eventBus = new EventBus("feeder");
eventBus.post(new QuoteEvent("MSFT", 12.34)); // only listener1 will be notified
eventBus.post(new QuoteEvent("GOOG", 12.34)); // only listener2 will be notified

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lowassercommented, Apr 21, 2016

Is there a reason you couldn’t do this filtering in the listener itself?

0reactions
cpovirkcommented, Jul 25, 2019

Realistically, we’re unlikely to add functionality to EventBus at this point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Lambda now supports event filtering for Amazon SQS ...
AWS Lambda now provides content filtering options for SQS, DynamoDB and Kinesis as event sources. With event pattern content filtering, ...
Read more >
How to filter events in Jersey SSE? - java - Stack Overflow
It is very simple app that has one input and one button. You type some text, click the button and other people get...
Read more >
Event Filters - ITOM Practitioner Portal - Micro Focus
You can limit the set of events displayed in the Event Browser using filters that you define to display a subset of the...
Read more >
3 Working with Event Filters (Release 8)
Event filters enable you to handle an event during the event capturing phase of event processing. A node can have one or more...
Read more >
How to use map, filter, and collect methods in Java Stream ...
The filter method essentially selects elements based upon a condition you provide. That's the reason that the filter ( Predicate condition) accepts a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found