Click here to Skip to main content
15,072,627 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I am running a windows service which is subscribing for a "XYZ" topic to a MQTT broker. Service also contains MessagePublishReceived Event which is logging the received message from Mqtt Broker. I am able to run this windows service but the problem i am facing is the MessagePublishReceived event is triggered only once. Even when there is new publish from the Mqtt broker my windows service is unable to fire the MessagePublishReceived Event. Any Help in this regard is very much apreciated.

What I have tried:

I have tried changing the Qos and RetainMessage flag in the publish.Still no luck.
Posted
Updated 21-Dec-17 1:51am

1 solution

Make sure in your startup code for the windows service that you are keeping a reference of any key objects (e.g. control classes) so that they don't get immediately disposed again once the scope leaves the start event.
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900