The Magistral Data Stream Network

We deliver billons of messages each month for your real-time applications
GETTING STARTED

Start using Magistral Data Streaming service is very simple and it takes only a few steps. Here they are:

  • 1
    Set up Magistral
      • Magistral m = new Magistral(‘pubKey’, ‘subKey’, ‘secretKey’);
      Assume that you have already created an application and you know the publish, subscribe and secret keys. Furhter we need to access one of Magistral libraries you can find in SDKs section. Now you can create a Magistral object and start send and receive your messages.
    • 2
      Subscribe
        • m.subscribe("topic", new MessageListener() {
        • public void messageReceived(MessageEvent e) {
        • String topic = e.topic();
        • int channel = e.channel();
        • byte[] message = e.msgBody();
        • System.out.println(new
        • String(message,StandardCharsets.UTF_8));
        • }
        • });
        Having a connection to Magistral service established you can subscribe on topic and receive all the messages sent over it.
      • 3
        Publish
          • byte[] msg = "magistral".getBytes(StandardCharsets.UTF_8);
          • m.publish("topic", msg);
          To see something sent via that topic, you can publish your own messages to it.
        • 4
          Congratulations, it works!
          Now you can connect your real-time applications to Magistral and enjoy unmatchable speed, security and reliability of our service. Sign in to your account to monitor usage of availble resources in real-time analytics and statistics service. Evaluate other functionalities, provided by Magistral service which you can find in API section.