Solace + protobuf in iOS application

Options
Ivan_Suprynovich
Ivan_Suprynovich Member Posts: 2
edited August 2020 in Connectors & Integrations #1

Hi everyone! I'm absolutely new in Solace, so I would you to help me: my app has to communicate with Solace using protobuf models. Can you help, what to start with?

Comments

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 491 admin
    edited August 2020 #2
    Options

    Hi @Ivan_Suprynovich ! Welcome to the Solace Community 🎉 As a simple starter to get you up and going with the Soalce broker, you can use a standard messaging protocol, MQTT, to connect and then receive and send data to the broker. Here is an example on how to use SWIFT and MQTT https://www.cloudamqp.com/docs/swift_ios_mqtt.html; you can get your host and port from your Solace cloud console (or just use localhost if you are using a local docker image for the broker).

    Note that we also have a Native Solace IOS API that you can download from https://solace.com/downloads/ under the "Messaging APIs + Protocols" section. This is a wrapper around our C API that you can just include the headers in your swift app. The benefits to using this is you will have access to advanced Solace broker functionalities, however I think you would be good to get started with the MQTT library at first. The diagram on https://www.solace.dev/ will help in understanding the different supported protocols and translations that could happen in the broker.

    Using a protobuf model will be as simple as serializing your data before you publish on the broker and deserializing it on the consuming end. Hope this helps!

  • TomF
    TomF Member, Employee Posts: 406 Solace Employee
    Options

    Just to add to what @Tamimi has said - in Solace we don't touch the payload. Simply serialise your protobuf and create that as your message binary attachment. Similarly, on message reception, get the binary attachment and pass that to your protobuf deserialiser.

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 491 admin
    Options

    And as always, @TomF puts it in a much easier and nicer way! One day I'll explain things as elegantly as you do 🙏

  • TomF
    TomF Member, Employee Posts: 406 Solace Employee
    Options

    I'm embarrassed now...

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 491 admin
    Options

    Your answer is on point!