# Pubsubplus-connector-aws-kinesis get the event topic when consuming in Kinesis Data Stream

**URL:** <https://community.solace.com/t/pubsubplus-connector-aws-kinesis-get-the-event-topic-when-consuming-in-kinesis-data-stream/4925>\
**Category:** Connectors & Integrations\
**Tags:** aws, solacepubsub, self-contained-connectors\
**Created:** [October 20, 2026, 12:20pm UTC](https://community.solace.com/t/pubsubplus-connector-aws-kinesis-get-the-event-topic-when-consuming-in-kinesis-data-stream/4925 "2026-10-20T12:20:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joli](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/joli/32/3098_2.png) [@joli](https://community.solace.com/u/joli)\
**Post date:** [October 20, 2026, 12:20pm UTC](https://community.solace.com/t/pubsubplus-connector-aws-kinesis-get-the-event-topic-when-consuming-in-kinesis-data-stream/4925/1 "2026-10-20T12:20:43Z")

</div>

Hi,  
apologize if this is in the wrong category. We are using the connector to stream json events into a Kinesis Data Stream. Until now we have subscribed only to one single topic in the queue connected to Kinesis, and it has been working fine.

Now we need to subscribe to more than one topics in one queue.  
Question is how the Kinesis receiver side can tell which topic each event belongs to?  
The destination in the binding names only the queue, like this:

```auto
SPRING_CLOUD_STREAM_BINDINGS_INPUT-0_DESTINATION: dp.kinesis.casino
SPRING_CLOUD_STREAM_BINDINGS_OUTPUT-0_DESTINATION: dp-kinesis-casino

```

```auto
- queueName: "dp.kinesis.casino"
    owner: "dp"
    deadMsgQueue: "dp.kinesis.casino.dmq"
    accessType: "exclusive"
    permission: "consume"
    subscription_topics:
      - "service/ledger/*/casino/>"

```

There are some header options in the user guide but the documentation could be improved.

Anyone knows if there is any header, or other option, making it possible to include the topic (`service/ledger/something/casino/`) in the payload or as a partition key for the receiving Data Stream `dp-kinesis-casino`

Maybe it is included already but we are not finding it?

---

<div class="post-metadata">

**Author:** ![amackenzie](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/amackenzie/32/1168_2.png) [@amackenzie](https://community.solace.com/u/amackenzie)\
**Post date:** [October 30, 2026, 2:58pm UTC](https://community.solace.com/t/pubsubplus-connector-aws-kinesis-get-the-event-topic-when-consuming-in-kinesis-data-stream/4925/2 "2026-10-30T14:58:23Z")

</div>

@joli there is a header allowing for dynamic publishing endpoints that can use values from the incoming message called `scst_targetDestination`

This Kinesis connector uses the `transform-headers`section of the config to define what you would like to set for various output headers.

The following should work:

```auto
solace:
  connector:
    workflows:
      <workflow-id>:
        enabled: true
        transform-headers:
          expressions:
            headers.scst_targetDestination = headers.solace_destination # might have to add .name after destination

```

This will take the incoming message header and make it where the kinesis destination goes.

I was unable to test this directly, but wanted to answer to help you along.

---

<div class="post-metadata">

**Author:** ![joli](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/joli/32/3098_2.png) [@joli](https://community.solace.com/u/joli)\
**Post date:** [November 11, 2026, 3:06pm UTC](https://community.solace.com/t/pubsubplus-connector-aws-kinesis-get-the-event-topic-when-consuming-in-kinesis-data-stream/4925/3 "2026-11-11T15:06:39Z")

</div>

Thank you for the suggestion @amackenzie !

Unfortunately, the connector removes the topic header (`solace_destination`) before any transform runs, which is why we only got null values when trying.

We raised a support issue and now got a complete working solution from Solace 🙏

If anyone else using the solace-pubsub-connector-aws-kinesis:1.0.1 is having the same problem, here is the answer we got:

> Kinesis Data Streams records don’t support headers. Each record has only the message data and a partition key, so the topic name has to go into one of those two places.
> 
> The connector removes the topic header (`solace_destination`) before your transforms run, which is why you couldn’t use it. It can still be read from the original Solace message, which the connector keeps internally. The expression below reads the topic from there and puts it in a header called `aws_partitionKey`, which Kinesis uses as the partition key. Header transforms run before payload transforms, so you can also add the topic to the JSON body.
> 
> Example configuration:  
> Add the `transform-headers` and `transform-payloads` sections below to each workflow in your `application.yml`. Your existing settings can stay as they are.

```auto
solace:
  connector:
    workflows:
      0:
        enabled: true
        acknowledgment:
          publish-async: true
        transform-headers:
          expressions:
            # Use the Solace topic as the Kinesis partition key
            aws_partitionKey: "T(org.apache.commons.lang3.reflect.FieldUtils).readField(headers['acknowledgmentCallback'], 'messageContainer', true).message.destination.name"
        transform-payloads:
          expressions:
            # Send the message as clean JSON (no prefix)
            - transform: "#isPayloadBytes(payload) ? payload : payload.toString().getBytes(T(java.nio.charset.StandardCharsets).UTF_8)"

          expressions:
            - transform: "#isPayloadBytes(payload) ? payload : payload.toString().getBytes(T(java.nio.charset.StandardCharsets).UTF_8)"

```
