Diffusion 6.2.2 User Manual

Managing topics

Adding topics is an asynchronous operation and calls back to notify of either
successful creation of the topic or failure to create the topic.

If the topic add fails at the Diffusion server, the reason for failure
is returned. Possible reasons for failure include the following:

The topic already exists at the Diffusion server

The name of the supplied topic is not valid

The supplied details are not valid. This can occur only if properties are
supplied.

Permission to create the topic was denied

An error occurred trying to initialize the newly created topic with the
supplied content, possibly because it was not validly formatted

Note: Sometimes you may wish to "add or update" a topic: add it if it does not exist,
but update if it does. There is no single method for this. Instead, the updating client
can try to add the topic first, and if it receives a response that the topic exists,
can then update it.

A client can create topics subordinate to topics created by another client.

Note:

It is not currently possible to add new topics under
branches of the topic tree that have been created by internal
publishers..

Currently all topics created using a client have a lifespan the same as the Diffusion server (unless persistence is enabled). The topics remain at the Diffusion server even after the client session that created them
has closed unless you explicitly specify that the topic is removed with the
session.

Handling subscriptions to missing topics
A client can handle subscription requests for topics that do not exist and can act on those notifications, for example, by creating a topic on demand that matches the request.