novastone-media / MQTT-Client-Framework

iOS, macOS, tvOS native ObjectiveC MQTT Client Framework
Other
1.84k stars 466 forks source link

How to use with ActiveMQ server? #432

Closed niuyongchang closed 6 years ago

niuyongchang commented 6 years ago

Hello, does it work well with ActiveMQ server? If it does, which parameter should be filled with queue. The following is my code, and it not work. self.sessionManager.subscriptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:0] forKey:@"Jaycekon-MQ"];

[self.sessionManager connectTo: @"59.110.29.79" port: 61616 tls: false keepalive: 10 clean: true auth: true user: @"admin" pass: @"admin" will: false willTopic: nil willMsg: nil willQos: 0 willRetainFlag: false withClientId: nil];

ckrey commented 6 years ago

It works well with ActiveMQ

Please check your ActiveMQ configuration. Probably MQTT is on port 1883, not on 61616

        <transportConnectors>
            <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        </transportConnectors>
ckrey commented 6 years ago

I can connect and subscribe with

$ mosquitto_sub -t Jacekon-MQ -v -h 59.110.29.79 -p 1883 -u admin -P admin -d

niuyongchang commented 6 years ago

Thanks for your reply, I try port 1883 and I do connect. But my colleague developing Andriod says he connected sucessfully with port 61616. I am confused.

jcavar commented 6 years ago

Hi @niuyongchang, have you been able to get it working?

niuyongchang commented 6 years ago

@jcavar Not yet. We gave up using ActionMQ.

jcavar commented 6 years ago

I will close this due to inactivity. Feel free to reopen this if you have any more info.