SignalR delivery
SignalR is a library for enabling real-time communication between servers and clients in web applications. It allows data to be pushed instantly from the server to the client without requiring constant polling.
In OrbitSailor, SignalR is offered as one of the data delivery methods. It can be used to provide real-time data to Graphical User Interfaces, enabling dynamic and instantaneous display of vessel positions and related updates.
Setting up the delivery method
To setup the SignalR delivery method follow the steps:
- Login to the OrbitSailor Configuration Dashboard with admin rights
- Go to the Service Configuration
- Navigate to DELIVERY CONFIGURATION tab
- Click on ADD DELIVERY CONFIGURATION
- Enter a new name in the Endpoint Name field
- Select SignalR Push
- Click on GENERATE API KEY
- A new code will be presented below
- Copy this code by clicking on COPY TO CLIPBOARD or selecting the whole code and copying it manually
INFO
This API Key is only visible during creation, please keep it in a safe place. If the API Key is lost, a new one should be generated.
Use the following URL and the API key to access the SignalR service:
https://delivery.europe1.api.aisservices.lux.space/DataDeliveryHub?apiKey=YOUR_APIKEY_HERE
- Optionally you can turn on a toggle switch Store Raw API Key
- Optionally you can customize a message by turning on a toggle switch. Go to Customize Message Format to learn more about it.
- Save the configuration by clicking on SAVE button
The SignalR delivery method is now set up and ready for use.
As soon as you regenerate the key and save, the previous key will be invalidated.
Using the SignalR delivery method
In your code, you must load the library (not described here), and then initialize the connection and subscribe to data delivery.
JS client example
const connection = new signalR.HubConnectionBuilder()
.withUrl(
"https://delivery.europe1.api.aisservices.lux.space/DataDeliveryHub?apiKey=YOUR_APIKEY_HERE"
)
.withAutomaticReconnect()
.build();
connection.on("DataDelivery", (message) => {
// handle your message here
});
// Start the connection.
connection.start();
C# client example
var connection = new HubConnectionBuilder()
.WithUrl("https://delivery.europe1.api.aisservices.lux.space/DataDeliveryHub?apiKey=YOUR_APIKEY_HERE")
.WithAutomaticReconnect()
.Build();
connection.On<string>("DataDelivery", data => {
// handle your message here
});
connection.StartAsync();