Closed TiannV closed 4 years ago
you'd batter not do that.
the two services created by mirco.NewService
have same default opts if you donot set them.
like this:
func newOptions(opts ...Option) Options
opt := Options{
Auth: auth.DefaultAuth,
Broker: broker.DefaultBroker,
Cmd: cmd.DefaultCmd,
Config: config.DefaultConfig,
Client: client.DefaultClient,
Server: server.DefaultServer,
Store: store.DefaultStore,
Registry: registry.DefaultRegistry,
Runtime: runtime.DefaultRuntime,
Transport: transport.DefaultTransport,
Context: context.Background(),
Signal: true,
}
so this default opts been inited twice and pinac
This isn't the intended use of micro or micro services in general. You should create them as separate services. Behaviour is undefined if you try to run two in a single process like that.
Example like this:
But, Something is wrong. Is there any better way?