Closed mschneider82 closed 8 years ago
the urlencode is only needed when using jruby 1.9, the uri.query
is checked there and raises a InvalidComponentError
if there is a #
in the query.
@mschneider82 Ahh, that makes sense! I'll add it back in and bump the version. Thanks!
Hi again,
by using #ephemeral suffix in a channel or topicname, nsq discards message overflow (rather than write to disk) and the topic or channel disappears when there are no longer clients subscribed.
In nsq-ruby we have issues discovering topics with the #ephemeral suffix (eg. topic name: test#ephemeral), nsq-ruby uses
URI
to connect to the nsqlookupd http interface.looking at the code
nsq-ruby/lib/nsq/discovery.rb:73
it doesn't urlencode the#{topic}
With enabled debugging
nsqlookupd -verbose
we can see that the client library just asks thensqlookupd
for topic "test" but it should be "test%23ephemeral"