Summary
Whenever a Core action is made in QBench, the application will send out an SNS message. These SNS messages can be useful in many different use cases, such as integrations. This feature allows for bulk SNS messages to be sent out whenever a bulk action is made (for example, the Lab creates 5 Samples at once) so your integration can be more efficient with bulk actions.
Enabling The Feature
To enable this feature, navigate to Application > Developer > Settings from the Navbar. There, you will find a checkbox called Enable Bulk SNS messages.
Key Information
- "qbn_is_bulk_message" and "qbn_part_of_bulk_action" will be added to all SNS messages when this feature is enabled.
- Single Entity SNS messages will still be sent out even with bulk actions. For example: if I do an action to create 5 Samples in QBench as a bulk action, I will receive 5 SNS messages for each Sample that was created and 1 SNS message that has information about all 5 SNS messages that were created, for a total of 6 messages.
Examples
When this feature is enabled QBench will begin sending bulk SNS messages along with the standard SNS messages that are created.
Bulk SNS Message
Here is an example of a bulk SNS message that would be generated when an action to create 5 Samples was made:
{
"qbn_type": "entity-created",
"qbn_entity": "sample",
"qbn_modified_by": {
"id": "1",
"type": "USER",
"name": "Johnny Appleseed"
},
"qbn_ids": [
67431, 67433, 67430, 67432, 67434
],
"qbn_num_objects": 5,
"qbn_data": {},
"qbn_is_bulk_message": true
}
Single Entity SNS Message (Part of Bulk Action)
{
"qbn_type": "entity-created",
"qbn_entity": "sample",
"qbn_modified_by": {
"id": "1",
"type": "USER",
"name": "Johhny Appleseed"
},
"qbn_id": 67434,
"qbn_object_history_id": 43743,
"qbn_is_bulk_message": false,
"qbn_part_of_bulk_action": true
}
Single Entity SNS Message (NOT Part of Bulk Action)
{
"qbn_type": "entity-created",
"qbn_entity": "sample",
"qbn_modified_by": {
"id": "1",
"type": "USER",
"name": "Johhny Appleseed"
},
"qbn_id": 67435,
"qbn_object_history_id": 43757,
"qbn_is_bulk_message": false,
"qbn_part_of_bulk_action": false
}
Note the difference in values of the keys "qbn_is_bulk_message" and "qbn_part_of_bulk_action" across the 3 examples above.
Bulk SNS Message Keys
"qbn_type"
The type of action that happened in QBench. Below are the possible action types:
- 'status-changed'
- 'entity-created'
- 'entity-updated'
- 'entity-deleted'
- 'custom'
"qbn_entity"
The data type of the action. For example "sample", "test", "batch".
"qbn_modified_by"
A small dictionary containing the information of the User/API Client that triggered the SNS message.
"qbn_ids"
An array of the IDs that were included in the bulk action.
"qbn_num_objects"
The number of objects that were included in the bulk action.
"qbn_data"
This dictionary will contain information regarding fields that were changed, related data type ids, and more.
"qbn_is_bulk_message"
This key will only exist if Bulk SNS message is enabled. It will be added onto all SNS messages.
- true: If the message is the actual Bulk SNS message.
- false: if the SNS message is not the bulk SNS message (i.e. it is from a single entity action OR it is one of the single entity SNS messages that is sent out along with bulk actions).
"qbn_part_of_bulk_action"
This key will only exist if Bulk SNS message is enabled. This key will be added to all single entity SNS messages, it will not be included in the Bulk SNS message (this is because the Bulk SNS message will have the "qbn_is_bulk_message" set to "true"). Possible values:
- true: If the SNS message is a single SNS message that is getting sent out along with the Bulk SNS message.
- false: If the SNS message is being sent because a single Action in QBench was taken (not a bulk action).
Comments
0 comments
Please sign in to leave a comment.