Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set topology region+zone and send in IDENTIFY msg #312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ type Config struct {
Hostname string `opt:"hostname"`
UserAgent string `opt:"user_agent"`

// Topology hints allow nsqd to prefer same zone and same region consumers
TopologyRegion string `opt:"topology_region"`
TopologyZone string `opt:"topology_zone"`

// Duration of time between heartbeats. This must be less than ReadTimeout
HeartbeatInterval time.Duration `opt:"heartbeat_interval" default:"30s"`
// Integer percentage to sample the channel (requires nsqd 0.2.25+)
Expand Down
2 changes: 2 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ func (c *Conn) identify() (*IdentifyResponse, error) {
ci["output_buffer_timeout"] = int64(c.config.OutputBufferTimeout / time.Millisecond)
}
ci["msg_timeout"] = int64(c.config.MsgTimeout / time.Millisecond)
ci["topology_region"] = c.config.TopologyRegion
ci["topology_zone"] = c.config.TopologyZone
cmd, err := Identify(ci)
if err != nil {
return nil, ErrIdentify{err.Error()}
Expand Down
Loading