Creating and Configuring Custom FlowControllers with Property QoS

You can create and configure FlowControllers using the PROPERTY QosPolicy (DDS Extension) . The properties must have a prefix of “dds.flow_controller.token_bucket”, followed by the name of the FlowController being created or configured. For example, if you want to create/configure a FlowController named MyFC, all the properties for MyFC should have the prefix “dds.flow_controller.token_bucket.MyFC“.

FlowController Properties lists the properties that can be set for FlowControllers in the DomainParticipant's PROPERTY QosPolicy (DDS Extension) . A FlowController with the name "dds.flow_controller.token_bucket.<your flow controllername>" will be implicitly created when at least one property using that prefix is specified. Then, to link a DataWriter to your FlowController, use "dds.flow_controller.token_bucket.<your flow controllername>" in the DataWriter's publish_mode.flow_controller_name.

FlowController Properties

Property Name
prefix with ‘dds.flow_controller.token_bucket.
<your flow controller name>

Property Value Description

scheduling_policy

Specifies the scheduling policy to be used. (See Flow Controller Scheduling Policies) May be:

DDS_RR_FLOW_CONTROLLER_SCHED_POLICY

DDS_EDF_FLOW_CONTROLLER_SCHED_POLICY

DDS_HPF_FLOW_CONTROLLER_SCHED_POLICY

token_bucket.max_tokens

Maximum number of tokens than can accumulate in the token bucket.

Use -1 for unlimited.

token_bucket.tokens_added_per_period

Number of tokens added to the token bucket per specified period.

Use -1 for unlimited.

token_bucket.tokens_leaked_per_period

Number of tokens removed from the token bucket per specified period.

Use -1 for unlimited.

token_bucket.period.sec

Period for adding tokens to and removing tokens from the bucket in seconds.

token_bucket.period.nanosec

Period for adding tokens to and removing tokens from the bucket in nanoseconds.

token_bucket.bytes_per_token

Maximum number of bytes allowed to send for each token available.

Example

The following example shows how to set FlowController properties.

Note: Some lines in this example, such as dds.flow_controller.token_bucket.MyFlowController.scheduling_policy, are too long to fit on the page as one line; however in your XML file, they each need to be on a single line.

<participant_qos>
	<property>
		<value>
			<element>
				<name>
	dds.flow_controller.token_bucket.MyFlowController.scheduling_policy
				</name>
				<value>DDS_RR_FLOW_CONTROLLER_SCHED_POLICY</value>
			</element>
			<element>
				<name>
	dds.flow_controller.token_bucket.MyFlowController.token_bucket.period.sec
				</name>
				<value>100</value>
			</element>
			<element>
				<name>
		dds.flow_controller.token_bucket.MyFlowController.
		token_bucket.period.nanosec
				</name>
				<value>0</value>
			</element>
			<element>
				<name>
	dds.flow_controller.token_bucket.MyFlowController.token_bucket.tokens_added_per_period
				</name>
				<value>2</value>
			</element>
			<element>
				<name>
	dds.flow_controller.token_bucket.MyFlowController.token_bucket.tokens_leaked_per_period
				</name>
				<value>2</value>
			</element>
			<element>
				<name>
	dds.flow_controller.token_bucket.MyFlowController.token_bucket.bytes_per_token
				</name>
				<value>1024</value>
			</element>
		</value>
	</property>
</participant_qos>
<datawriter_qos>
	<publish_mode>
		<flow_controller_name>
			dds.flow_controller.token_bucket.MyFlowController
		</flow_controller_name>
		<kind>ASYNCHRONOUS_PUBLISH_MODE_QOS</kind>
	</publish_mode>
</datawriter_qos>

© 2018 RTI