Pub-sub (v0.1)

http://localhost

Table of contents

PubSub API

API for event-driven approach

/pubsub

POST /pubsub/event-types

Create new event type

POST /pubsub/event-types
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Event Descriptor data model",
  "javaType": "org.folio.rest.jaxrs.model.EventDescriptor",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "eventType": {
      "description": "Unique Event type, human-readable String, not UUID",
      "type": "string"
    },
    "description": {
      "description": "Detailed description of the event type",
      "type": "string"
    },
    "eventTTL": {
      "description": "Default time-to-live (TTL) for events of this type in minutes",
      "type": "integer"
    },
    "signed": {
      "description": "Indicates whether all events of this event type must be digitally signed by the publisher",
      "type": "boolean",
      "default": false
    },
    "tmp": {
      "description": "Indicates whether descriptor is temporary and should be overwritten",
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "eventType",
    "eventTTL"
  ]
}

Example:

{
  "eventType": "CREATED_SRS_MARC_BIB_RECORD_WITH_ORDER_DATA",
  "description": "Created SRS Marc Bibliographic Record with order data in 9xx fields",
  "eventTTL": 1,
  "signed": false
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created event-type item

Body

Media type: application/json

Type: any

Example:

{
  "eventType": "CREATED_SRS_MARC_BIB_RECORD_WITH_ORDER_DATA",
  "description": "Created SRS Marc Bibliographic Record with order data in 9xx fields",
  "eventTTL": 1,
  "signed": false
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to add event-type -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create event-types -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /pubsub/event-types

Get a list of evet type descriptors

GET /pubsub/event-types
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of event-type items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of Event Descriptors",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "eventDescriptors": {
      "description": "List of Event Descriptors",
      "type": "array",
      "id": "eventDescriptorsList",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Event Descriptor data model",
        "javaType": "org.folio.rest.jaxrs.model.EventDescriptor",
        "additionalProperties": false,
        "properties": {
          "eventType": {
            "description": "Unique Event type, human-readable String, not UUID",
            "type": "string"
          },
          "description": {
            "description": "Detailed description of the event type",
            "type": "string"
          },
          "eventTTL": {
            "description": "Default time-to-live (TTL) for events of this type in minutes",
            "type": "integer"
          },
          "signed": {
            "description": "Indicates whether all events of this event type must be digitally signed by the publisher",
            "type": "boolean",
            "default": false
          },
          "tmp": {
            "description": "Indicates whether descriptor is temporary and should be overwritten",
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "eventType",
          "eventTTL"
        ]
      }
    },
    "totalRecords": {
      "description": "Total number of Event Descriptors",
      "type": "integer"
    }
  },
  "excludedFromEqualsAndHashCode": [
    "totalRecords"
  ],
  "required": [
    "eventDescriptors",
    "totalRecords"
  ]
}

Example:

{
  "eventDescriptors": [
    {
      "eventType": "CREATED_SRS_MARC_BIB_RECORD_WITH_ORDER_DATA",
      "description": "Created SRS Marc Bibliographic Record with order data in 9xx fields",
      "eventTTL": 1,
      "signed": false
    }
  ],
  "totalRecords": 1
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

unable to list event-types -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list event-types -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /pubsub/event-types/{eventTypeName}

Update event-type item with given {event-typeId}

PUT /pubsub/event-types/{eventTypeName}
URI Parameters
  • eventTypeName: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Event Descriptor data model",
  "javaType": "org.folio.rest.jaxrs.model.EventDescriptor",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "eventType": {
      "description": "Unique Event type, human-readable String, not UUID",
      "type": "string"
    },
    "description": {
      "description": "Detailed description of the event type",
      "type": "string"
    },
    "eventTTL": {
      "description": "Default time-to-live (TTL) for events of this type in minutes",
      "type": "integer"
    },
    "signed": {
      "description": "Indicates whether all events of this event type must be digitally signed by the publisher",
      "type": "boolean",
      "default": false
    },
    "tmp": {
      "description": "Indicates whether descriptor is temporary and should be overwritten",
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "eventType",
    "eventTTL"
  ]
}

Example:

{
  "eventType": "CREATED_SRS_MARC_BIB_RECORD_WITH_ORDER_DATA",
  "description": "Created SRS Marc Bibliographic Record with order data in 9xx fields",
  "eventTTL": 1,
  "signed": false
}

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Event Descriptor data model",
  "javaType": "org.folio.rest.jaxrs.model.EventDescriptor",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "eventType": {
      "description": "Unique Event type, human-readable String, not UUID",
      "type": "string"
    },
    "description": {
      "description": "Detailed description of the event type",
      "type": "string"
    },
    "eventTTL": {
      "description": "Default time-to-live (TTL) for events of this type in minutes",
      "type": "integer"
    },
    "signed": {
      "description": "Indicates whether all events of this event type must be digitally signed by the publisher",
      "type": "boolean",
      "default": false
    },
    "tmp": {
      "description": "Indicates whether descriptor is temporary and should be overwritten",
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "eventType",
    "eventTTL"
  ]
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update event-type -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"event-type not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /pubsub/event-types/{eventTypeName}

Delete event-type item with given {event-typeId}

DELETE /pubsub/event-types/{eventTypeName}
URI Parameters
  • eventTypeName: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to delete event-type -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"event-type not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /pubsub/event-types/{eventTypeName}

Retrieve event-type item with given {event-typeId}

GET /pubsub/event-types/{eventTypeName}
URI Parameters
  • eventTypeName: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Event Descriptor data model",
  "javaType": "org.folio.rest.jaxrs.model.EventDescriptor",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "eventType": {
      "description": "Unique Event type, human-readable String, not UUID",
      "type": "string"
    },
    "description": {
      "description": "Detailed description of the event type",
      "type": "string"
    },
    "eventTTL": {
      "description": "Default time-to-live (TTL) for events of this type in minutes",
      "type": "integer"
    },
    "signed": {
      "description": "Indicates whether all events of this event type must be digitally signed by the publisher",
      "type": "boolean",
      "default": false
    },
    "tmp": {
      "description": "Indicates whether descriptor is temporary and should be overwritten",
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "eventType",
    "eventTTL"
  ]
}

Example:

{
  "eventType": "CREATED_SRS_MARC_BIB_RECORD_WITH_ORDER_DATA",
  "description": "Created SRS Marc Bibliographic Record with order data in 9xx fields",
  "eventTTL": 1,
  "signed": false
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"event-type not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /pubsub/event-types/{eventTypeName}/publishers

API to retrieve registered Publishers

GET /pubsub/event-types/{eventTypeName}/publishers
URI Parameters
  • eventTypeName: required (string)

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of Messaging Modules",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "messagingModules": {
      "description": "List of Messaging Modules",
      "type": "array",
      "id": "messagingModulesList",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Module data model",
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "UUID",
            "type": "string",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          },
          "eventType": {
            "description": "Unique Event type, human-readable String, not UUID",
            "type": "string"
          },
          "moduleId": {
            "description": "Module name and version",
            "type": "string"
          },
          "tenantId": {
            "description": "Tenant id",
            "type": "string"
          },
          "moduleRole": {
            "description": "Module role",
            "type": "string",
            "enum": [
              "PUBLISHER",
              "SUBSCRIBER"
            ]
          },
          "activated": {
            "description": "Indicates whether event type is activated for a tenant, true by default",
            "type": "boolean",
            "default": true
          },
          "subscriberCallback": {
            "description": "Endpoint to deliver events of certain type",
            "type": "string"
          }
        },
        "required": [
          "eventType",
          "moduleId",
          "tenantId",
          "moduleRole"
        ]
      }
    },
    "totalRecords": {
      "description": "Total number of Messaging Modules",
      "type": "integer"
    }
  },
  "excludedFromEqualsAndHashCode": [
    "totalRecords"
  ],
  "required": [
    "messagingModules",
    "totalRecords"
  ]
}

DELETE /pubsub/event-types/{eventTypeName}/publishers

Remove publisher declaration for certain event type

DELETE /pubsub/event-types/{eventTypeName}/publishers
URI Parameters
  • eventTypeName: required (string)
Query Parameters
  • moduleId: required (string)

    Publisher module name and version

    Example:

    mod-pubsub-1.0.0

Response 204

GET /pubsub/event-types/{eventTypeName}/subscribers

API to retrieve registered Subscribers

GET /pubsub/event-types/{eventTypeName}/subscribers
URI Parameters
  • eventTypeName: required (string)

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of Messaging Modules",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "messagingModules": {
      "description": "List of Messaging Modules",
      "type": "array",
      "id": "messagingModulesList",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Module data model",
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "UUID",
            "type": "string",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          },
          "eventType": {
            "description": "Unique Event type, human-readable String, not UUID",
            "type": "string"
          },
          "moduleId": {
            "description": "Module name and version",
            "type": "string"
          },
          "tenantId": {
            "description": "Tenant id",
            "type": "string"
          },
          "moduleRole": {
            "description": "Module role",
            "type": "string",
            "enum": [
              "PUBLISHER",
              "SUBSCRIBER"
            ]
          },
          "activated": {
            "description": "Indicates whether event type is activated for a tenant, true by default",
            "type": "boolean",
            "default": true
          },
          "subscriberCallback": {
            "description": "Endpoint to deliver events of certain type",
            "type": "string"
          }
        },
        "required": [
          "eventType",
          "moduleId",
          "tenantId",
          "moduleRole"
        ]
      }
    },
    "totalRecords": {
      "description": "Total number of Messaging Modules",
      "type": "integer"
    }
  },
  "excludedFromEqualsAndHashCode": [
    "totalRecords"
  ],
  "required": [
    "messagingModules",
    "totalRecords"
  ]
}

DELETE /pubsub/event-types/{eventTypeName}/subscribers

API to remove Subscriber declaration for certain event type

DELETE /pubsub/event-types/{eventTypeName}/subscribers
URI Parameters
  • eventTypeName: required (string)
Query Parameters
  • moduleId: required (string)

    Subscriber module name and version

    Example:

    mod-pubsub-1.0.0

Response 204

POST /pubsub/event-types/declare/publisher

Declare a publisher for a set of event types

POST /pubsub/event-types/declare/publisher
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Describes types of events the module publishes",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "moduleId": {
      "description": "Publisher module name and version",
      "type": "string"
    },
    "eventDescriptors": {
      "description": "List of event descriptors published by the module",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Event Descriptor data model",
        "javaType": "org.folio.rest.jaxrs.model.EventDescriptor",
        "additionalProperties": false,
        "properties": {
          "eventType": {
            "description": "Unique Event type, human-readable String, not UUID",
            "type": "string"
          },
          "description": {
            "description": "Detailed description of the event type",
            "type": "string"
          },
          "eventTTL": {
            "description": "Default time-to-live (TTL) for events of this type in minutes",
            "type": "integer"
          },
          "signed": {
            "description": "Indicates whether all events of this event type must be digitally signed by the publisher",
            "type": "boolean",
            "default": false
          },
          "tmp": {
            "description": "Indicates whether descriptor is temporary and should be overwritten",
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "eventType",
          "eventTTL"
        ]
      }
    }
  },
  "required": [
    "moduleId",
    "eventDescriptors"
  ]
}

Response 201

Response 400

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /pubsub/event-types/declare/subscriber

POST /pubsub/event-types/declare/subscriber
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Describes the types of events the module is subscribed",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "moduleId": {
      "description": "Subscriber module name and version",
      "type": "string"
    },
    "subscriptionDefinitions": {
      "description": "List of event types (subscription definition) the module is subscribed",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Describes subscription to particular event type",
        "javaType": "org.folio.rest.jaxrs.model.SubscriptionDefinition",
        "additionalProperties": false,
        "properties": {
          "eventType": {
            "description": "Unique Event type, human-readable String, not UUID",
            "type": "string"
          },
          "callbackAddress": {
            "description": "Endpoint to deliver events of certain event type",
            "type": "string"
          }
        },
        "required": [
          "eventType",
          "callbackAddress"
        ]
      }
    }
  },
  "required": [
    "moduleId",
    "subscriptionDefinitions"
  ]
}

Response 201

Response 400

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /pubsub/history

Get activity history

GET /pubsub/history
Query Parameters
  • startDate: required (string - pattern: \d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?Z?)

    start date of the period of time for which audit messages are required

    Example:

    2019-09-20T12:00:00
  • endDate: required (string - pattern: \d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?Z?)

    end date of the period of time for which audit messages are required

    Example:

    2019-09-27T12:00:00
  • eventId: (string)

    eventId by which audit messages should be filtered

  • eventType: (string)

    eventType by which audit messages should be filtered

  • correlationId: (string)

    correlationId by which audit messages should be filtered

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of Audit Messages",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "auditMessages": {
      "description": "List of Audit Messages",
      "type": "array",
      "id": "auditMessagesList",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Message payload for event",
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "UUID",
            "type": "string",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          },
          "eventId": {
            "description": "Unique Event id, UUID",
            "type": "string",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          },
          "eventType": {
            "description": "Unique Event type, human-readable String, not UUID",
            "type": "string"
          },
          "correlationId": {
            "description": "Id to track related events, can be a meaningful string or a UUID",
            "type": "string"
          },
          "tenantId": {
            "description": "Tenant id",
            "type": "string"
          },
          "createdBy": {
            "description": "Username of the user whose action caused an event",
            "type": "string"
          },
          "publishedBy": {
            "description": "Name and version of the module that published the event",
            "type": "string"
          },
          "auditDate": {
            "description": "Date of event's state in timestamp",
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "description": "Current state of the message",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "additionalProperties": false,
            "enum": [
              "CREATED",
              "PUBLISHED",
              "RECEIVED",
              "DELIVERED",
              "REJECTED"
            ]
          },
          "errorMessage": {
            "description": "Error message in case there is one",
            "type": "string"
          }
        },
        "required": [
          "id",
          "eventId",
          "tenantId"
        ]
      }
    },
    "totalRecords": {
      "description": "Total number of Audit Messages",
      "type": "integer"
    }
  },
  "excludedFromEqualsAndHashCode": [
    "totalRecords"
  ],
  "required": [
    "auditMessages",
    "totalRecords"
  ]
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /pubsub/audit-messages/{eventId}/payload

Get audit message payload by event id

GET /pubsub/audit-messages/{eventId}/payload
URI Parameters
  • eventId: required (string)

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Message payload for event",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "eventId": {
      "description": "Unique Event type id, UUID",
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
    },
    "content": {
      "description": "String representation of JSON message's payload",
      "type": "string"
    }
  },
  "excludedFromEqualsAndHashCode": [
    "content"
  ],
  "required": [
    "eventId"
  ]
}

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /pubsub/publish

POST /pubsub/publish
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Event data model",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
    },
    "eventType": {
      "description": "Unique Event type, human-readable String, not UUID",
      "type": "string"
    },
    "eventMetadata": {
      "description": "Event metadata",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "tenantId": {
          "description": "Tenant id",
          "type": "string"
        },
        "eventTTL": {
          "description": "Time-to-live (TTL) for event in minutes",
          "type": "integer"
        },
        "correlationId": {
          "description": "Id to track related events, can be a meaningful string or a UUID",
          "type": "string"
        },
        "originalEventId": {
          "description": "Id of the event that started the sequence of related events",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
        },
        "publisherCallback": {
          "description": "Allows a publisher to provide a callback endpoint or an error Event Type to be notified that despite the fact that there are subscribers for such an event type no one has received the event within the specified period of time",
          "type": "object",
          "properties": {
            "endpoint": {
              "description": "Callback endpoint",
              "type": "string"
            },
            "eventType": {
              "description": "Error Event Type",
              "type": "string"
            }
          }
        },
        "createdDate": {
          "description": "Timestamp when event was created",
          "type": "string",
          "format": "date-time"
        },
        "publishedDate": {
          "description": "Timestamp when event was initially published to the underlying topic",
          "type": "string",
          "format": "date-time"
        },
        "createdBy": {
          "description": "Username of the user whose action caused an event",
          "type": "string"
        },
        "publishedBy": {
          "description": "Name and version of the module that published an event",
          "type": "string"
        }
      },
      "required": [
        "tenantId",
        "eventTTL",
        "publishedBy"
      ]
    },
    "eventPayload": {
      "description": "A payload for the event can be of any type of serializable data and it is up to a publisher and a consumer to agree on the data structures they want to exchange",
      "type": "string"
    }
  },
  "excludedFromEqualsAndHashCode": [
    "eventMetadata",
    "eventPayload"
  ],
  "required": [
    "id",
    "eventType",
    "eventMetadata"
  ]
}

Response 204

Response 400

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

DELETE /pubsub/messaging-modules

DELETE /pubsub/messaging-modules
Query Parameters
  • moduleId: required (string)

    module name and version

    Example:

    mod-pubsub-1.0.0
  • moduleRole: required (string - pattern: PUBLISHER|SUBSCRIBER)

    module role (PUBLISHER/SUBSCRIBER)

    Example:

    PUBLISHER

Response 204

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request