Skip to content

Spark messages are always in a consistent format. The following is an example of a Spark message:

POST / HTTPS/1.1 Content-Type: application/json Host: regionxyz.its.proxy.veevavault.com Connection: Keep-Alive User-Agent: Veeva Vault Spark Message Agent X-VaultAPISignature-CertificateId: 00001 X-VaultAPISignature-ExecutionId: a123bede-32cb-4dbc-a7d9 X-VaultAPISignature-RequestId: ffjkek809809fjklkfjlkjf89 X-VaultAPISignature-RequestDateTime: 2012-04-25T21:49:27.719Z X-VaultAPISignature-RequestNotBefore: 2012-04-25T21:48:27.719Z X-VaultAPISignature-RequestNotAfter: 2012-04-25T21:54:27.719Z X-VaultAPISignature-RequestType: spark_message X-VaultAPISignature-URL: https//www.etech.com/Fservices/vaultmessage X-VaultAPISignature-VaultId: 1000023 X-VaultAPI-Signature: DMXvB8r9R83tGoNn0ecwd5UjllzsvSvbItzfaMpN2nk5HVSw7XnOn49IkxDKz8YrlH2qJXj2iZB0Zo2O71c4qQk1fMUDi3LGpij7RCW7AW9vYYsSqIKRnFS94ilu7 X-VaultAPI-SignatureV2: ZEn78/hRc5Xip9/S2zAeJoaeD0ZkC1go3hOABF3dW/+/P+ATEZZiq/8L39ohTj052e+/F35ggteJtiXpddyStRrA9fYkDuAMDcQLhJ6tTIlHmL6jz6/0hjqavm5VbeGLAxcTqnSDDtKmXN4uBPsuV83reVekeDDkeRVZ2MkbPR7rkXNLt4AA1DhLS4vstwpAhHapuIWyt06npuB6HNfZL { "vault_name" : "Megatech RIM Vault", "vault_host_name" : "biorad-rim.veevavault.com", "queue_name" : "study_sync_with_med_innovation__c", "enter_queue_timestamp" : "2012-04-25T21:49:25.719Z", "send_message_timestamp" : "2012-04-25T21:49:27.719Z", "send_attempt" : 2, "message_id" : "bb28d4ca-3a37-4fef-91ae-93c3a4ec1d8d", "message" : { "attributes": { "object" : "product_brand__c", "has_related" : true, "related_count" : 100, "authorization" : "A109315AC45D0FA76A5891FE25B2FCBB1AEBDBDDF 25008682BEC50BF43F5DD9A96700A962515703060 53E4571108799F7141A1857A571786AEF5A626655 7B380" }, "items": [ "OP0000000010I13", "OP0000000000I09", "OP0000000022T06" ] } }

Note that message headers may show in a different case depending on the receiving host, so developers should be prepared to handle the headers as case-insensitive.

NameDescription
HostVault’s outbound proxy host name.
User-AgentThe client software originating the request. For Spark messaging, this will always be Veeva Vault Spark Message Agent.
X-VaultAPISignature-CertificateIdA certificate ID unique to this message. The application receiving this message must use this ID to retrieve the public key.
X-VaultAPISignature-ExecutionIdA unique ID to identify the execution thread.
X-VaultAPISignature-RequestIdA unique request ID, such as Message ID.
X-VaultAPISignature-RequestDateTimeThe time this message was sent.
X-VaultAPISignature-RequestNotBeforeThe time when this message first becomes valid. You should not attempt to verify a message before this time.
X-VaultAPISignature-RequestNotAfterThe time when this message first becomes invalid. You should not attempt to verify a message after this time.
X-VaultAPISignature-RequestTypeThe type of request, either spark_message or http_callout.
X-VaultAPISignature-URLThe URL of the request from the QueueService.putMessage(Message) call. This is the intended recipient of the message.
X-VaultAPISignature-VaultIdThe Vault ID which sent this message.
X-VaultAPI-SignatureFor Vault version 20R1.0: The message signature, signed with Vault’s private key. You need this value to verify the message.
X-VaultAPI-SignatureV2For Vault version 20R1.2+: The message signature, signed with Vault’s private key. You need this value to verify the message.

The message body is a JSON object with the following attributes:

NameDescription
vault_host_nameA Vault's DNS host name.
queue_nameThe name of the outbound queue the message came from.
enter_queue_timestampThe time in UTC this message entered the queue. Specifically, this is the exact time SDK code called QueueService.putMessage(Message).
send_message_timestampThe time in UTC this message was sent, or left the queue.
send_attemptThe number of delivery attempts made for this message. Learn more about message delivery.
message_idThe message ID.
messageA JSON object which contains the sub-attributes attributesand items. View this object in the javadocs.
attributesA sub-attribute of the message JSON object which contains the attributes specified by Message#setAttribute(). SDK developers can add up to 10 custom attributes in a single message. Each attribute cannot exceed 100 characters. A common attribute is authorization, set with a token. You can also tie an integration_point__sys to a Spark message to create user exceptions.
itemsA sub-attribute of the message JSON object which contains a an array of Strings for each item added with QueueService. SDK developers can add up to 500 items in a single message. Each item cannot exceed 100 characters.

If message delivery fails, Vault will immediately retry the delivery one (1) time. If this immediate retry fails, Vault retries at diminishing intervals using an exponential backoff algorithm for the next six (6) hours.

For example:

  1. First delivery of the message fails
  2. Immediately retry delivery
  3. After 1 second, retry delivery
  4. After 4 seconds, retry delivery
  5. After 7 seconds, retry delivery

And so on until the total time spent attempting to deliver the message is six (6) hours. Note that the time waited between retries will never exceed 15 minutes.

When the final delivery retry fails, Vault’s behavior is determined by the Spark Message Delivery Event Handler specified in the Spark Queue. To implement custom behavior for failed Spark messages, see Message Delivery Event Handler.