INVERS CloudConnect sharing vehicle connector header

Vehicle Messages

Get notified about changes of connected vehicles.

API Reference

Inspect Vehicle Messages API reference.

Consume messages

Learn how to consume messages and get started!

Quick Start: Consume Vehicle State messages (C#)

Follow instructions and have your configuration data ready (user, password, …).

The following example shows how to connect to your the RabbitMQ broker and consume messages. The C# example uses the RabbitMq.Client library.

string user = "f-FLT23-c-CNSM23A";
string pass = "<secret>";
string hostName = "api.invers.com";
int port = 5672;
string vhost = "fleet-FLT23";
string queueName = "VehicleStateReceived_v1-CNSM23A";
ConnectionFactory factory = new ConnectionFactory();
factory.Uri = new Uri($"amqps://{user}:{pass}@{hostName}:{port}/{vhost}");
IConnection conn = factory.CreateConnection();
IModel channel = conn.CreateModel();
var consumer = new EventingBasicConsumer(channel);
consumer.Received += (ch, ea) =>
  {
    var body = ea.Body;
    try
    {
      // ... process the message, with JsonDocument.Parse(body) 
      // or JsonSerializer.Deserialize(body)
    }catch(Exception e){
      e.Dump();
    }
    channel.BasicAck(ea.DeliveryTag, false);
  };
 
// Start consuming (consumer tag identifies the subscription
// when it has to be cancelled)
String consumerTag = channel.BasicConsume(queueName, false, consumer);