Official Content

When the Message Broker API is used, the ReceiveMessageOptions Structured Data Type is defined under the AzureServiceBus module and represents the options that may be passed to the ReceiveMessage and ReceiveMessages methods.



MaxMessages The maximum number of messages that will be received. Defaults to 10. Used by the ReceiveMessages method.

An optional TimeSpan (seconds) specifying the maximum time to wait for a message before returning null if no messages are available.

**Consider this option to avoid your app to being hang waiting for a message to arrive to the service bus when no messages are available.

Used by the ReceiveMessage method. If not specified, the TryTimeout will be used.
SessionId The Session ID associated with the receiver (for session enabled queue or topic). Used by ReceiveMessages and ReceiveMessage methods.


  • Peek
  • PeekFromSequenceNumber

Peeking a message does not require the message to be locked. Because the message is not locked to a specific receiver, the message will not be able to be settled.

PeekFromSequenceNumber: An optional sequence number from where to peek the message. This corresponds to the SequenceNumber.

Used by the ReceiveMessage method, fetches the next active message without changing the state of the receiver or the message source. It corresponds to this method in the Azure Service Bus SDK.
(ReceiveDeferredSequenceNumber) SequenceNumber Options to receive deferred messages identified by sequence number. Used by the ReceiveMessage method for a deferred message. See HowTo: Defer a message in Azure Service Bus.
BrokerReceiverOptions Options for initializing the receiver. See BrokerReceiverOptions SDT. For non session-enabled queues or topics, the broker receiver can be initialized at the connection also, and will be used until disposed.
Nevertheless, the BrokerReceiverOptions settings can be changed for each receive operation. 
For session-enabled queues or topics the session receiver is initialized for each receive operation so the Session Id is mandatory in this case.


This feature is available since GeneXus 18 upgrade 1.


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