clarify / node-red-contrib-clarify

A Node-Red node to insert data into Clarify
Apache License 2.0
1 stars 2 forks source link

Change insert node output #37

Open smyrman opened 3 years ago

smyrman commented 3 years ago

This is suggested as an extension to #36.

We might consider to change the node output to not contain raw requests, but an aggregate of the msg.ack field.

Suggestion:

I.e. consider the following messages:

{
  _msgid: 1,
  ack: ["a1", "a1-2"],
  payload: {...}
}
{
  _msgid: 2,
  // ack undefined
  payload: {...},
  signal: {...}
}
{
  _msgid: 3,
  ack: ["a3"],
  payload: {...},
  signal: {...}
}
{
  _msgid: 4,
  ack: ["a4"],
  signal: {...}
}

The aggregated output 1 on success is:

The aggregated output 2 on success is:

Errors, are logged, while the detailed response is discarded both on success and on error.

khtufteland commented 3 years ago

I like the main idea of this proposal, but it makes a quite big assumption: it assumes that most source system is Pub/Sub (or similar with acknowledging mechanics) which is the case for our existing integrations using Telegraf, via Google Pub/Sub to Node-RED. But this a legacy strategy, all new integrations are implemented in Node-RED directly. And whenever existing integrations require an update, I will always consider migrating the integrations to Node-RED.

smyrman commented 3 years ago

We should definitively adapt, evolve this.

There seam to be some "ack" nodes in node-red:

We could have a look at what they are doning, and which message fields they are inspecting.

smyrman commented 3 years ago

Somehow related (if splitting a message!)

smyrman commented 3 years ago

I think it would be OK to ignore split messages (sequences) in the initial version. That is, for a split message to be acked correctly, it must be joined before it's passed to the input node.