Skip to main content

Queue Target

The queue targets send the triggering data as a message to one of your tenant's queues whenever an automation fires. This decouples the platform from the systems that consume the data: they read messages from the queue in their own time.

IdNameTemplateIcon
odsl.queueSend a message to a queuesend a message to [queue]send text-red
odsl.queue_subjectSend a message to a queue with a subjectsend a message to [queue] with [subject]send text-red

Both targets work with any service and any action, and both support the @transformer property and property-change filtering.

How it works​

  • The data, after any @transformer has been applied, is sent as a JSON message to your tenant queue named in queue
  • The message subject is subject, which can include dates filled in from the ondate of the triggering data, for example ${date:yyyy-MM-dd}
  • odsl.queue sends the message with an empty subject

See Queues for how to work with queues.


odsl.queue: Send a message to a queue​

Inputs​

InputDescription
queueThe name of the queue to send the message to

Default properties​

PropertyValue
subject"" (empty)

Example: send a dataset to a queue when it is complete​

a = AutomationBuilder("dataset", "private", "MY.PROVIDER.FEED").build()

c = SimpleObject()
c.source = "private"
c.service = "dataset"
c.id = "MY.PROVIDER.FEED"
c.action = "complete"
conds = []
conds.add(c)
a.conditions = conds

a.target = "odsl.queue"
a.template = "When 'MY.PROVIDER.FEED' is complete, send a message to [queue]"
a.icon = "send text-red"
a.properties.queue = "market-data-out"
a.properties.subject = ""
a.enabled = true
save ${automation:a}

odsl.queue_subject: Send a message to a queue with a subject​

Use this target when the systems reading the queue use the message subject to route or filter messages, for example when several kinds of data go to one shared queue.

Inputs​

InputDescription
queueThe name of the queue to send the message to
subjectThe message subject, can include dates

Example: send an updated curve to a queue with a subject​

a = AutomationBuilder("data", "private", "MY_OBJECT:CURVE").build()

c = SimpleObject()
c.source = "private"
c.service = "data"
c.id = "MY_OBJECT:CURVE"
c.action = "update"
conds = []
conds.add(c)
a.conditions = conds

a.target = "odsl.queue_subject"
a.template = "When 'MY_OBJECT:CURVE' is updated, send a message to [queue] with [subject]"
a.icon = "send text-red"
a.properties.queue = "market-data-out"
a.properties.subject = "CURVE_${date:yyyyMMdd}"
a.enabled = true
save ${automation:a}

Transforming the message​

Set @transformer to the name of a mustache script, or to inline mustache text, to reshape the data into the structure the consuming system expects. The template then includes the transform step, for example:

When 'MY.PROVIDER.FEED' is complete, transform the data using [@transformer], then send a message to [queue]

ab = AutomationBuilder("dataset", "private", "MY.PROVIDER.FEED")
ab.set("@transformer", "dataset-to-message")
a = ab.build()

c = SimpleObject()
c.source = "private"
c.service = "dataset"
c.id = "MY.PROVIDER.FEED"
c.action = "complete"
conds = []
conds.add(c)
a.conditions = conds

a.target = "odsl.queue"
a.template = "When 'MY.PROVIDER.FEED' is complete, transform the data using [@transformer], then send a message to [queue]"
a.icon = "send text-red"
a.properties.queue = "market-data-out"
a.properties.subject = ""
a.enabled = true
save ${automation:a}
Several consumers

If several systems need the same data, create one automation per queue. Each automation fires independently from the same condition.


Choosing between the two targets​

odsl.queueodsl.queue_subject
SubjectEmptySet by you, can include dates
Best forQueues that carry one kind of messageShared queues where consumers filter by subject
Transformer supportYesYes