Skip to main content

Message Flow

linkiir.flow

Everything about a message's movement through a channel: acknowledge what came in, route/enqueue what goes out.


linkiir.flow.push​

function

linkiir.flow.push{ data=, topic=, metadata=, live= }

Enqueue / route a message downstream.

Enqueue/route a message to the next Linkiir node/topic and return its trace id.

Usage

linkiir.flow.push{ data = <string> [, topic=] [, metadata=] [, live=] } -- or linkiir.flow.push(<string>)

Parameters

NameTypeRequiredDescription
datastringYesMessage payload.
topicstringNoTarget topic/node; defaults to the configured destination.
metadatatableNoKey/value headers stored with the message.
livebooleanNoDefault true; false simulates (test mode).

Returns

  • messageId (string) — Linkiir trace id assigned at enqueue.

Errors

Raises a Lua error on failure.

Codes: INVALID_PARAMETER, CONTEXT_UNAVAILABLE, QUEUE_WRITE_FAILED

Example

local MessageId = linkiir.flow.push{ data = Out:text(), topic = 'adt.out' }

linkiir.flow.configure​

function

linkiir.flow.configure{ bootstrap=, project=, workflow=, node=, topic= }

Configure the flow context (node identity and Kafka settings).

Sets the flow context's node identity and Kafka settings; empty fields keep their current value. The context is also read from the LINKIIR_* environment variables.

Usage

linkiir.flow.configure{ project = <string> [, workflow=] [, node=] [, bootstrap=] [, topic=] }

Parameters

NameTypeRequiredDescription
bootstrapstringNoKafka bootstrap servers.
projectstringNoProject ID.
workflowstringNoWorkflow ID.
nodestringNoNode ID.
topicstringNoExplicit output topic (overrides derived).

Example

linkiir.flow.configure{ project = "ADT", workflow = "InboundHL7", node = "Transform1" }

linkiir.flow.topic​

function

linkiir.flow.topic()

Return the resolved output topic name (or nil if unresolvable). Resolution order: explicit topic from configure() > LINKIIR_OUTPUT_TOPIC env > derived "linkiir.node.<project>.<workflow>.<node>".

Usage

linkiir.flow.topic()

Returns

  • topic — Resolved topic name (string), or nil if unresolvable.

Example

print(linkiir.flow.topic()) -- "linkiir.node.ADT.InboundHL7.Transform1"