What Is a URI and What Is It Used For?

Each Sybase CEP stream has a unique stream URI which provides enough information that a program can connect to the stream.

You must also specify a URI when you connect streams in different projects. If you are already familiar with URLs, it may be helpful to know that a URI is a lot like a URL.

The simplest use of stream URIs is with an out-of-process adapter, which runs as a separate process rather than as part of the server. For an out-of-process input adapter to connect to an input stream and write data to that stream, the adapter must know the URI of that stream. Similarly, an out-of-process output adapter must know the URI of the stream from which it reads. Any other program that uses a Sybase CEP SDK to access a stream must also know the URI of the stream.

A more complex use of stream URIs occurs with parallel queries; the adapter must write data to multiple instances of a stream, and thus must know the URI of each of those instances of the stream. This is explained in more detail in the section titled URIs and Distributed Queries.

Another use of stream URIs is with the High Availability (HA) feature. When using HA, Sybase CEP Server cluster has a manager and one or more containers. The manager coordinates the work among the containers. The containers not only run queries; they also run streams and adapters. When a manager or container dies, a different manager or container takes over the work, and so a program may need to re-connect its stream if the stream is now running on a different computer. Thus, Sybase CEP Server must use stream URIs that can be resolved to the current location of the stream, rather than hard-coding a host as part of the URI.