You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before opening a new issue, please make sure that there isn't already an open (or closed/resolved) issue reporting the same problem. Please always open a new issue rather than posting to a closed one - but please reference the possibly related old issue.
Please do not insert images of text, but add the text instead.
Environment
VerneMQ Version: 1.12
OS: centos 7
Erlang/OTP version (if building from source):
VerneMQ configuration (vernemq.conf) or the changes from the default:
Cluster size/standalone: 3
Expected behaviour
we want to keep session going on when one node in cluster lost connection
Actual behaviour
we deploy a new load balancer before vmq cluster and
When we use service vernemq stop in the node, our client lost subscribe session, only we resubscribe the message will show.
like this:
Received message: this is msg #58! from topic: vault
Received message: this is msg #59! from topic: vault
Received message: this is msg #60! from topic: vault
Received message: this is msg #61! from topic: vault
Received message: this is msg #62! from topic: vault
Received message: this is msg #63! from topic: vault
Received message: this is msg #64! from topic: vault
Connect lost: EOFConnected
Another new client:
Connected
Received message: this is msg #173! from topic: vault
Received message: this is msg #174! from topic: vault
Received message: this is msg #175! from topic: vault
Received message: this is msg #176! from topic: vault
Received message: this is msg #177! from topic: vault
Received message: this is msg #178! from topic: vault
Received message: this is msg #179! from topic: vault
Received message: this is msg #180! from topic: vault
Received message: this is msg #181! from topic: vault
my test code:
tlsConfig := NewTlsConfig()
opts := mqtt.NewClientOptions()
opts.AddBroker(fmt.Sprintf("ssl://%s:%d", broker, port))
opts.SetClientID("vernemq").SetTLSConfig(tlsConfig)
opts.SetUsername("123")
opts.SetPassword("123")
opts.SetAutoReconnect(true)
opts.SetDefaultPublishHandler(messagePubHandler)
opts.OnConnect = connectHandler
opts.OnConnectionLost = connectLostHandler
client := mqtt.NewClient(opts)
if token := client.Connect(); token.Wait() && token.Error() != nil {
panic(token.Error())
}
// sub(client)
// publish(client)
// go client.Subscribe("vault", 1, nil)
client.Subscribe("$share/group/vault", 1, nil)
i := 0
for range time.Tick(time.Duration(1) * time.Second) {
if i == 5000 {
break
}
text := fmt.Sprintf("this is msg #%d!", i)
client.Publish("vault", 1, false, text)
i++
}
client.Disconnect(250)
}
Question:
How to keep session persistent and share subscribe session in the venermq cluster,
The text was updated successfully, but these errors were encountered:
To help us save time and help you faster
Before opening a new issue, please make sure that there isn't already an open (or closed/resolved) issue reporting the same problem. Please always open a new issue rather than posting to a closed one - but please reference the possibly related old issue.
Please do not insert images of text, but add the text instead.
Environment
Expected behaviour
we want to keep session going on when one node in cluster lost connection
Actual behaviour
we deploy a new load balancer before vmq cluster and
When we use
service vernemq stop
in the node, our client lost subscribe session, only we resubscribe the message will show.like this:
Received message: this is msg #58! from topic: vault
Received message: this is msg #59! from topic: vault
Received message: this is msg #60! from topic: vault
Received message: this is msg #61! from topic: vault
Received message: this is msg #62! from topic: vault
Received message: this is msg #63! from topic: vault
Received message: this is msg #64! from topic: vault
Connect lost: EOFConnected
Another new client:
Connected
Received message: this is msg #173! from topic: vault
Received message: this is msg #174! from topic: vault
Received message: this is msg #175! from topic: vault
Received message: this is msg #176! from topic: vault
Received message: this is msg #177! from topic: vault
Received message: this is msg #178! from topic: vault
Received message: this is msg #179! from topic: vault
Received message: this is msg #180! from topic: vault
Received message: this is msg #181! from topic: vault
my test code:
}
Question:
How to keep session persistent and share subscribe session in the venermq cluster,
The text was updated successfully, but these errors were encountered: