Commit 2b657f5d authored by haoyanbin's avatar haoyanbin

Prod conf

parent 41b31de4
......@@ -8,6 +8,9 @@ import (
var mqUrl = "amqp://admin:Dbc_rabbit_mq123@39.97.234.228:5682/"
//var dbname = "im"
var dbname = "imonline"
// 除了simple 模式外、其他的模式都是由 队列 交换机 key 不同组合实现的
type RabbitMQ struct {
conn *amqp.Connection
......@@ -19,9 +22,9 @@ type RabbitMQ struct {
}
// 创建RabbitMQ 实例
func newRabbitMQ(queueName, exchange, key string) (*RabbitMQ, error) {
func newRabbitMQ(exchange, key string) (*RabbitMQ, error) {
rabbitMQ := &RabbitMQ{
QueueName: queueName,
QueueName: dbname,
Exchange: exchange,
Key: key,
MQUrl: mqUrl,
......
......@@ -29,9 +29,9 @@ func (r *RabbitMQ) PublishSimple(message []byte) {
}
// Step 1. Simple 创建实例
func NewRabbitMQSimple(queueName string) *RabbitMQ {
func NewRabbitMQSimple() *RabbitMQ {
//在simple模式下 exchange and key 都为空
rabbitMQ, err := newRabbitMQ(queueName, "", "")
rabbitMQ, err := newRabbitMQ( "", "")
if err != nil {
fmt.Println("NewRabbitMQSimple err:", err)
return nil
......
......@@ -6,7 +6,8 @@ import (
)
const (
host = "39.96.85.45"
//host = "39.96.85.45"
host = "39.97.179.15"
port = 6382
password = "saas123456"
db = 6
......
......@@ -30,7 +30,7 @@ func main() {
flag.Parse()
pool.RabbitMQ = mq.NewRabbitMQSimple("im")
pool.RabbitMQ = mq.NewRabbitMQSimple()
fmt.Println("rabbitMq start success")
pool.Redis = redis.Init()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment