Comments (5)
What's your mop version? I tested mop master of version and it's working.
- mqtt client subscribe topic
persisten://public/default/helloworld3
andpersisten://public/default/helloworld3/#
- pulsar client send message to topic
persisten://public/default/helloworld3
- all client of mqtt can receive message.
from mop.
mqtt client subscribe topic persisten://public/default/my-topic/# and persisten://public/default/my/+/topic and persisten://public/default/my/topic Report all errors
Sign Will disconnect
eroro:
Connected
reconnectHandler
Connect lost: read tcp 192.168.153.106:50020->192.168.146.17:5682: read: connection reset by peer
Connected
Connect lost: EOF
reconnectHandler
Connected
reconnectHandler
Connect lost: EOF
Connected
code:
"github.com/eclipse/paho.mqtt.golang"
func pulsar_mqtt() {
var broker = "192.168.146.17"
var port = 5682
opts := mqtt.NewClientOptions()
opts.AddBroker(fmt.Sprintf("tcp://%s:%d", broker, port))
opts.SetClientID("go_mqtt_client")
opts.SetUsername("aaaaaa")
opts.SetPassword("eyJhbGciOiJPKmv_nYeo")
opts.SetDefaultPublishHandler(messagePubHandler)
//opts.SetKeepAlive(30 * time.Second)
opts.SetAutoReconnect(true)
// ConnectRetry=true, 这个参数,初始化连接时,会自动重连,等待, 不会打印(panic(token.Error()))导致程序退出,
opts.SetConnectRetry(true)
//opts.SetCleanSession(true)
//opts.SetConnectRetryInterval(5 * time.Second)
//opts.SetMaxReconnectInterval(5 * time.Second)
opts.SetWill("persistent://public/default/my-topic", "abc123456", 1, false)
opts.OnConnect = connectHandler
opts.OnConnectionLost = connectLostHandler
opts.SetReconnectingHandler(reconnectHandler)
client := mqtt.NewClient(opts)
if token := client.Connect(); token.Wait() && token.Error() != nil {
fmt.Println("aaaaaa")
panic(token.Error())
}
sub(client)
select {
}
}
func sub(client mqtt.Client) {
topic := "persisten://public/default/my-topic/#"
token := client.Subscribe(topic, 1, nil)
token.Wait()
fmt.Printf("===Subscribed to topic: %s\n", topic)
}
from mop.
hi, I found that using the mqtt protocol of golang cannot receive the data sent by the pulsar protocol, the package github.com/eclipse/paho.mqtt.golang is used, but the data sent by the pulsar protocol can be received using the mqtt protocol of java, java Bag:
org.fusesource.mqtt-client
mqtt-client
1.16
or
org.springframework.integration
spring-integration-mqtt
5.3.4.RELEASE
Java subscribed topic: persisten://public/default/my-topic/# and persisten://public/default/my/+/topic and persisten://public/default/my/topic This topic does not report an error, But can't subscribe to data
from mop.
I will test again,
- golang mqtt producer send message and java mqtt client subscribe
- golang pulsar producer send message and java mqtt client subscribe
from mop.
After talking with the author, the issue has been fixed. So close it.
from mop.
Related Issues (20)
- Can not support shared subscription
- Connection is null HOT 1
- Flaky-test: SimpleIntegrationTest.testConsumerDisconnectNotMissingMessage
- ping request HOT 2
- IdleStateHandler may be changed when proxy to broker using the same connection HOT 1
- if the connection from proxy to broker is down, it will cause many client connections to be closed HOT 4
- Qos2 Support HOT 2
- memory leak HOT 1
- Topic Grant-Permission Operation caused MQTT Clients Disconnected
- The mqtt plug-in shows that the loading is successful, but ports 5682 and 1833 still fail to listen. HOT 2
- [WIP] MIP-? Introduce new implementation for MoP
- Please redo the lookup. Request is denied: namespace=public/default HOT 2
- OPENSSL_internal:WRONG_VERSION_NUMBER excpetion when using MOP TLS Proxy HOT 1
- MQTT retain publishes do not make it to Pulsar HOT 3
- Readme.md states "only MQTT 3.1.1 supported" but code base seems to indicate MQTT 5 is also supported HOT 1
- LWT does not reach Pulsar topic, short cuts QoSPublishHandlers so Qos nor Retain function properly HOT 2
- Resubscribing on previously unsubscribed topic closes connection HOT 1
- LWT fires on graceful disconnect but not on connection loss HOT 1
- MQTT QOS support level? HOT 1
- Unsubscribed topic, repeatedly kicked out using client connection only. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mop.