1

So I was wondering if it's possible to run a MQTT broker on the Google App Engine platform? Couldn't find any information about it (or maybe I might be using the wrong keywords).

I've got my GAE running on Java so I'd like to go into direction of running the MQTT broker on GAE using a backend.

EDIT: Did some further research and it seems Moquette is running on Java. Does someone have experience running Moquette on the GAE?

EDIT2: Ok, it seems the examples of Moquette are running using an OSGi container, which is unavailble in GAE. Looking for a script to start this server on GAE.

Magnilex
  • 11,584
  • 9
  • 62
  • 84
Wouter
  • 652
  • 2
  • 7
  • 27

3 Answers3

1

MQTT is protocol on top of TCP. In order to run MQTT server, one needs to be able to open a listening socket. Those are still not supported on normal AppEngine instances.

Note: GAE backends have been replaced: now you just have automatic scaled (aka frontend) instances and manual scaled (aka backend) instances.

Back to your problem: Managed VMs have most of the benefits of GAE (access to services), but run a full JVM, which allows listening sockets.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154
  • Could a possible solution be: running a broker on a seperate server and defining an MQTT client as backend in my GAE application, which then forwards data into my datastore? Am I right that this client won't be needing the listening socket? – Wouter Jan 21 '15 at 09:01
  • If GAE is a MQTT client and it only sends notifications, then this would probably work. – Peter Knego Jan 21 '15 at 12:32
  • Slightly off topic but can just the MQTT client be run on a backend (now service?). This is for e.g. to listen to a publicly available broker. – Fakeer Apr 02 '17 at 06:02
1

An alternative to Moquette would also be the HiveMQ broker, it also runs on Java and can be easily installed. All the documentation is available here. We haven't tested it on GAE yet, but if you have any problems running it, you could ask in the support forum.

Update: If Peter Knego is right, then HiveMQ or any other MQTT broker won't work on GAE.

Full disclose: I'm working for the company, who develops HiveMQ.

Cheers,

Christian

Christian Götz
  • 818
  • 1
  • 8
  • 11
1

@Peter Knego is definitely right, and all i would add to his answer is that,

If you manage to configure you application to use a custom Runtime on the Managed Vms of Appengine and Compute Engine,

then you will be able to run you MQTT brooker perfectly sound and well.

As long as you define a fire wall to allow a tcp connection at the port which your broker is listening from.

By default the ports are blocked for security reasons.

MrOnyancha
  • 606
  • 5
  • 28