You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Christopher Shannon <ch...@gmail.com> on 2017/09/06 16:37:54 UTC
Artemis wildcard matching bug
I noticed a difference with wildcard matching in Artemis from 5.x and I
think the Artemis version is wrong.
Let's take the following wildcard pattern as an example in Artemis:
*a.b.c.#*
Pattern Matches?
a.b.c yes
a.b.c.d yes
a.b.cabd yes
Example in ActiveMQ 5.x: *a.b.c.>*
Pattern Matches?
a.b.c yes
a.b.c.d yes
a.b.cabd no
It does not make sense to me that a.b.cabd would match a.b.c.#. This
happens because the matching logic just replaces .# with .* in a regex
matching pattern so it matches 0 or many characters. There is a delimiter
there so I think the 5.x approach is correct. Also maybe we should allow
user's to be able to plug in custom matching logic to override the default?
(This is something i can do in a PR)
Thoughts?
Re: Artemis wildcard matching bug
Posted by Christopher Shannon <ch...@gmail.com>.
I'll create a Jira tomorrow and submit a PR.
On Wed, Sep 6, 2017 at 12:52 PM, Timothy Bish <ta...@gmail.com> wrote:
> On 09/06/2017 12:37 PM, Christopher Shannon wrote:
>
>> I noticed a difference with wildcard matching in Artemis from 5.x and I
>> think the Artemis version is wrong.
>>
>> Let's take the following wildcard pattern as an example in Artemis:
>> *a.b.c.#*
>>
>> Pattern Matches?
>> a.b.c yes
>> a.b.c.d yes
>> a.b.cabd yes
>>
>> Example in ActiveMQ 5.x: *a.b.c.>*
>>
>> Pattern Matches?
>> a.b.c yes
>> a.b.c.d yes
>> a.b.cabd no
>>
>> It does not make sense to me that a.b.cabd would match a.b.c.#. This
>> happens because the matching logic just replaces .# with .* in a regex
>> matching pattern so it matches 0 or many characters. There is a delimiter
>> there so I think the 5.x approach is correct. Also maybe we should allow
>> user's to be able to plug in custom matching logic to override the
>> default?
>> (This is something i can do in a PR)
>>
>> Thoughts?
>>
>> Agreed, ignoring the dot seems unintuitive / wrong to me.
>
> --
> Tim Bish
> twitter: @tabish121
> blog: http://timbish.blogspot.com/
>
>
Re: Artemis wildcard matching bug
Posted by Timothy Bish <ta...@gmail.com>.
On 09/06/2017 12:37 PM, Christopher Shannon wrote:
> I noticed a difference with wildcard matching in Artemis from 5.x and I
> think the Artemis version is wrong.
>
> Let's take the following wildcard pattern as an example in Artemis:
> *a.b.c.#*
>
> Pattern Matches?
> a.b.c yes
> a.b.c.d yes
> a.b.cabd yes
>
> Example in ActiveMQ 5.x: *a.b.c.>*
>
> Pattern Matches?
> a.b.c yes
> a.b.c.d yes
> a.b.cabd no
>
> It does not make sense to me that a.b.cabd would match a.b.c.#. This
> happens because the matching logic just replaces .# with .* in a regex
> matching pattern so it matches 0 or many characters. There is a delimiter
> there so I think the 5.x approach is correct. Also maybe we should allow
> user's to be able to plug in custom matching logic to override the default?
> (This is something i can do in a PR)
>
> Thoughts?
>
Agreed, ignoring the dot seems unintuitive / wrong to me.
--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/
Re: Artemis wildcard matching bug
Posted by Clebert Suconic <cl...@gmail.com>.
Makes sense to me.
I hope it's not a version compatibility breaker thought.
On Wed, Sep 6, 2017 at 12:39 PM Christopher Shannon <
christopher.l.shannon@gmail.com> wrote:
> I noticed a difference with wildcard matching in Artemis from 5.x and I
> think the Artemis version is wrong.
>
> Let's take the following wildcard pattern as an example in Artemis:
> *a.b.c.#*
>
> Pattern Matches?
> a.b.c yes
> a.b.c.d yes
> a.b.cabd yes
>
> Example in ActiveMQ 5.x: *a.b.c.>*
>
> Pattern Matches?
> a.b.c yes
> a.b.c.d yes
> a.b.cabd no
>
> It does not make sense to me that a.b.cabd would match a.b.c.#. This
> happens because the matching logic just replaces .# with .* in a regex
> matching pattern so it matches 0 or many characters. There is a delimiter
> there so I think the 5.x approach is correct. Also maybe we should allow
> user's to be able to plug in custom matching logic to override the default?
> (This is something i can do in a PR)
>
> Thoughts?
>
--
Clebert Suconic