Skip to main content

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 CaseResponseStatus Code
Postive Scenariosuccess200
if "queueName" will be emptySqs name can not be empty400
if "queueName" will be invalidError message with "Unable to process message as the specified queue does not exist"500
if "Messages" will be emptyMessage List cannot be empty400
if "messageId" will be missing for multiple messagesUnable to process message as JSONObject["messageId"] not found500

The Execute Message functionality scenarios are:

Use CaseResponseStatus Code
Positive ScenarioSuccess or response json200
if "serviceName" will be emptyService name cannot be empty400
if "servicename" will be invalid or not mapped into the databaseUnable to process service as Url is not mapped to the database500