Event Trigger
Development
Requirements
- JDK 11
Inputs
Publish Message
The publish Message functionality expects these data elements for single message:
URL: http://localhost:11121/eventTrigger/v1/Message
[
{
"queueName": "event-trigger-queue-sqs",
"messages": [
{
"TopicArn": "topic",
"Message": {
"batchId": "1",
"name": "claim",
"status": "completed"
}
}
]
}
]
The publish Message functionality expects these data elements for multiple messages:
[
{
"queueName": "event-trigger-queue-sqs",
"messages": [
{
"messageId": "101",
"TopicArn": "topic",
"Message": {
"batchId": "1",
"name": "claim",
"status": "completed"
}
},
{
"messageId": "102",
"TopicArn": "topic",
"Message": {
"batchId": "2",
"name": "claim",
"status": "completed"
}
}
]
}
]
Execute Service
The Execute service functionality expects these data elements:
URL: http://localhost:11121/eventTrigger/v1/executeService?serviceName=event-trigger-service
[
{
"queueName": "event-trigger-queue-sqs",
"messages": [
{
"messageId": "101",
"TopicArn": "topic",
"Message": {
"batchId": "1",
"name": "claim",
"status": "completed"
}
}
]
}
]
Outputs
- The Publish message functionality response will be “success” with “200” status code.
- Message(s) will be display in sqs queue.
- The Execute service functionality responses will be “success” or response json with “200” status code.
Behavior/Testing
The Publish Message functionality scenarios are:
| Use Case | Response | Status Code |
|---|---|---|
| Postive Scenario | success | 200 |
| if "queueName" will be empty | Sqs name can not be empty | 400 |
| if "queueName" will be invalid | Error message with "Unable to process message as the specified queue does not exist" | 500 |
| if "Messages" will be empty | Message List cannot be empty | 400 |
| if "messageId" will be missing for multiple messages | Unable to process message as JSONObject["messageId"] not found | 500 |
The Execute Message functionality scenarios are:
| Use Case | Response | Status Code |
|---|---|---|
| Positive Scenario | Success or response json | 200 |
| if "serviceName" will be empty | Service name cannot be empty | 400 |
| if "servicename" will be invalid or not mapped into the database | Unable to process service as Url is not mapped to the database | 500 |