Skip to content

/AWS1/IF_KNS=>REGISTERSTREAMCONSUMER()

About RegisterStreamConsumer

Registers a consumer with a Kinesis data stream. When you use this operation, the consumer you register can then call SubscribeToShard to receive data from the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every shard you subscribe to. This rate is unaffected by the total number of consumers that read from the same stream.

You can add tags to the registered consumer when making a RegisterStreamConsumer request by setting the Tags parameter. If you pass the Tags parameter, in addition to having the kinesis:RegisterStreamConsumer permission, you must also have the kinesis:TagResource permission for the consumer that will be registered. Tags will take effect from the CREATING status of the consumer.

With On-demand Advantage streams, you can register up to 50 consumers per stream to use Enhanced Fan-out. With On-demand Standard and Provisioned streams, you can register up to 20 consumers per stream to use Enhanced Fan-out. A given consumer can only be registered with one stream at a time.

For an example of how to use this operation, see Enhanced Fan-Out Using the Kinesis Data Streams API.

The use of this operation has a limit of five transactions per second per account. Also, only 5 consumers can be created simultaneously. In other words, you cannot have more than 5 consumers in a CREATING status at the same time. Registering a 6th consumer while there are 5 in a CREATING status results in a LimitExceededException.

Method Signature

METHODS /AWS1/IF_KNS~REGISTERSTREAMCONSUMER
  IMPORTING
    !IV_STREAMARN TYPE /AWS1/KNSSTREAMARN OPTIONAL
    !IV_CONSUMERNAME TYPE /AWS1/KNSCONSUMERNAME OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_KNSTAGMAP_W=>TT_TAGMAP OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_knsregstreamconsout
  RAISING
    /AWS1/CX_KNSINVALIDARGUMENTEX
    /AWS1/CX_KNSLIMITEXCEEDEDEX
    /AWS1/CX_KNSRESOURCEINUSEEX
    /AWS1/CX_KNSRESOURCENOTFOUNDEX
    /AWS1/CX_KNSCLIENTEXC
    /AWS1/CX_KNSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_streamarn TYPE /AWS1/KNSSTREAMARN /AWS1/KNSSTREAMARN

The ARN of the Kinesis data stream that you want to register the consumer with. For more info, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces.

iv_consumername TYPE /AWS1/KNSCONSUMERNAME /AWS1/KNSCONSUMERNAME

For a given Kinesis data stream, each consumer must have a unique name. However, consumer names don't have to be unique across data streams.

Optional arguments:

it_tags TYPE /AWS1/CL_KNSTAGMAP_W=>TT_TAGMAP TT_TAGMAP

A set of up to 50 key-value pairs. A tag consists of a required key and an optional value.

RETURNING

oo_output TYPE REF TO /aws1/cl_knsregstreamconsout /AWS1/CL_KNSREGSTREAMCONSOUT

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

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->registerstreamconsumer(
  it_tags = VALUE /aws1/cl_knstagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_knstagmap_w=>ts_tagmap_maprow(
        value = new /aws1/cl_knstagmap_w( |string| )
        key = |string|
      )
    )
  )
  iv_consumername = |string|
  iv_streamarn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_consumer = lo_result->get_consumer( ).
  IF lo_consumer IS NOT INITIAL.
    lv_consumername = lo_consumer->get_consumername( ).
    lv_consumerarn = lo_consumer->get_consumerarn( ).
    lv_consumerstatus = lo_consumer->get_consumerstatus( ).
    lv_timestamp = lo_consumer->get_consumercreationtsmp( ).
  ENDIF.
ENDIF.