# Use MQTT Proxy in Confluent Cloud

**URL:** <https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561>\
**Category:** Confluent Cloud\
**Created:** [16 July 2022 16:01 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561 "2022-07-16T16:01:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![donnie](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@donnie](https://forum.confluent.io/u/donnie)\
**Post date:** [16 July 2022 16:01 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/1 "2022-07-16T16:01:52Z")

</div>

[https://docs.confluent.io/platform/current/kafka-mqtt/intro.html#](https://docs.confluent.io/platform/current/kafka-mqtt/intro.html#)  
Is this available in Confluent Cloud and how do I connect to it?  
I only see it here in on-prem.  
I want to go from client directly to Confluent Cloud.

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [18 July 2022 06:21 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/2 "2022-07-18T06:21:15Z")

</div>

hey @donnie

did you try the solution offered in

> [@Connecting MQTT proxy to Apache kafka cluster in confluent cloud](https://forum.confluent.io/t/connecting-mqtt-proxy-to-apache-kafka-cluster-in-confluent-cloud/4648/3):
>
> hello again wink here are the relevant settings which need to be added to your config file # bootstrap server url bootstrap.servers=$yourcluster.aws.confluent.cloud:9092 # security protocol producer.security.protocol=SASL\_SSL # sasl mechanism producer.sasl.mechanism=PLAIN # sasl jaas config producer.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username='api\_key\_from\_confluent\_cloud' password='api\_secret\_from\_confluent\_cloud'; # confluent cloud re…

best,  
michael

---

<div class="post-metadata">

**Author:** ![donnie](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@donnie](https://forum.confluent.io/u/donnie)\
**Post date:** [18 July 2022 13:31 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/3 "2022-07-18T13:31:10Z")

</div>

Thank you @mmuehlbeyer . Glad to know it also should work in cloud version.  
I’m still waiting to find out how to pass these settings from the browser using mqtt.js and/or this Vue.js wrapper.

> <https://github.com/tommy44458/mqtt-vue-hook/issues/1>
>
> I have a node.js client that connects to Confluent Cloud using the below options…. I'd like to be able to publish events in my Vue UI to Confluent Cloud and also subscribe to topics. Kafkajs only works in Node. 
> Looks like your hook can help me with it. I just can't tell if you can pass in these options and what the options object should look like to do SASL. Can it work?
> Required connection configs for Kafka producer, consumer, and admin
> bootstrap.servers=pkc-57jzz.southcentralus.azure.confluent.cloud:9092
> security.protocol=SASL\_SSL
> sasl.mechanisms=PLAIN
> sasl.username=xxxx
> sasl.password=xxxx

> <https://github.com/mqttjs/MQTT.js/issues/1508>
>
> I'm trying to find out if MQTT.js support SASL\_SSL and what the client config ne…eds to be to add it. I want to see if I can publish/subscribe to Confluent/Kafka topics
> 
> Required connection configs for Kafka producer, consumer, and admin
> bootstrap.servers=pkc-57jzz.southcentralus.azure.confluent.cloud:9092
> security.protocol=SASL\_SSL
> sasl.mechanisms=PLAIN
> sasl.username=xxxx
> sasl.password=xxxx

The docs on mqtt.js do not define how to make these settings in the Client constructor.  
It doesn’t work with just username and password but it isn’t clear how to set the authenticationMethod and authenticationData or whichever you need to use.

On the Confluent Cloud MQTT Proxy side, will the MQTT over Websockets still work? (assuming I can get the right auth settings added to client)

---

<div class="post-metadata">

**Author:** ![donnie](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@donnie](https://forum.confluent.io/u/donnie)\
**Post date:** [18 July 2022 20:56 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/4 "2022-07-18T20:56:22Z")

</div>

This is what I’m trying. I tried using mqtt or wss but I don’t know why it is failing other than I’m not explicitly including SASL\_SSL and PLAIN.  
I’m am new to Confluent, so please be patient with me. 🙂

 ![Screen Shot 2022-07-18 at 3.52.38 PM](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/2X/8/8f2d8d6526303441783cf3c51c82123e18dc1a5a.png)

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [19 July 2022 06:09 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/5 "2022-07-19T06:09:45Z")

</div>

hey @donnie

could you provide some details how you try to run your mqtt proxy?  
I guess it’s running locally and tries to connect to confluent cloud right?  
could you share the confs?

best,  
michael

---

<div class="post-metadata">

**Author:** ![donnie](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@donnie](https://forum.confluent.io/u/donnie)\
**Post date:** [19 July 2022 13:04 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/6 "2022-07-19T13:04:16Z")

</div>

@mmuehlbeyer the purpose of this post was to ask if the MQTT Proxy work in cloud version of confluent by sending message to the cluster. I do not know how to turn that on in the cloud version. If the cluster doesn’t work with it, then it is dead in the water. I don’t want to stand up another server. I can just add a broker in the mix if I have to do that.

How does the Confluent Cloud front-end receive messages in the browser? what client does it use in the browser and how does it talk to the cluster?

---

<div class="post-metadata">

**Author:** ![donnie](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@donnie](https://forum.confluent.io/u/donnie)\
**Post date:** [19 July 2022 13:07 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/7 "2022-07-19T13:07:59Z")

</div>

> [@Connecting MQTT proxy to Apache kafka cluster in confluent cloud](https://forum.confluent.io/t/connecting-mqtt-proxy-to-apache-kafka-cluster-in-confluent-cloud/4648/3):
>
> bootstrap.servers=$yourcluster.aws.confluent.cloud:9092

This implies to me that the mqtt client sends directly to the cluster’s bootstrap.servers, which I thought handled the MQTT proxy built in. I could be wrong. That is what I was trying to find out in this thread. Clearly I misunderstood that you have to stand up your own proxy.

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [21 July 2022 05:36 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/8 "2022-07-21T05:36:54Z")

</div>

hi donnie,

not fully sure if I understand your plans correctly 😉

if you’d like to connect to Confluent Cloud to an MQTT proxy you could use MQTT source connector.

though if my understanding is right you would like to send data directly to the cluster from an app correct?

best,  
michael

---

<div class="post-metadata">

**Author:** ![donnie](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@donnie](https://forum.confluent.io/u/donnie)\
**Post date:** [21 July 2022 23:34 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/9 "2022-07-21T23:34:23Z")

</div>

Correct, I wanted to connect an IoT device and the browser to Confluent using an MQTT client. Without having to add an extra broker in the mix. I’m looking into Waterstream but I also wanted to learn how to use the MQTT Proxy option and go direct to Confluent Cloud.  
I tried MQTT source connector with HiveMQ but I couldn’t get it to connect. They force you to use their connector, which is not a fully-managed Confluent connector that works in cloud version. But, again, a separate broker shouldn’t be required, from my perspective.  
I appreciate your help

---

<div class="post-metadata">

**Author:** ![jlee](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@jlee](https://forum.confluent.io/u/jlee)\
**Post date:** [22 July 2022 15:11 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/10 "2022-07-22T15:11:15Z")

</div>

This could be documented better. But MQTT proxy requires explicit configuration of each of the Kafka clients used.

So for example, this is a working MQTT proxy configuration for Confluent Cloud (obviously, update bootstrap server and creds accordingly.

```auto
bootstrap.servers=<BOOTSTRAP_SERVER>
ssl.endpoint.identification.algorithm=https
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="<API_KEY>" password="<API_SECRET>";

producer.bootstrap.servers=<BOOTSTRAP_SERVER>
producer.ssl.endpoint.identification.algorithm=https
producer.security.protocol=SASL_SSL
producer.sasl.mechanism=PLAIN
producer.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="<API_KEY>" password="<API_SECRET>";

consumer.bootstrap.servers=<BOOTSTRAP_SERVER>
consumer.ssl.endpoint.identification.algorithm=https
consumer.security.protocol=SASL_SSL
consumer.sasl.mechanism=PLAIN
consumer.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="<API_KEY>" password="<API_SECRET>";

confluent.topic.bootstrap.servers=<BOOTSTRAP_SERVER>
confluent.topic.ssl.endpoint.identification.algorithm=https
confluent.topic.security.protocol=SASL_SSL
confluent.topic.sasl.mechanism=PLAIN
confluent.topic.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="<API_KEY>" password="<API_SECRET>";

```

I’m not 100% sure you need all four of them, but I do know that this works.

---

<div class="post-metadata">

**Author:** ![Lambi](https://avatars.discourse-cdn.com/v4/letter/l/85f322/32.png) [@Lambi](https://forum.confluent.io/u/Lambi)\
**Post date:** [2 August 2022 12:13 UTC](https://forum.confluent.io/t/use-mqtt-proxy-in-confluent-cloud/5561/11 "2022-08-02T12:13:35Z")

</div>

Their Confluent connector is forced upon you, and it isn’t a fully managed Cloud version of Confluent connector[.](http://futbolred.net/)However, I don’t believe that a separate broker should be necessary. Your assistance is greatly appreciated
