IPWorks MQ 2020 Kotlin Edition

Questions / Feedback?

ReceiveMode Property

Controls what mode new receiver links are created with.

Syntax

public var receiveMode: AmqpReceiveModes

public enum class AmqpReceiveModes(val value: Int) {
rmAutomatic(0),
rmFetch(1);
}

Default Value

0

Remarks

This property controls which receive mode newly created receiver links should use to receive messages from the sender. Valid values are:

  • rmAutomatic (0 - default)
  • rmFetch (1)

Receiving Messages Automatically

A receiver link operating in rmAutomatic (0) mode strives to ensure that the sender always has sufficient credit so that messages are received as soon as they are available, thus simulating a "subscription-based"/"push-based" messaging model.

In this mode, receiver links will be created with the amount of credit, and the credit threshold, specified by the DefaultCredit and DefaultCreditThreshold configuration settings. Anytime the link's credit reaches the credit threshold, the component will automatically set it back to its initial value.

Fetching Messages On-Demand

A receiver link operating in rmFetch (1) mode requires the FetchMessage method to be called in order for a message to be received, thus simulating a "polling"/"pull-based" messaging model.

In this mode, receiver links will be created with no credit (regardless of what DefaultCredit is set to). When FetchMessage is called, the component will supply the sender with a single credit and then block until a message is received (if the FetchTimeout property is set to zero).

If FetchTimeout is non-zero, the component will only block for the specified number of seconds; once that time expires, it will instruct the sender to consume the credit. If the sender chooses to consume the credit by incrementing the value of the AMQPLink.DeliveryCount field rather than by sending a message, then the component will throw an error indicating a timeout.

Refer to FetchMessage and FetchTimeout for more information.

amqp.ReceiveMode = AmqpReceiveModes.rmFetch;
amqp.CreateReceiverLink("SessionID", "ReceiverLinkName", "SomeTarget");

This property is not available at design time.

Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks MQ 2020 Kotlin Edition - Version 20.0 [Build 7941]