Official Content

With the Message Broker API, you can send messages to Azure Service Bus.

Message attributes are represented as a collection of a MessageProperty SDT that is a collection (property / value), as shown below.


To send a message, use the MessageBroker external object after having connected to Azure Service Bus with the AzureServiceBus.MessageBrokerProvider external object.
The message to send is set up using the Message SDT, where you can optionally specify custom and broker message attributes.

The same happens with the received messages, which arrive with a set of broker and custom properties that are loaded in the MessageAttributes item of the Message SDT.

The message properties supported by Azure Service Bus are listed here.


&Message = new() //Message, GeneXusMessagingMessageBroker
&Message.MessageId = !"123456"
&Message.MessageBody = !"test1 send one message"

//Custom Properties

&MessageProperty = new() //MessageProperty, GeneXusMessagingMessageBroker
&MessageProperty.PropertyKey = !"key1"
&MessageProperty.PropertyValue = !"Value1"

&MessageProperty = new() 
&MessageProperty.PropertyKey = !"key2"
&MessageProperty.PropertyValue = !"Value2"

//Broker Properties 

&MessageProperty = new()
&MessageProperty.PropertyKey = !"subject"
&MessageProperty.PropertyValue = !"TestSubject"

&MessageProperty = new()
&MessageProperty.PropertyKey = !"sessionid"
&MessageProperty.PropertyValue = !"sessionIdTest"

&success = &MessageBroker.SendMessage(&Message,&errorMessages) //MessageBroker, GeneXusMessagingMessageBroker

Checking the message sent using the Service Bus Explorer:



This feature is available since GeneXus 18 upgrade 1.


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant