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.
|
// Broker is an interface used for asynchronous messaging.
|
||||||
type Broker interface {
|
type Broker interface {
|
||||||
|
Init(...Option) error
|
||||||
Options() Options
|
Options() Options
|
||||||
Address() string
|
|
||||||
Connect() error
|
Connect() error
|
||||||
Disconnect() error
|
Disconnect() error
|
||||||
Init(...Option) error
|
|
||||||
Publish(string, *Message, ...PublishOption) error
|
Publish(string, *Message, ...PublishOption) error
|
||||||
Subscribe(string, Handler, ...SubscribeOption) (Subscriber, error)
|
Subscribe(string, Handler, ...SubscribeOption) (Subscriber, error)
|
||||||
String() string
|
String() string
|
||||||
|
@ -403,6 +403,7 @@ func (h *httpBroker) Connect() error {
|
|||||||
go func() {
|
go func() {
|
||||||
h.run(l)
|
h.run(l)
|
||||||
h.Lock()
|
h.Lock()
|
||||||
|
h.opts.Addrs = []string{addr}
|
||||||
h.address = addr
|
h.address = addr
|
||||||
h.Unlock()
|
h.Unlock()
|
||||||
}()
|
}()
|
||||||
|
@ -714,7 +714,10 @@ func (g *grpcServer) Start() error {
|
|||||||
return err
|
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
|
// announce self to the world
|
||||||
if err := g.Register(); err != nil {
|
if err := g.Register(); err != nil {
|
||||||
|
@ -500,7 +500,10 @@ func (s *rpcServer) Start() error {
|
|||||||
return err
|
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
|
// use RegisterCheck func before register
|
||||||
if err = s.opts.RegisterCheck(s.opts.Context); err != nil {
|
if err = s.opts.RegisterCheck(s.opts.Context); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user