CreateMessage()

The CreateMessage() and CreateMessages() method calls are two wayst to create Linxter messages. These methods create a message and store it in your program instance's local, encrypted queue — the message is written to disk, not stored in memory. The message then waits to be sent either via scheduled sending or when the SendNow() method call is made.

Two methods

  • CreateMessage — Stores a message in the send queue. This method can be called as many times as needed, adding messages to the send queue.
  • CreateMessages — Stores a collection of messages in the send queue. This method is strongly recommended if a large number of messages will be created in a short period of time. By using this method they can be committed to the database as a single transaction, which is far faster than storing them individually. The messages will be delivered in the order that they are in the array (index zero first). If any of the messages fails validation, an exception will be raised with information about the messages that failed validation and no messages will be stored. The message ids for each message will be in the same index position in the returned Guid array.

The return value for the above two methods is the unique Message ID of the message that has been stored. That ID is carried with the message throughout its life cycle.

LinxterMessage Members

When creating a message, the following (see the API Docs for code examples) can be used (only ActivityId is required):

  • ActivityId (required) — Each program registered to the ISB is assigned an ActivityID, which must be included in any message sent by instances of your program. This ID should be kept secret to protect your account.
  • AttachmentPaths — Sets a collection of attachment file paths that will be used to read in the files as the message gets queued by the SDK. You should specify this or Attachments when providing attachments, not both.
  • Attachments — Sets a collection of attachment objects that get queued by the SDK. You should specify this or AttachmentPaths when providing attachments, not both.
  • Body — This is the main content of the message. You are not constrained to any specific formatting. The content can be XML, MIME, plain text, a proprietary encoding, or even encrypted cipher text. The Body can be up to 1MB in size.
  • Message Tracking (Non-repudiation) — If enabled, your program instance will receive a notification of the date/time the message was picked-up by the receiving program instance(s).
  • Priority — Messages are delivered in priority order, and sorted by creation time within a priority. Priority 0 is the default. Higher priorities will be delivered before messages with a lower priority value. You can use this property to allow messages to be bumped ahead of previously queued messages by raising the priority of them.
  • ReceiverIds — This is the program instance ID (the unique identifier of the program instance) that the message is being sent to (you can use multiple Receiver IDs to send the message to multiple program instances at the same time). Optionally, if this argument is not added or the value is empty (00000000-0000-0000-0000-000000000000), a broadcast message is sent to every program instance that the sending program instance has a communication channel with. Note: The API maintains an up-to-date list of Receiver IDs that your program instance has communication channels with, as well as other related data. This information is available through the OpenCommunicationChannels property.
  • SendViaSecondaryQueue — The secondary outbound queue runs on its own thread, and can send concurrently with the primary outbound queue. You can use the secondary outbound queue, for example, when the primary is sending lots of short messages that need to arrive to their recipients quickly, and the secondary for sending messages with attachments which would take longer to send, and would otherwise block the shorter messages sent afterwards.
  • Tags — The custom tags. Maximum of 10 tags of up to 256 characters each. Semi-colons are a reserved character, do not use a semi-colon without escaping it or your tags will be corrupted.