ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Telemetry / Low Latency Messaging / Everyplace » Can't connect to MQTT broker

Post new topic  Reply to topic
 Can't connect to MQTT broker « View previous topic :: View next topic » 
Author Message
Olivier GRACIANNE
PostPosted: Wed Jul 04, 2018 6:30 am    Post subject: Can't connect to MQTT broker Reply with quote

Newbie

Joined: 04 Jul 2018
Posts: 3

Hello,

I'm pretty new in everything about MQTT, and just had some days documenting myself.

Now I want to create an MQTT client using C# and the M2MQTT Library. So I tried the following :
Code:
MqttClient client = new MqttClient(hostName);
to create my client. Then :
Code:
client.MqttMsgPublishReceived = msgReceiveCallback();

to react to messages. Then, obviously :
Code:
client.Connect(Guid.NewGuid().ToString());

which talks pretty good by itself. And eventually :
Code:
client.Subscribe(topics, qosLevels);

which is also pretty clear.

But when I use the web interface of the broker to send a message, the listenners I wrote doesn't trigger.

I think that my client isn't even connected. But though I've looked for a solution the past few days, I can't find out what is not working.

Any idea ?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 04, 2018 9:42 am    Post subject: Re: Can't connect to MQTT broker Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Olivier GRACIANNE wrote:
Hello,

I'm pretty new in everything about MQTT, and just had some days documenting myself.

Now I want to create an MQTT client using C# and the M2MQTT Library. So I tried the following :
Code:
MqttClient client = new MqttClient(hostName);
to create my client. Then :
Code:
client.MqttMsgPublishReceived = msgReceiveCallback();

to react to messages. Then, obviously :
Code:
client.Connect(Guid.NewGuid().ToString());

which talks pretty good by itself. And eventually :
Code:
client.Subscribe(topics, qosLevels);

which is also pretty clear.

But when I use the web interface of the broker to send a message, the listenners I wrote doesn't trigger.

I think that my client isn't even connected. But though I've looked for a solution the past few days, I can't find out what is not working.

Any idea ?

Have you tried running the sample from MQExplorer? Remember that by default your MQTT server is not running.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Olivier GRACIANNE
PostPosted: Wed Jul 04, 2018 11:31 pm    Post subject: Reply with quote

Newbie

Joined: 04 Jul 2018
Posts: 3

Actually, "hostName" in
Code:
new MqttClient(hostName)
hides a real machine hostname, running an MQTT server I can publish and subscribe to through the web interface I mentionned.

Though, I didn't try to run this code in MQExplorer as I don't have one
Back to top
View user's profile Send private message
Olivier GRACIANNE
PostPosted: Thu Jul 05, 2018 1:13 am    Post subject: Reply with quote

Newbie

Joined: 04 Jul 2018
Posts: 3

Fixed.
This was a stupid problem of habilitation. I didn't have access to the machine I was trying to talk to.
Sorry for asking help I was not needing.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jul 05, 2018 1:21 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

Olivier GRACIANNE wrote:
Sorry for asking help I was not needing.

Don't worry about that

Sometimes writing out your problem as a question to others helps in solving it. Amazing how many times that happens.

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Telemetry / Low Latency Messaging / Everyplace » Can't connect to MQTT broker
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.