Spring starter spring-cloud-azure-starter-servicebus-jms manage contentType & sessionId

47 Views Asked by At

I was wondering if I'm having some conceptual problems or if I just struggle with implementation details. According to the Azure Service Bus documentation I might control the partitioning via sessionId. But with Spring Boot JMS starter I couldn't find any way to set the sessionId manually/programmaticaly based on the objects identifier. Not even using the MessageCreater interface, neither the MessagePostProcessor interface worked for me. The jakarta.jms.Message interface unfortunately does not provide this field.

Further I can't also set the contentType header, same problem as with sessionId.

How can I solve this? Do I need to use the azure service bus without the jms starter? Whould that work for me in this case or said differently, is that the planned way to do it in such cases?

Here the code base how I send the message:

String body = objectMapper.writeValueAsString(event);
jmsTemplate.convertAndSend(TOPIC_NAME, body);
0

There are 0 best solutions below