LogoLogo
AMPS C#/.NET Client 5.3.3
AMPS C#/.NET Client 5.3.3
  • Welcome to the AMPS C#/.NET Client
    • Before You Start
    • Obtaining and Installing the AMPS C#/.NET Client
    • Your First AMPS Program
      • Client Identification
      • Connection Strings for AMPS
      • Connection Parameters for AMPS
      • Providing Credentials to AMPS
      • Assembly Deployment
    • Subscriptions
      • Content Filtering
        • Changing the Filter on a Subscription
      • Understanding Message Objects
      • Synchronous Message Processing
      • Asynchronous Message Processing
        • Understanding Threading
      • Regular Expression Subscriptions
      • Ending Subscriptions
    • Error Handling
      • Exceptions
      • Exception Types
      • Exception Handling and Asynchronous Message Processing
      • Controlling Blocking with Command Timeout
      • Disconnect Handling
        • Using a Heartbeat to Detect Disconnection
        • Managing Disconnection
        • Replacing Disconnect Handling
      • Unexpected Messages
      • Unhandled Exceptions
      • Detecting Write Failures
      • Monitoring Connection State
    • State of the World
      • SOW and Subscribe
      • Setting Batch Size
      • Managing SOW Contents
      • Client Side Conflation
    • Using Queues
      • Backlog and Smart Pipelining
      • Acknowledging Messages
      • Acknowledgement Batching
      • Returning a Message to the Queue
      • Manual Acknowledgement
    • Delta Publish and Subscribe
      • Delta Subscribe
      • Delta Publish
    • High Availability
    • AMPS Programming: Working with Commands
    • Utility Classes
    • Advanced Topics
    • Exceptions Reference
    • AMPS Server Documentation
    • API Documentation
Powered by GitBook

Get Help

  • FAQ
  • Legacy Documentation
  • Support / Contact Us

Get AMPS

  • Evaluate
  • Develop

60East Resources

  • Website
  • Privacy Policy

Copyright 2013-2024 60East Technologies, Inc.

On this page
  • Header Properties
  • Data Property
  • Message Field Reference
Export as PDF
  1. Welcome to the AMPS C#/.NET Client
  2. Subscriptions

Understanding Message Objects

PreviousChanging the Filter on a SubscriptionNextSynchronous Message Processing

Last updated 2 months ago

So far, we have seen that subscribing to a topic involves working with objects of type AMPS.Client.Message. A Message represents a single message to or from an AMPS server. Messages are received or sent for every client/server operation in AMPS.

Header Properties

There are two parts of each message in AMPS: a set of headers that provide metadata for the message, and the data that the message contains. Every AMPS message has one or more header fields defined. The precise headers present depend on the type and context of the message. There are many possible fields in any given message, but only a few are used for any given message. For each header field, the Message class contains a distinct property that allows for retrieval and setting of that field. For example, the Message.getCommandId() function corresponds to the commandId header field, the Message.getBatchSize() function corresponds to the BatchSize header field, and so on. For more information on these header fields, consult the AMPS User Guide and AMPS Command Reference.

To work with header fields, a Message contains getXxx()/setXxx() methods corresponding to the header fields. 60East does not recommend attempting to parse header fields from the raw data of the message.

In AMPS, fields sometimes need to be set to a unique identifier value. For example, when creating a new subscription, or sending a manually constructed message, you’ll need to assign a new unique identifier to multiple fields such as CommandId and SubscriptionId. For this purpose, Message provides newXxx() methods for each field that generates a new unique identifier and sets the field to that new value.

Data Property

Access to the data section of a message is provided via the Data property. The Data property will contain the unparsed data of the message. The Data property returns the data as a .Net string, which is suitable for message formats that can be represented as Unicode text, such as JSON, XML, FIX, or NVFIX. For binary data, the AMPS C# client provides a getDataRaw() method to allow you to work with the underlying byte array in the message. See the section on for details.

The AMPS C# client contains a collection of helper classes for working with message types that are specific to AMPS (for example, FIX, NVFIX, and AMPS composite message types). For message types that are widely used, such as JSON or XML, you can use whichever library you typically use in your environment.

Message Field Reference

The contains a full description of which fields are available and which fields are returned in response to specific commands.

Byte Buffers
AMPS Command Reference