Skip to content

unable to subscribe non-persistent topics via regex #12328

@jimmycxm

Description

@jimmycxm

Describe the bug
Java client can subscribe persistent topics via regex, but failed to subscribe non-persistent topics.
After some efforts, I found client calls "/admin/v2/namespaces/{namespaces}/topics?mode=ALL" which can't return non-persistent topics.

To Reproduce
Steps to reproduce the behavior:

  1. Create topics like below:
    bin/pulsar-admin topics create non-persistent://goldwind/iothub/prop_data-BZ-FAST-1min-001
    bin/pulsar-admin topics create non-persistent://goldwind/iothub/prop_data-BZ-FAST-1min-002
    bin/pulsar-admin topics create non-persistent://goldwind/iothub/prop_data-BZ-FAST_Metric-1min-001
    bin/pulsar-admin topics create non-persistent://goldwind/iothub/prop_data-BZ-FAST_Metric-1min-002
    bin/pulsar-admin topics create persistent://goldwind/iothub/prop_data-BZ-GRID-1min-001
    bin/pulsar-admin topics create persistent://goldwind/iothub/prop_data-BZ-GRID-1min-002
    bin/pulsar-admin topics create persistent://goldwind/iothub/prop_data-BZ-GRID_SECTION-1min-001
    bin/pulsar-admin topics create persistent://goldwind/iothub/prop_data-BZ-GRID_SECTION-1min-002
  2. consumer subscribe to
    Pattern.compile("non-persistent://goldwind/iothub/prop_data-(BZ|IT|MK)-FAST-.*")
  3. No topic is subscribed.

Expected behavior
topic below should be matched:
non-persistent://goldwind/iothub/prop_data-BZ-FAST-1min-001
non-persistent://goldwind/iothub/prop_data-BZ-FAST-1min-002
non-persistent://goldwind/iothub/prop_data-BZ-FAST_Metric-1min-001
non-persistent://goldwind/iothub/prop_data-BZ-FAST_Metric-1min-002

Screenshots
Here're the topics.
image
And no non-persistent topics are returned when calling "admin/v2/namespaces/{namespace}topics?mode=NON_PERSISTENT"
image
While non-persistent topics are returned when calling "admin/v2/non-persistent/{namespace}"
image

Desktop (please complete the following information):

  • OS: linux 64.

Additional context
Release 2.7.2 ,2.7.3, 2.8.0 got same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions