Try PubSub+

How to get SDTMap properties in Spring Cloud Stream

anan1401anan1401 Member Posts: 1
edited September 13 in Tips and Tricks #1

We are using SDTMap to set custom application properties in one service which produce message..which uses normal springboot service. We access solace message api and create SDTMap.

In Consumer we use spring cloud stream to receive and process.

How to get SDTMap properties in Spring Cloud Stream?


  • JeffJeff Member, Employee Posts: 1 Solace Employee
    edited September 13 #2

    Hi @anan1401,

    User properties can be directly accessed as Spring message headers.

    For example, suppose you published a message containing a string user property called some-user-property, you can then get it in your consumer as follows:

    public Consumer<Message<?>> sink(){
        return message -> {
            message.getHeaders().get("some-user-property", String.class);
            // other message processing

    On the other hand, if what you're asking about are SDTMap payloads, then you can get that as-if you're getting any other type of message payload.


    public Consumer<SDTMap> sink(){
        return payload -> {
            // Do something with this SDTMap payload
  • AaronAaron Member, Moderator, Employee Posts: 279 Solace Employee

    Huh! I didn't know that..!

  • honghong Administrator Posts: 273 admin

    Hi @anan1401, FYI. I changed the question in the title to make it easier for others to find it via Google. :)

Sign In or Register to comment.