batch_put_message

IoTEventsData.Client.batch_put_message(**kwargs)

Sends a set of messages to the IoT Events system. Each message payload is transformed into the input you specify ( "inputName" ) and ingested into any detectors that monitor that input. If multiple messages are sent, the order in which the messages are processed isn't guaranteed. To guarantee ordering, you must send messages one at a time and wait for a successful response.

See also: AWS API Documentation

Request Syntax

response = client.batch_put_message(
    messages=[
        {
            'messageId': 'string',
            'inputName': 'string',
            'payload': b'bytes',
            'timestamp': {
                'timeInMillis': 123
            }
        },
    ]
)
Parameters
messages (list) --

[REQUIRED]

The list of messages to send. Each message has the following format: '{ "messageId": "string", "inputName": "string", "payload": "string"}'

  • (dict) --

    Information about a message.

    • messageId (string) -- [REQUIRED]

      The ID to assign to the message. Within each batch sent, each "messageId" must be unique.

    • inputName (string) -- [REQUIRED]

      The name of the input into which the message payload is transformed.

    • payload (bytes) -- [REQUIRED]

      The payload of the message. This can be a JSON string or a Base-64-encoded string representing binary data (in which case you must decode it).

    • timestamp (dict) --

      The timestamp associated with the message.

      • timeInMillis (integer) --

        The value of the timestamp, in the Unix epoch format.

Return type
dict
Returns
Response Syntax
{
    'BatchPutMessageErrorEntries': [
        {
            'messageId': 'string',
            'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
            'errorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --
    • BatchPutMessageErrorEntries (list) --

      A list of any errors encountered when sending the messages.

      • (dict) --

        Contains information about the errors encountered.

        • messageId (string) --

          The ID of the message that caused the error. (See the value corresponding to the "messageId" key in the "message" object.)

        • errorCode (string) --

          The error code.

        • errorMessage (string) --

          A message that describes the error.

Exceptions

  • IoTEventsData.Client.exceptions.InvalidRequestException
  • IoTEventsData.Client.exceptions.InternalFailureException
  • IoTEventsData.Client.exceptions.ServiceUnavailableException
  • IoTEventsData.Client.exceptions.ThrottlingException