question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validate and formalize connector message format.

See original GitHub issue

Currently, the format of messages expected and put out by connectors is this:

{
    id: string,
    attachments: {},
    body: {
        data: {},
        meta: {
            recordUid: string,
            oihUid: string,
        }
    },
    headers: {},
    metadata: {},
  }

This is something a legacy format, as this was the one used by the elasticio platform at the time. Some connectors still use the function newMessageWithBody() supplied by an elasticio dependency to create this function. Others use a more lightweight inbuilt helper function to achieve the same (e.g. https://github.com/openintegrationhub/placetel-connector/blob/578311b1049430ce1f32037d2c74582440cf472c/lib/utils/helpers.js#L88)

However, in practice, only the body field is ever really used. There may be a future use-case for the attachments field, but so far it is not used by any connector. As such, we should re-evaluate which fields are actually relevant and, if necessary, adjust the format to a simpler version. The finalized format, whether any changes are made or not, should then be explicitly detailed in documentation.


Acceptance Criteria:

  • Discuss current message format
  • If format is changed: Adjust current connectors to use new format
  • Update documentation

Definition of Done

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
weberjmcommented, Oct 9, 2020

As you mentioned, this format is derived from the legacy implementation of elastic.io messaging. I have had trouble finding specific descriptions in either OIH or Elastic documentation to clarify the full usage of each field. The closest I came was this page, regarding the ability to use the attachment field in an elastic message.

The first item that pops out at me from the above comment, is that we have both message metadata (metadata) and body metadata (meta) parameters. While it is true that we could have metadata at both levels, would it not be more concise to say that any field at the top level is a metadata field, used for messaging implementation, except for the attachment and body parameters?

There are two questions we need to answer to come up with a solid solution here:

  1. Which fields are needed to fully pass data through a flow, including flexibility for currently unrealized use cases?
  2. Where is the separation of responsibility for providing each element? For instance, the trigger or action function should not be responsible for properly assembling a message structure. At most, it should know about data/body fields and about attachments. The message packaging should be handled by the ferryman.
0reactions
SvenHoefflercommented, Nov 18, 2020

Most existing connectors have been migrated to the new format. Moving this to review pending further testing and potential bugfixes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validate connectors in Exchange Online - Microsoft Learn
Choose the connector you want to validate or turn on. You can see information about the connector in the details pane as shown...
Read more >
Formalizing and Validating UML Architecture Description of ...
ABSTRACT. Web systems are self-descriptive software components which can automatically be discovered and engaged, together with other web.
Read more >
How to Write a Kafka Connector with Proper Configuration ...
Recommended values for a config parameter, if available, can be used to provide drop-down menus containing only valid values for that parameter.
Read more >
Formalizing Reusable Communication Models for Distributed ...
The formal specification and verification of a software architecture is represented through an Alloy module based on a set of reusable models, ...
Read more >
Rule-based systems formalized within a software architectural ...
Abstract. This article considers the utilization of architectural styles in the formal design of knowledge-based systems. The formal model of a style is....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found