Good day all, My sink connector is currently consu...
# general
o
Good day all, My sink connector is currently consuming messages from
public/default/.*
please is there a way to filter what topic it should consume mmessages from through
producer property, subscription name or topic's metadata
, without attaching a constant string to those topics i.e without adding somthing like this
public/default/consume-.*
d
Why can’t you just update the topic regex inside the sink configuration?
o
@David K I can actually, I think the right way to ask this question is, "is it possible to produce a message for a specify subscription, so that a topic that has multiple subcriptions will have distinct backlogs/message count values "
d
The short answer is no. One approach you can take is to have a filtering function on the main source topic that routes the messages to individual topics for each subscriber/consumer; then, the consumers can read directly from these curated topics. pfSQL is one way of implementing this pattern, but it can also be done by writing your own custom routing logic inside a pulsar function, etc.
o
@David K nice, please any code sample/doc/guide on writing filtering function for pulsar topic ?
d
pattern 2 from this blog post, just use whatever logic you want.
You can filter on the message content or the message properties, or both.
o
@David K I need to give you your flower, thank you so very much.
😄 1
@David K 0ne last question please when the message get's produced to a topic of multiple subscriptions, does the function get tiggered for every of this subscriptions or it get triggered just once. if it's triggered multiple times, please what method can I use to detect this among these
d
You only want to have a single subscription on the source topic, and it should belong to the filtering function. All over consumers will read from the output topics of the filtering function
If the downstream consumers need to read from more than one of the output topics, they can use regex subscriptions or just a list of the individual topic names
o
Thank you