brainlag / JavaNSQClient

Fast Java client for NSQ
MIT License
90 stars 57 forks source link

Unable to connect lookup #12

Closed Loveflowers closed 8 years ago

Loveflowers commented 8 years ago

Hi!brainlag. I use your 'nsq-client' in my clojure-project. But I can not connect to lookup. The code is as follow: (import com.github.brainlag.nsq.lookup.DefaultNSQLookup) => com.github.brainlag.nsq.lookup.DefaultNSQLookup (def nsq-lookup (DefaultNSQLookup.)) => #'nsq-tester.core/nsq-lookup (.addLookupAddress nsq-lookup "127.0.0.1" 4161) => nil (.lookup nsq-lookup "testss") 17:28:42.004 WARN Unable to connect to address http://127.0.0.1:4161 - DefaultNSQLookup.lookup 17:28:42.004 WARN Unable to connect to any NSQ Lookup servers, servers tried: [http://127.0.0.1:4161] - DefaultNSQLookup.lookup
=> #{}

I run this code on the repl. the nsq is deployed on my PC.

brainlag commented 8 years ago

Can you open it in the browser?

Loveflowers commented 8 years ago

Yes!And I can produce successfully with the 'NSQProducer'.

sundy-li commented 8 years ago

I also face this problem when using in java.

13:26:21.591 WARN  Unable to connect to address http://192.168.10.41:4161 - DefaultNSQLookup.lookup 
13:26:21.591 WARN  Unable to connect to any NSQ Lookup servers, servers tried: [http://192.168.10.41:4161] - DefaultNSQLookup.lookup 
13:26:21.592 WARN  No NSQLookup server connections or topic does not exist. - NSQConsumer.connect 
13:26:51.516 INFO  HEARTBEAT! - Connection.heartbeat 
13:26:51.540 INFO  HEARTBEAT! - Connection.heartbeat 
13:27:21.516 INFO  HEARTBEAT! - Connection.heartbeat 
13:27:21.539 INFO  HEARTBEAT! - Connection.heartbeat 
13:27:21.596 WARN  Unable to connect to address http://192.168.10.41:4161 - DefaultNSQLookup.lookup 
13:27:21.596 WARN  Unable to connect to any NSQ Lookup servers, servers tried: [http://192.168.10.41:4161] - DefaultNSQLookup.lookup 
13:27:21.596 WARN  No NSQLookup server connections or topic does not exist. - NSQConsumer.connect 
13:27:51.516 INFO  HEARTBEAT! - Connection.heartbeat 
13:27:51.539 INFO  HEARTBEAT! - Connection.heartbeat 
13:28:21.516 INFO  HEARTBEAT! - Connection.heartbeat 
13:28:21.537 INFO  HEARTBEAT! - Connection.heartbeat 

the log is repeated every 30 seconds.

The consumers and producers works fine for now. How the log happens..

brainlag commented 8 years ago

13:27:21.596 WARN No NSQLookup server connections or topic does not exist. The topic your consumer subscribed to does not exists. When you produce a message to that topic then the topic should be created and the consumer should recover automatically.

The heartbeats should be traces ...

sundy-li commented 8 years ago

I see that, I didnot produce message to that topic that causes the log.