> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.kafka.platform.SendMessage

- Component: `appmixer.kafka.platform.SendMessage`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.kafka 1.2.7](https://connectors.appmixer.com/connector/appmixer.kafka/1.2.7.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.kafka/1.2.7/component/appmixer.kafka.platform.SendMessage>

Publish a message.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Topic (`topic`) | text | Enter a topic. |
| Value (`value`) | textarea | Enter a value. |
| Key (`key`) | text | Enter a key. It is used to decide which partition the message will be sent to. For example, if you use an `orderId` as the key, you can ensure that all messages regarding that order will be processed in order. |
| Acks (`acks`) | select | Control the number of required acks. |
| Timeout (`timeout`) | number | The time to await a response in ms. |
| Partition (`partition`) | number | Which partition to send the message to. If no partition is specified but a key is present choose a partition based on a hash (murmur2) of the key. If no partition or key is present choose a partition in a round-robin fashion. |
| Timestamp (`timestamp`) | date-time | The timestamp of when the message was created. UTC timestamp with millisecond precision. |
| Headers (`headers`) | textarea | Metadata to associate with your message in a JSON format. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Key (`key`) | string | - |
| Value (`value`) | string | - |
| Topic (`topic`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.kafka.platform.SendMessage",
  "author": "David Durman <david@client.io>",
  "description": "Publish a message.",
  "private": false,
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:kafka"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "topic": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "acks": {
            "type": "string"
          },
          "timeout": {
            "type": "number"
          },
          "partition": {
            "type": "number"
          },
          "timestamp": {
            "type": "string"
          },
          "headers": {
            "type": "string"
          }
        },
        "required": [
          "topic",
          "value"
        ]
      },
      "inspector": {
        "inputs": {
          "topic": {
            "type": "text",
            "index": 1,
            "label": "Topic",
            "tooltip": "Enter a topic."
          },
          "value": {
            "type": "textarea",
            "index": 2,
            "label": "Value",
            "tooltip": "Enter a value."
          },
          "key": {
            "type": "text",
            "index": 3,
            "label": "Key",
            "tooltip": "Enter a key. It is used to decide which partition the message will be sent to. For example, if you use an <code>orderId</code> as the key, you can ensure that all messages regarding that order will be processed in order."
          },
          "acks": {
            "type": "select",
            "options": [
              {
                "content": "All insync replicas must acknowledge",
                "value": "-1"
              },
              {
                "content": "No acknowledgments",
                "value": "0"
              },
              {
                "content": "Only waits for the leader to acknowledge",
                "value": "1"
              }
            ],
            "index": 4,
            "label": "Acks",
            "tooltip": "Control the number of required acks."
          },
          "timeout": {
            "type": "number",
            "index": 5,
            "label": "Timeout",
            "tooltip": "The time to await a response in ms."
          },
          "partition": {
            "type": "number",
            "index": 7,
            "label": "Partition",
            "tooltip": "Which partition to send the message to. If no partition is specified but a key is present choose a partition based on a hash (murmur2) of the key. If no partition or key is present choose a partition in a round-robin fashion."
          },
          "timestamp": {
            "type": "date-time",
            "config": {
              "enableTime": true
            },
            "index": 8,
            "label": "Timestamp",
            "tooltip": "The timestamp of when the message was created. UTC timestamp with millisecond precision."
          },
          "headers": {
            "type": "textarea",
            "index": 9,
            "label": "Headers",
            "tooltip": "Metadata to associate with your message in a JSON format."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Key",
          "value": "key",
          "schema": {
            "type": "string",
            "examples": [
              "key1"
            ],
            "example": "order-1001"
          }
        },
        {
          "label": "Value",
          "value": "value",
          "schema": {
            "type": "string",
            "examples": [
              "Hello world"
            ],
            "example": "{\"orderId\":1001,\"status\":\"shipped\"}"
          }
        },
        {
          "label": "Topic",
          "value": "topic",
          "schema": {
            "type": "string",
            "examples": [
              "topic1"
            ],
            "example": "orders"
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
