Table of Contents Previous Next
Logo
IceStorm : 45.9 Quality of Service
Copyright © 2003-2007 ZeroC, Inc.

45.9 Quality of Service

An IceStorm subscriber specifies QoS parameters at the time of subscription. IceStorm currently supports only one QoS parameter, reliability, which is described in the section below.

45.9.1 Reliability

The QoS parameter reliability affects message delivery. The only legal values at this point are ordered and the empty string. If not specified, the default value is the empty string (meaning not ordered).
If you specify ordered as the reliability QoS, IceStorm forwards events to subscribers in the order in which they are received. Without this setting, events are forwarded immediately, as soon as they are received; because events can arrive from different publishers publishing to the same topic, this means that they can be forwarded to subscribers in an order that differs from the order in which they were received.
Whether the subscriber receives events in the same order in which they are sent by IceStorm also depends on the subscriber’s threading model—see Section 45.10.

45.9.2 Example

The Slice type IceStorm::QoS is defined as a dictionary whose key and value types are both string, therefore the QoS parameter name and value are both represented as strings. The example code presented in Section 45.5.3 used an empty dictionary for the QoS argument, meaning default values are used. The C++ and Java examples shown below illustrate how to set the reliability parameter to ordered.

C++ Example

IceStorm::QoS qos;
qos["reliability"] = "ordered";
topic>subscribeAndGetPublisher(qos, proxy>ice_twoway());

Java Example

java.util.Map qos = new java.util.HashMap();
qos.put("reliability", "ordered");
topic.subscribeAndGetPublisher(qos, proxy.ice_twoway());
Table of Contents Previous Next
Logo