i need a auto delete topic, what should i do ?

81 views
Skip to first unread message

Cevin Cheung

unread,
Oct 2, 2018, 9:33:42 AM10/2/18
to nsq-users
for exp: https://github.com/nsqio/nsq/issues/1086#issuecomment-424408265

I need a topic when it's empty and then auto delete.

Pierce Lopez

unread,
Oct 2, 2018, 6:33:49 PM10/2/18
to Cevin Cheung, nsq-users
You get this behavior when you use a topic name with "#emepheral" at
the end, for example

topic = "some_topic_name#ephemeral"

On 9/25/18, Cevin Cheung <cevin....@gmail.com> wrote:
> for exp: https://github.com/nsqio/nsq/issues/1086#issuecomment-424408265
>
> I need a topic when it's empty and then auto delete.


--
- Pierce

Cevin Cheung

unread,
Oct 2, 2018, 7:15:21 PM10/2/18
to nsq-users
not work.
http rest api will ignore url hash #....

在 2018年10月3日星期三 UTC+8上午6:33:49,Pierce Lopez写道:

Pierce Lopez

unread,
Oct 2, 2018, 10:38:10 PM10/2/18
to Cevin Cheung, nsq-users
If you put the topic name into a url parameter, you need to url-encode
it. Example:

$ python3
>>> from urllib.parse import urlencode
>>> urlencode({"topic": "my_topic_name#ephemeral"})
'topic=my_topic_name%23ephemeral'

$ curl "http://127.0.0.1:4151/pub?topic=my_topic_name%23ephemeral"
--data-raw "{message}"

On 10/2/18, Cevin Cheung <cevin....@gmail.com> wrote:
> not work.
> http rest api will ignore url hash #....
>
> 在 2018年10月3日星期三 UTC+8上午6:33:49,Pierce Lopez写道:
>>
>> You get this behavior when you use a topic name with "#emepheral" at
>> the end, for example
>>
>> topic = "some_topic_name#ephemeral"
>>
>> On 9/25/18, Cevin Cheung <cevin....@gmail.com <javascript:>> wrote:
>> > for exp: https://github.com/nsqio/nsq/issues/1086#issuecomment-424408265
>> >
>> >
>> > I need a topic when it's empty and then auto delete.
>>
>>
>> --
>> - Pierce
>>
>


--
- Pierce
Reply all
Reply to author
Forward
0 new messages