Examples
The AMPS Java Client includes a set of example programs that provide simple demonstrations of client functionality.
A sample archive is available that includes a set of samples and a configuration file for AMPS: java-examples.zip.
The samples archive includes samples such as:
| Sample Name | Demonstrates |
|---|---|
| ConsolePublisher.java | Publish messages to AMPS. |
| ConsoleSubscriber.java | Receive messages from AMPS. |
| SOWConsolePublisher.java | Publishing messages to a SOW topic. |
| SOWConsoleSubscriber.java | Querying messages from a SOW topic. |
| SOWandSubscribeConsoleSubscriber.java | Querying a SOW topic and entering a subscription to the topic in a single atomic operation. |
| SOWUpdater.java | Publishes message to a SOW topic and then updates them for use with the SowAndSubscribeWithOOF sample. |
| SowAndSubscribeWithOOF.java | Querying a SOW topic and entering a subscription to the topic in a single atomic operation while registering for notification that a previously-matching message no longer matches the subscription. |
| PublishForReplay.java | Publish messages to the transaction log for use by the SubscribeForReplay example. |
| SubscribeForReplay.java | Demonstrate replaying messages from the transaction log using a bookmark subscribe. |
| QueuePublisher.java | Publishing messages to a queue topic. |
| QueueSubscriber.java | Receiving and acknowledging messages from a queue topic. |
| CompositeMessagePublisher.java | Publish a composite message using the CompositeMessageBuilder. |
| CompositeMessageSubscriber.java | Receive a composite message and use the CompositeMessageParser to extract the parts of the message. |
| FIXBuilderPublisher.java | Use the FIX builder convenience class to build and publish a FIX-format message. |
| FIXShredderSubscriber.java | Use the FIX shredder convenience class to display a FIX-format message received from AMPS. |
| NVFIXBuilderPublisher.java | Use the NVFIX builder convenience class to build and publish a FIX-format message. |
| NVFIXShredderSubscriber.java | Use the NVFIX shredder convenience class to display a FIX-format message received from AMPS. |