Concept of Message exchange
Overview
The main purpose of the agrirouter platform is to exchange messages between endpoints.
The agrirouter provides a mechanism to receive and forward messages according to a combination of app subscriptions, public or direct addressed messaging and routings configured by the end-user.
This chapter only handles the message exchange on the agrirouter in a general way. This chapter does not handle network layers or TCP/IP protocols. The communication of an application with its endpoint at the agrirouter is described in 10 Application Interaction with agrirouter |
General message exchange
In general, there are 3 steps:
-
An application instance sends a message to its endpoints inbox
-
agrirouter forwards ("routes") this message to all relevant and permitted endpoints storage ("feed")
-
Each application instance can call for available messages in its endpoints feed and pull them from the outbox
The following graph shows the way of a message through the agrirouter:
Every endpoint can send messages to specific endpoints and/or publish them.
Every end user can provide routings to allow this message delivery. Per default, no routings are set and therefore, the delivery is disallowed. This can be changed easily by the end user. See the User Manual for further details.
If messages are sent published, they are only delivered to those allowed endpoints that subscribed for this message type. If messages are sent directly and recipients are mentioned in the address lists, they are delivered if the endpoint supports this message type and if there is a routing allowing the delivery.
Message addressing
Messages can be directly addressed to one or more endpoints. They can also be published to send the message to all subscribed endpoints. It is remarked in the message header if the message is directly sent, published, or if both techniques shall be used. agrirouter will take care of not delivering a message twice to the same endpoint.
Sending messages to machines
As a machine has its own endpoint in the agrirouter account, it is possible to address messages to a machine.
To deliver messages that are addressed to a machine, agrirouter needs to know, which application instance (CU or Virtual CU) currently is connected to that machine. Therefore, delivery of messages to a machine can only work if the connected CU or Virtual CU properly reports its teamset including the EFDI Device Description. The command to define a teamset can be found here.
Currently, this is an optional feature of Virtual CU or CUs and not required for a certification.
Buffering and message delivery
After onboarding, every endpoint can send commands to the agrirouter inbox. agrirouter forwards and potentially duplicates the included messages to store them in the feed of the relevant target endpoint(s).
The feed is the time limited storage for messages in each endpoint.
All messages in agrirouter connectivity platform have a retention time of maximum 4 weeks in total before they are deleted. The end-user will be informed about a possible data loss after 3 weeks, so that he has time to react. After an application instance received and confirmed the receipt, the message will be deleted from the agrirouter feed storage.
Every registered endpoint can request the list of messages available in his feed and request specific messages. agrirouter forwards those requested messages to the outbox, delivery to the endpoint depends on the protocol.
A more specific description of the parts of an endpoint can be found here . |
EXAMPLE
The following example shall describe the terms and the way of a message through agrirouter.
-
An App instance sends a message to the inbox of its endpoint.
-
The message is addressed to another app instances endpoint.
-
agrirouter forwards this message to the feed of the addressed endpoint if there is a routing.
-
The addressed App Instance is than able to request agrirouter to pull this message from its endpoints feed to its endpoints outbox.
-
From there, it can be pulled by the app instance.
Message Header and Message Payload
Every message or command sent to or received from agrirouter consists of a Message header and a payload.
Message Header
The header includes information on how to handle the message. When sending a message, it includes the recipient list and which technical message type is encoded in the payload. It also includes the creation timestamp and a unique ID.
When receiving a message, it includes the source, creation date, technical message type and a unique ID
The header creation is described here
Information types and Technical message types
The technical message type describes the type (e.g. the format) of the content of an agrirouter message. Every endpoint capable of sending such a message declares that it is able to create a valid message of such type. Every endpoint capable of receiving such a message declares that it can interpret that message.
Information types are an abstraction of the technical message types to simplify the setting up of routings.
One technical message type can be part of multiple Information types.
Each technical message type must be assigned to an information type, which represents its meaning and purpose. The technical message types Bitmap, PNG and JPEG for example are summarized as Information Type "Image". This means that endpoints can send Bitmaps, PNGs and JPEGs if a routing for Images exists.
Technical message types are defined by groups outside the agrirouter project. If message types are missing, DKE will add a useful standardized message type. DKE however will not standardize any formats.
An information type is a group of technical message types.
The agrirouter message payload has a technical message type, which is indicated on the envelope. The list of technical message types can be found here. The definition of a new technical message type is possible.
Capabilities
Each endpoint has to describe, which technical message types it can send and/or receive. The listing of those technical message types is called capabilities. Each endpoint has to provide its capabilities when starting to communicate with the agrirouter. The capabilities, an endpoint generally supports (e.g. with all optional features enabled) is required for the Certification.
Some applications are offered with several optional features that are only available to the end user under specific circumstances, e.g. if he buys a special package. an app instance that has such optional features should always send those capabilities to the agrirouter that it really supports under its current configuration. Otherwise, this might lead to data exchange problems. |
Subscriptions
As a sender of a message (e.g. an EFDI Telemetry message) does not always know the relevant endpoints, he can send the message as a published message. Every other endpoint can subscribe to any message type that is part of its capabilities.
Before sending the Subscription message, the endpoint has to send the Capabilities message
The steps for this – in general nd with given routings – are:
-
Endpoint EP3 subscribes for a technical message type (TMT)
-
App Instance 1 of App 1 sends a message of this TMT to its EP1 Inbox
-
agrirouter forwards the message to the feed of Endpoint EP3
-
This message is forwarded to any endpoint that subscribed for that list
-
As EP 3 is subscribed, the message is forwarded to the outbox of EP3
-
The App instance 47 can now pull this message from its endpoints feed
Routings
General
To control the message flow between endpoints and to avoid sensitive data being forwarded to the wrong endpoints, end users can setup routings. Only forwardings that are allowed by these routings will be performed by the agrirouter.
A routing consists of:
-
Sender
-
Information Type as abstraction of technical message types
-
Receiver
Image Description:
-
EP 1 sends 2 messages, each addressed to EP2 and EP3.
-
While both messages of TMT1 reach the destination, because there is a routing given in agrirouter, Only the TMT2 message for EP2 arrives at its destination, because there is no routing given between EP1 and EP3 for TMT2.
Setup of routings
Routings are created by the end user in his agrirouter account. Please refer to the User Manual
Changes in agrirouter 2.0
In agrirouter 2.0 telemetry filtering is not used anymore.
A more specific definition of EFDI messages can be found here.