Re: [DISCUSS] PIP-258: Deprecation of the consumer subscribeTopicMode configuration

2023-03-26 Thread Baodi Shi
>
> I think we don't need to do such changes. Instead, we should fix the
> documentation of `ConsumerBuilder#topicsPattern`. From the
> implementation here [1], the prefix before "://" in the topic pattern
> should be ignored.
>


Agree, We can also add the warn log when the user-configured pattern
contains a domain(‘persistent://public/default/topic
.*')

We can close that PIP and discuss.

Thanks,
Baodi Shi


在 2023年3月24日 19:40:15 上,Yunze Xu  写道:

> I think we don't need to do such changes. Instead, we should fix the
> documentation of `ConsumerBuilder#topicsPattern`. From the
> implementation here [1], the prefix before "://" in the topic pattern
> should be ignored.
>
> [1]
> https://github.com/apache/pulsar/blob/f1f8dab972b098be69ad35ab3d307f19284c4e48/pulsar-common/src/main/java/org/apache/pulsar/common/topics/TopicList.java#L56
>
> Thanks,
> Yunze
>
> On Mon, Mar 20, 2023 at 9:32 AM Baodi Shi  wrote:
>
>
> >
>
> > Should we state in the PIP which version it will be removed?
>
> >
>
>
> I think adding is best, but I'm not quite sure which version we should be
>
> specific to. How about v3.2.0? Wait for 2 major versions (3.0.0 and 3.1.0)
>
>
> Thanks,
>
> Baodi Shi
>
>
>
> 在 2023年3月17日 15:16:19 上,Zike Yang  写道:
>
>
> > LGTM. +1
>
> > It will make the API clearer without bringing breaking changes.
>
> >
>
> >  After the configuration is removed in subsequent versions, it will be
>
> > clearer
>
> >
>
> >
>
> > Should we state in the PIP which version it will be removed?
>
> >
>
> > Thanks,
>
> > Zike Yang
>
> >
>
> > On Fri, Mar 17, 2023 at 8:50 AM Baodi Shi  wrote:
>
> >
>
> >
>
> > Hi, Any ideas please discuss, thanks.
>
> >
>
> >
>
> > Thanks,
>
> >
>
> > Baodi Shi
>
> >
>
> >
>
> >
>
> > 在 2023年3月13日 22:24:09 上,Baodi Shi  写道:
>
> >
>
> >
>
> > > Hi all,
>
> >
>
> > >
>
> >
>
> > > I've started a PIP to discuss: PIP-258: Deprecation of the consumer
>
> >
>
> > > subscribeTopicMode configuration
>
> >
>
> > >
>
> >
>
> > > ### Motivation
>
> >
>
> > >
>
> >
>
> > > About pattern subscribes of consumers, the `topicsPattern` and
>
> >
>
> > > `subscribeTopicMode` configurations are contradictory.
>
> >
>
> > >
>
> >
>
> > > For example, the `topicsPattern` represents only subscription to
>
> >
>
> > > `persistent topic`, but the `subscriptionTopicsMode` represents
>
> >
>
> > > subscription to `all topic`.
>
> >
>
> > >
>
> >
>
> > > ``` java
>
> >
>
> > > Pattern pattern =
>
> >
>
> > > Pattern.compile("persistent://my-property/my-ns/pattern-topic.*");
>
> >
>
> > > Consumer consumer = pulsarClient.newConsumer()
>
> >
>
> > > .topicsPattern(pattern)
>
> >
>
> > > .subscriptionTopicsMode(RegexSubscriptionMode.AllTopics)
>
> >
>
> > > .build();
>
> >
>
> > > ```
>
> >
>
> > >
>
> >
>
> > > Finally, `all topics` are subscribed. It's very confusing.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > For more details, please read the PIP at
>
> >
>
> > > https://github.com/apache/pulsar/issues/19798
>
> >
>
> > > <https://github.com/apache/pulsar/issues/19601>
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Thanks,
>
> >
>
> > > Baodi Shi
>
> >
>
> > >
>
> >
>
> >
>
>


Re: [DISCUSS] PIP-258: Deprecation of the consumer subscribeTopicMode configuration

2023-03-24 Thread Yunze Xu
I think we don't need to do such changes. Instead, we should fix the
documentation of `ConsumerBuilder#topicsPattern`. From the
implementation here [1], the prefix before "://" in the topic pattern
should be ignored.

[1] 
https://github.com/apache/pulsar/blob/f1f8dab972b098be69ad35ab3d307f19284c4e48/pulsar-common/src/main/java/org/apache/pulsar/common/topics/TopicList.java#L56

Thanks,
Yunze

On Mon, Mar 20, 2023 at 9:32 AM Baodi Shi  wrote:
>
> >
> > Should we state in the PIP which version it will be removed?
> >
>
> I think adding is best, but I'm not quite sure which version we should be
> specific to. How about v3.2.0? Wait for 2 major versions (3.0.0 and 3.1.0)
>
> Thanks,
> Baodi Shi
>
>
> 在 2023年3月17日 15:16:19 上,Zike Yang  写道:
>
> > LGTM. +1
> > It will make the API clearer without bringing breaking changes.
> >
> >  After the configuration is removed in subsequent versions, it will be
> > clearer
> >
> >
> > Should we state in the PIP which version it will be removed?
> >
> > Thanks,
> > Zike Yang
> >
> > On Fri, Mar 17, 2023 at 8:50 AM Baodi Shi  wrote:
> >
> >
> > Hi, Any ideas please discuss, thanks.
> >
> >
> > Thanks,
> >
> > Baodi Shi
> >
> >
> >
> > 在 2023年3月13日 22:24:09 上,Baodi Shi  写道:
> >
> >
> > > Hi all,
> >
> > >
> >
> > > I've started a PIP to discuss: PIP-258: Deprecation of the consumer
> >
> > > subscribeTopicMode configuration
> >
> > >
> >
> > > ### Motivation
> >
> > >
> >
> > > About pattern subscribes of consumers, the `topicsPattern` and
> >
> > > `subscribeTopicMode` configurations are contradictory.
> >
> > >
> >
> > > For example, the `topicsPattern` represents only subscription to
> >
> > > `persistent topic`, but the `subscriptionTopicsMode` represents
> >
> > > subscription to `all topic`.
> >
> > >
> >
> > > ``` java
> >
> > > Pattern pattern =
> >
> > > Pattern.compile("persistent://my-property/my-ns/pattern-topic.*");
> >
> > > Consumer consumer = pulsarClient.newConsumer()
> >
> > > .topicsPattern(pattern)
> >
> > > .subscriptionTopicsMode(RegexSubscriptionMode.AllTopics)
> >
> > > .build();
> >
> > > ```
> >
> > >
> >
> > > Finally, `all topics` are subscribed. It's very confusing.
> >
> > >
> >
> > >
> >
> > > For more details, please read the PIP at
> >
> > > https://github.com/apache/pulsar/issues/19798
> >
> > > <https://github.com/apache/pulsar/issues/19601>
> >
> > >
> >
> > >
> >
> > > Thanks,
> >
> > > Baodi Shi
> >
> > >
> >
> >


Re: [DISCUSS] PIP-258: Deprecation of the consumer subscribeTopicMode configuration

2023-03-19 Thread Baodi Shi
>
> Should we state in the PIP which version it will be removed?
>

I think adding is best, but I'm not quite sure which version we should be
specific to. How about v3.2.0? Wait for 2 major versions (3.0.0 and 3.1.0)

Thanks,
Baodi Shi


在 2023年3月17日 15:16:19 上,Zike Yang  写道:

> LGTM. +1
> It will make the API clearer without bringing breaking changes.
>
>  After the configuration is removed in subsequent versions, it will be
> clearer
>
>
> Should we state in the PIP which version it will be removed?
>
> Thanks,
> Zike Yang
>
> On Fri, Mar 17, 2023 at 8:50 AM Baodi Shi  wrote:
>
>
> Hi, Any ideas please discuss, thanks.
>
>
> Thanks,
>
> Baodi Shi
>
>
>
> 在 2023年3月13日 22:24:09 上,Baodi Shi  写道:
>
>
> > Hi all,
>
> >
>
> > I've started a PIP to discuss: PIP-258: Deprecation of the consumer
>
> > subscribeTopicMode configuration
>
> >
>
> > ### Motivation
>
> >
>
> > About pattern subscribes of consumers, the `topicsPattern` and
>
> > `subscribeTopicMode` configurations are contradictory.
>
> >
>
> > For example, the `topicsPattern` represents only subscription to
>
> > `persistent topic`, but the `subscriptionTopicsMode` represents
>
> > subscription to `all topic`.
>
> >
>
> > ``` java
>
> > Pattern pattern =
>
> > Pattern.compile("persistent://my-property/my-ns/pattern-topic.*");
>
> > Consumer consumer = pulsarClient.newConsumer()
>
> > .topicsPattern(pattern)
>
> > .subscriptionTopicsMode(RegexSubscriptionMode.AllTopics)
>
> > .build();
>
> > ```
>
> >
>
> > Finally, `all topics` are subscribed. It's very confusing.
>
> >
>
> >
>
> > For more details, please read the PIP at
>
> > https://github.com/apache/pulsar/issues/19798
>
> > <https://github.com/apache/pulsar/issues/19601>
>
> >
>
> >
>
> > Thanks,
>
> > Baodi Shi
>
> >
>
>


Re: [DISCUSS] PIP-258: Deprecation of the consumer subscribeTopicMode configuration

2023-03-17 Thread Zike Yang
LGTM. +1
It will make the API clearer without bringing breaking changes.

>  After the configuration is removed in subsequent versions, it will be clearer

Should we state in the PIP which version it will be removed?

Thanks,
Zike Yang

On Fri, Mar 17, 2023 at 8:50 AM Baodi Shi  wrote:
>
> Hi, Any ideas please discuss, thanks.
>
> Thanks,
> Baodi Shi
>
>
> 在 2023年3月13日 22:24:09 上,Baodi Shi  写道:
>
> > Hi all,
> >
> > I've started a PIP to discuss: PIP-258: Deprecation of the consumer
> > subscribeTopicMode configuration
> >
> > ### Motivation
> >
> > About pattern subscribes of consumers, the `topicsPattern` and
> > `subscribeTopicMode` configurations are contradictory.
> >
> > For example, the `topicsPattern` represents only subscription to
> > `persistent topic`, but the `subscriptionTopicsMode` represents
> > subscription to `all topic`.
> >
> > ``` java
> > Pattern pattern =
> > Pattern.compile("persistent://my-property/my-ns/pattern-topic.*");
> > Consumer consumer = pulsarClient.newConsumer()
> > .topicsPattern(pattern)
> > .subscriptionTopicsMode(RegexSubscriptionMode.AllTopics)
> > .build();
> > ```
> >
> > Finally, `all topics` are subscribed. It's very confusing.
> >
> >
> > For more details, please read the PIP at
> > https://github.com/apache/pulsar/issues/19798
> > <https://github.com/apache/pulsar/issues/19601>
> >
> >
> > Thanks,
> > Baodi Shi
> >


Re: [DISCUSS] PIP-258: Deprecation of the consumer subscribeTopicMode configuration

2023-03-16 Thread Baodi Shi
Hi, Any ideas please discuss, thanks.

Thanks,
Baodi Shi


在 2023年3月13日 22:24:09 上,Baodi Shi  写道:

> Hi all,
>
> I've started a PIP to discuss: PIP-258: Deprecation of the consumer
> subscribeTopicMode configuration
>
> ### Motivation
>
> About pattern subscribes of consumers, the `topicsPattern` and
> `subscribeTopicMode` configurations are contradictory.
>
> For example, the `topicsPattern` represents only subscription to
> `persistent topic`, but the `subscriptionTopicsMode` represents
> subscription to `all topic`.
>
> ``` java
> Pattern pattern =
> Pattern.compile("persistent://my-property/my-ns/pattern-topic.*");
> Consumer consumer = pulsarClient.newConsumer()
> .topicsPattern(pattern)
> .subscriptionTopicsMode(RegexSubscriptionMode.AllTopics)
> .build();
> ```
>
> Finally, `all topics` are subscribed. It's very confusing.
>
>
> For more details, please read the PIP at
> https://github.com/apache/pulsar/issues/19798
> <https://github.com/apache/pulsar/issues/19601>
>
>
> Thanks,
> Baodi Shi
>


[DISCUSS] PIP-258: Deprecation of the consumer subscribeTopicMode configuration

2023-03-13 Thread Baodi Shi
Hi all,

I've started a PIP to discuss: PIP-258: Deprecation of the consumer
subscribeTopicMode configuration

### Motivation

About pattern subscribes of consumers, the `topicsPattern` and
`subscribeTopicMode` configurations are contradictory.

For example, the `topicsPattern` represents only subscription to
`persistent topic`, but the `subscriptionTopicsMode` represents
subscription to `all topic`.

``` java
Pattern pattern =
Pattern.compile("persistent://my-property/my-ns/pattern-topic.*");
Consumer consumer = pulsarClient.newConsumer()
.topicsPattern(pattern)
.subscriptionTopicsMode(RegexSubscriptionMode.AllTopics)
.build();
```

Finally, `all topics` are subscribed. It's very confusing.


For more details, please read the PIP at
https://github.com/apache/pulsar/issues/19798
<https://github.com/apache/pulsar/issues/19601>


Thanks,
Baodi Shi