qie.addInboundMessage¶
Signature: qie.addInboundMessage(record, originalFilename)
Returns: void
Adds messages to the inbound queue, one at a time. Use this method when message order matters and the channel is configured to process messages in order received.
Note
Use qie.queueInboundMessage instead when message processing order doesn't matter and higher throughput is required.
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| String or byte[] | record | the message to add to the inbound queue | |
| String | originalFilename | the source filename |
Example¶
/* Usually used from Source Scripts (order matters) */
// Example: record as String (JSON message)
var jsonMessage = '{"firstName":"Jared","siblings":[{"firstName":"David","age":50},{"firstName":"Michael","age":41}],"lastName":"Jones"}';
qie.addInboundMessage(
jsonMessage,
'sample.json'
);
// Example: record as String (HL7 message)
var hl7Message =
`MSH|^~\\&|SendingApp|SendingFac|ReceivingApp|ReceivingFac|202601281230||ADT^A01|123456|P|2.5
PID|1||123456^^^Hospital^MR||Doe^John||19800101|M|||123 Main St^^Metropolis^NY^10101||555-1234
PV1|1|I|ICU^01^01||1234^Physician^Smith`;
qie.addInboundMessage(
hl7Message,
'sample.hl7'
);
// Example: record as byte[] (raw byte array)
var byteMessage = [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]; // "Hello World!"
qie.addInboundMessage(
byteMessage,
'sample.txt'
);