The eventqueue is a mechanism for receiving events from CONNECT.

Eventqueue 

Next event resource 

Get the next available event. The event should be acknowledged using the acknowledge endpoint. Once an event has been fetched, it will not be returned in subsequent calls to this endpoint for a while. If the message is not acked within 30 seconds, it will become visible again, meaning that it will be returned in new calls to get next event.

Get next event
/event/queue/{queueId}/next
  • Parameters
  • queueId
    string (required) 

    The queue id.

  • Request
  • Headers
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
  • Response  200
  • The response will contain these fields:

    • messageId: A unique ID for this message.

    • receiptId: The receiptId is used to identify the message when acknowledging it.

    • event: The event itself.

    Headers
    Content-Type: application/json
    Body
    {
      "messageId": "fdecd1e9-21c1-40b2-928c-046d3f998746",
      "receiptId": "AQEB8rC5hveCO5wvNUJ4IYu3GkFSZE/6XoXnm1Xr+F9",
      "event": {
        "grantorId": "SOMEONE",
        "timestamp": 1425730400084,
        "grantorContext": "19368263",
        "eventId": "5979946719993921536",
        "userId": "0000000000000000000",
        "link": [
          {
            "rel": "creator",
            "type": "subscription",
            "idref": "51272aa17fc04000",
            "href": "users/0000000000000000000/subs/51272aa17fc04000"
          }
        ],
        "consistencyLevel": "NONE",
        "rightId": "52fd09dbd3400000",
        "eventName": "com.comoyo.events.right.RightGranted",
        "sku": "CMO-STO-5-M",
        "externalRef": "51272aa17fc04000",
        "isoTimestamp": "2015-03-07T12:13:20.084Z"
      },
      "link": [
        {
          "rel": "ack",
          "href": "ack?receiptId=AQEB8rC5hveCO5wvNUJ4IYu3GkFSZE%2F6XoXnm1Xr%2BF9"
        }
      ]
    }
  • Response  204
  • No events were available for this user.

    Headers
    Content-Type: application/json
  • Response  500
  • There has been a server-side processing error. Retry the request in a while if possible.

Acknowledge event resource 

Acknowledge an event that was fetched previously.

Acknowledge message
/event/queue/{queueId}/ack?receiptId={receiptId}
  • Parameters
  • queueId
    string (required) 

    The queue id.

    receiptId
    string (required) 

    The message receipt id.

  • Request
  • This request takes no payload.

    Headers
    Content-Type: application/json
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
  • Response  200
  • The message has been deleted. The body should be ignored.

    Headers
    Content-Type: application/json
    Body
    {
      "responseCode": "OK",
      "messages": [],
      "errorMessage": null
    }
  • Response  404
  • The specified queueId and/or receiptId was not found.

    Headers
    Content-Type: text/plain
  • Response  500
  • There has been a server-side processing error. Retry the request in a while if possible.

Queue status resource 

Get the message count status for the queue. This endpoint reports both the number of available and in-flight messages. Due to the distributed nature of the underlying queues, both numbers are approximate at any given point in time. Available messages are those that are available on the queue for a client to read. In-flight messages are those that have been read by a client but not acknowledged.

Get available and in-flight message counts
/event/queue/{queueId}/stat
  • Parameters
  • queueId
    string (required) 

    The queue id.

  • Request
  • Headers
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
  • Response  200
  • The response will contain these fields:

    • responseCode: Status of the response. One of “OK”, “NOT_FOUND” or “ERROR”

    • messagesAvailable: The count of messages that are available for delivery.

    • messagesInFlight: The count of messages that have been delivered but not acknowledged.

    Headers
    Content-Type: application/json
    Body
    {
      "responseCode": "OK",
      "messagesAvailable": 6,
      "messagesInFlight": 0
    }
  • Response  500
  • There has been a server-side processing error. Retry the request in a while if possible.

© 2017 Telenor Digital AS