You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by Apache Pulsar Slack <ap...@gmail.com> on 2020/05/03 09:11:04 UTC

Slack digest for #dev - 2020-05-03

2020-05-02 22:18:43 UTC - Guilherme Perinazzo: I was looking over the key-shared sub type, and it got me thinking. Could we create a subscription that filters the stream to specific keys? If we have a topic of events, but are only interested in events from a specific key, it would be a bit wasteful in bandwidth to receive every event and filter on the client side.
I have an use case that could use that, it would be perfect if it could also update the filter on the fly without re-creating the consumer.
What's the process to start a discussion about this?
----
2020-05-03 08:10:42 UTC - Penghui Li: Maybe you can try to use reader API and specify `keyHashRange` of the reader.

```    /**
     * Set key hash range of the reader, broker will only dispatch messages which hash of the message key contains by
     * the specified key hash range. Multiple key hash ranges can be specified on a reader.
     *
     * &lt;p&gt;Total hash range size is 65536, so the max end of the range should be less than or equal to 65535.
     *
     * @param ranges
     *            key hash ranges for a reader
     * @return the reader builder instance
     */
    ReaderBuilder&lt;T&gt; keyHashRange(Range... ranges);```
----
2020-05-03 08:13:04 UTC - Penghui Li: There are also other users mentioned support message filter at the broker side.  If you are interested, you can also add this feature to the consumer.
----