Skip to content

/AWS1/IF_IOP=>LISTSUBSCRIPTIONS()

About ListSubscriptions

Returns a list of all subscriptions for MQTT clients with active sessions, including offline clients with persistent sessions.

Requires permission to access the ListSubscriptions action.

Method Signature

METHODS /AWS1/IF_IOP~LISTSUBSCRIPTIONS
  IMPORTING
    !IV_CLIENTID TYPE /AWS1/IOPCLIENTID OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/IOPNEXTTOKEN OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/IOPMAXRESULTS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ioplistsubscrresponse
  RAISING
    /AWS1/CX_IOPFORBIDDENEXCEPTION
    /AWS1/CX_IOPINTERNALFAILUREEX
    /AWS1/CX_IOPINVALIDREQUESTEX
    /AWS1/CX_IOPRESOURCENOTFOUNDEX
    /AWS1/CX_IOPTHROTTLINGEX
    /AWS1/CX_IOPCLIENTEXC
    /AWS1/CX_IOPSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_clientid TYPE /AWS1/IOPCLIENTID /AWS1/IOPCLIENTID

The unique identifier of the MQTT client to list subscriptions for. The client ID can't start with a dollar sign ($).

MQTT client IDs must be URL encoded (percent-encoded) when they contain characters that are not valid in HTTP requests, such as spaces, forward slashes (/), and UTF-8 characters.

Optional arguments:

iv_nexttoken TYPE /AWS1/IOPNEXTTOKEN /AWS1/IOPNEXTTOKEN

To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

iv_maxresults TYPE /AWS1/IOPMAXRESULTS /AWS1/IOPMAXRESULTS

The maximum number of subscriptions to return in a single request. By default, this is set to 20.

RETURNING

oo_output TYPE REF TO /aws1/cl_ioplistsubscrresponse /AWS1/CL_IOPLISTSUBSCRRESPONSE

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->listsubscriptions(
  iv_clientid = |string|
  iv_maxresults = 123
  iv_nexttoken = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_subscriptions( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_topicfilter = lo_row_1->get_topicfilter( ).
      lv_qos = lo_row_1->get_qos( ).
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.