refactor: reorganize modules and add Linux build tooling
This commit is contained in:
24
module/ec/delivery/internal/impl/mq.go
Normal file
24
module/ec/delivery/internal/impl/mq.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package impl
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.apinb.com/bsm-sdk/engine/print"
|
||||
"git.apinb.com/bsm-sdk/engine/queue/pulsar"
|
||||
"git.apinb.com/bsm-sdk/engine/vars"
|
||||
)
|
||||
|
||||
var MQ *pulsar.Pulsar
|
||||
|
||||
func withPulsar() {
|
||||
if Configure.Pulsar.IsHas() {
|
||||
mq, err := pulsar.NewPulsar(&Configure.Pulsar)
|
||||
if err != nil {
|
||||
print.Fail("[Blocks Service] %s Pulsar Error: %d", vars.ServiceKey, err.Error())
|
||||
os.Exit(0)
|
||||
} else {
|
||||
MQ = mq
|
||||
print.Info("[Blocks Service] %s Queue/Pulsar Endpoint: %s", vars.ServiceKey, Configure.Pulsar.Endpoints)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user