Creating a FioranoMQ CBR subscriber is similar to creating a JMS subscriber. Set the value of InitialContext environment variable UseFioranoCbr to true. The subscribers (durable and non-durable) can then be created in a manner similar to PubSub. The message can be any valid XML message passed as the contents of FioranoXMLMessages.
CreateDurableSubscriber
The following API creates a Durable Subscriber which receives messages only if they conform to the specified Xpath Message Selector string:
CreateSubscriber
The following API creates a Non-Durable Subscriber, which only receives messages if they pass the specified Xpath Message Selector string:
More samples of using FioranoXCR content-based routing are available in the samples directory of the FioranoMQ installation under pubsub/ContentBasedRouting.
Handling Massive Number of Subscribers
In an environment where millions of subscribers are required, it is possible to cascade FioranoMQ Servers a form that allows data source publishers to multiple FioranoMQ servers simultaneously. This enables each source to publish and/or send messages to several FioranoMQ Servers. Each of these, in turn, sends the information to another set of FioranoMQ Servers or sends information directly to the system that ultimately transfers information to subscribers. For best results, it is recommended not to run more than 500 subscribers on each FioranoMQ connection.
Below are the key concepts that enable the handling of a large number of subscribers:
- Keep XML messages small (do not mix domain data, such as weather and sports. Do not add information on more than one item within a domain at a time, such as stock quotes for more than 1 company).
- Use fewer connections and more subscribers per connection.
- Use suitably powered systems that run subscribers so that they do not decelerate the movement of messages. Most slowdowns occur due to subscribers that are unable to process the messages at speed.
- Segregate domain data on different topics (for example, use a topic for weather and a different topic for sports).
The following figure illustrates an environment where incoming XML messages are distributed to several FioranoMQ boxes. These FioranoMQ boxes, in turn, feed the distribution systems that eventually send message to devices such as cell phones and wireless PDAs. This figure illustrates how multiple subscribers can be used to distribute data on several different topics.