Are there any plans to support MQTT Protocol?
RT:Are there any plans to add MQTT Protocol?
I have a prototype of it but it's not on the top of the priorities list right now. Are you looking for a service side programming model for MQTT? Are you looking for a way to use Hubs as MQTT? That would help us understand what the intended usage is.
Use in IoT devices, which is the advantage of MQTT
@gujunxiong I get that, I'm asking what exactly you are looking for. What sorta code do you want to write on both the client and the server?
Client:
- Communication using the class library of the MQTT standard protocol
- Through SIGNALR Client Agent to MQTT server Server:
- Handling the message event, authentication, agent to MQTT server;
- is itself a MQTT server
Sorry, my English is very bad. --from Microsoft translation
RPC over MQTT doesn't seem like a great fit so I'm not sure if it would match SignalR semantics. We could look at what it would take regardless to see if it makes sense.
That will be compatible with mixed protocols. Automatically identify the content of the protocol and handle it accordingly
I'm not sure what you mean. I'm sure it could be done but I don't know if it makes sense. The calling pattern for SignalR Hubs isn't pub/sub though I'm sure it could be made to work.
Using SIGNALR client or MQTT client, send message to SIGNALR server, If SIGNALR server is not MQTT server, you can let it do proxy services to MQTT server, So Signalr Clinet and MQTT client can receive messages at the same time.
Supports both IoT and web,A service, multi - platform compatible
@gujunxiong if you'd like to contribute that would be great. Here's the hub protocol https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md. A good first step would be helping us figure out what it would look like using MQTT. What do each of the frames look like, and how would they be interpreted by the MQTT client and SignalR server.
Some inspiration http://docs.gadgetkeeper.com/display/docs/JSON-RPC+over+MQTT
Mainly according to the protocol header for processing adaptation, through the server middleware to identify the protocol forwarded to the Hub. Unfortunately, I don't have the ability to do this right now.
No problem. Helping us brainstorm would be good enough. I don't think it needs to be a separate middleware but we'd need to figure out what messages would look like. Maybe it's just PUBLISH both ways with a JSON/Binary payload saying which hub to invoke. SUBSCRIBE doesn't seem to make much sense.
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
Subscription is still necessary, after all, this is an advantage on the IoT, just request the message on demand. SIGNALR already supports HTTP, WebSocket, and if it supports MQTT, it's a very powerful service.
look here, Using WebSocket as a network transport http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718127
What would you be subscribing to? Specific client method callbacks? The hub itself?
MQTT and websockets aren't in the same category. Mqtt is framing on top of a steam of bytes. You can do mqtt on top of web sockets so bringing that up kinda confuses the discussion.
So here's a strawman:
- mqtt Client subscribes to a specific hub
- method invocations are handled by bidirectional Publish (same for results?)
In fact, we can use the Android message to do a case, based on MQTT implementation or SIGNALR implementation, they ultimately want to get the result is only the content of the message, as well as the specific protocol header. It is not possible to use Google's messaging service in China (China Network firewall GFW), so it is based on pub, or duplex protocol.
At a later time, we should look into writing a sample showing this.
@davidfowl You subscribe to topics (more on this here: http://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices and https://mosquitto.org/man/mqtt-7.html or http://www.ev3dev.org/docs/tutorials/sending-and-receiving-messages-with-mqtt/)
This might be similar to callbacks that are currently in SignalR, but MQTT has ability to subscribe using special characters '#' or '+'.
Ideally using SignalR we could create hubs that would allow us to use MQTT to build IOT solutions.
So for example when we create a hub called GreenhouseHub with method Temperature You could publish to it using greenhouse/temperature and also You could subscribe to that topic using same path.
As @milenstack mentioned this would be nice addition, especially for IOT.
There's no disagreement that "it would be nice", it just needs to be designed.