# clear for my_subscription under my_namespace in all topicsbin/pulsar-adminnamespacesclear-backlog"my_tenant/my_namespace"--force-s"my_subscription"# clear for topicbin/pulsar-admintopicsclear-backlog"persistent://my_tenant/my_namespace/my_topic"--subscription"my_subscription";# loop all partitioned-topics in namespace and clear-backlogforone_topicin$(bin/pulsar-admintopicslist-partitioned-topics"my_tenant/my_namespace");do(forone_subin$(bin/pulsar-admintopicssubscriptions"$one_topic");dobin/pulsar-admintopicsclear-backlog$one_topic--subscription$one_sub;echo"$one_topic : $one_sub";done);done
bin/pulsar-admintopicsskip--count1--subscriptionmy_subscription"persistent://my_tenant/my_namespace/my_topic"# skip all message in all non-partitioned topic in namespaceforone_topicin$(bin/pulsar-admintopicslist"my_tenant/my_namespace");do(forone_subin$(bin/pulsar-admintopicssubscriptions"$one_topic");dobin/pulsar-admintopicsskip--count9999999--subscription$one_sub$one_topic;echo"$one_topic : $one_sub";done);done