strip broker address
This commit is contained in:
parent
5f664faeba
commit
c1097a4509
@ -3,11 +3,10 @@ package broker
|
||||
|
||||
// Broker is an interface used for asynchronous messaging.
|
||||
type Broker interface {
|
||||
Init(...Option) error
|
||||
Options() Options
|
||||
Address() string
|
||||
Connect() error
|
||||
Disconnect() error
|
||||
Init(...Option) error
|
||||
Publish(string, *Message, ...PublishOption) error
|
||||
Subscribe(string, Handler, ...SubscribeOption) (Subscriber, error)
|
||||
String() string
|
||||
|
@ -403,6 +403,7 @@ func (h *httpBroker) Connect() error {
|
||||
go func() {
|
||||
h.run(l)
|
||||
h.Lock()
|
||||
h.opts.Addrs = []string{addr}
|
||||
h.address = addr
|
||||
h.Unlock()
|
||||
}()
|
||||
|
@ -714,7 +714,10 @@ func (g *grpcServer) Start() error {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Logf("Broker [%s] Listening on %s", config.Broker.String(), config.Broker.Address())
|
||||
baddr := strings.Join(config.Broker.Options().Addrs, ",")
|
||||
bname := config.Broker.String()
|
||||
|
||||
log.Logf("Broker [%s] Listening on %s", bname, baddr)
|
||||
|
||||
// announce self to the world
|
||||
if err := g.Register(); err != nil {
|
||||
|
@ -500,7 +500,10 @@ func (s *rpcServer) Start() error {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Logf("Broker [%s] Connected to %s", config.Broker.String(), config.Broker.Address())
|
||||
baddr := strings.Join(config.Broker.Options().Addrs, ",")
|
||||
bname := config.Broker.String()
|
||||
|
||||
log.Logf("Broker [%s] Connected to %s", bname, baddr)
|
||||
|
||||
// use RegisterCheck func before register
|
||||
if err = s.opts.RegisterCheck(s.opts.Context); err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user