Class ServiceBusMessageHeaders

java.lang.Object
com.azure.spring.messaging.AzureHeaders
com.azure.spring.messaging.servicebus.support.ServiceBusMessageHeaders

public final class ServiceBusMessageHeaders extends AzureHeaders
Azure service bus message headers.

Usage example:


 import org.springframework.integration.support.MessageBuilder;
 MessageBuilder.withPayload(payload)
               .setHeader(ServiceBusMessageHeaders.MESSAGE_ID, ...)
               .build();
 
There are 16 items can be set for service bus IMessage.
  • 2 items are deprecated: ScheduledEnqueuedTimeUtc, Body.
  • 3 items should be set by Spring message: ContentType, MessageBody. ReplyTo.
  • 1 item should not be set: Properties.
  • The rest 10 items can be set by Spring message header: MessageId, TimeToLive, ScheduledEnqueueTimeUtc, SessionId, CorrelationId, To, Label, ReplyToSessionId, PartitionKey, ViaPartitionKey.
There are 11 items can be set for ServiceBusMessage.
  • 2 item should be set by Spring message: ContentType, ReplyTo.
  • The rest 9 items can be set by Spring message header: CorrelationId, Subject, MessageId, PartitionKey, To, TimeToLive, ScheduledEnqueueTime, ReplyToSessionId, SessionId
For the items can be set by Spring message header there are 8 items can be set by both IMessage and ServiceBusMessage: CorrelationId, MessageId, PartitionKey, To, TimeToLive, ScheduledEnqueueTime, ReplyToSessionId, SessionId
See Also: