Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MessageHeader

This is a class that encapsulates a message header. The message header is exposed via message.header field of the Message class:

const  messageHandler = message => {
    if (message.header.command() === 'sow') {
        console.log(message.header.groupSequenceNumber());
        console.log(message.data);
    }
};
notice

Not all messages populate all headers. The Command Reference provides detailed description of the headers returned on specific messages and what they contain.

Hierarchy

  • MessageHeader

Index

Constructors

constructor

Methods

ackType

  • ackType(): string
  • Returns the acknowledgement type for the given command. Multiple ack types are comma-delimited.

    Returns string

    The acknowledgement message type.

batchSize

  • batchSize(): number
  • Returns the specified number of messages that are batched together when returning a query result.

    Returns number

    The batch size value.

bookmark

  • bookmark(): string
  • Returns a client-originated identifier used to mark a location in journaled messages.

    Returns string

    The bookmark value.

clientName

  • clientName(): string
  • Returns the client name value. Used to identify a client. Useful for publishers that wish to identify the source of a publish, client status messages and for client heartbeats.

    Returns string

    The client name value.

command

  • command(): string
  • Returns the command name, e.g. 'publish', 'sow_and_subscribe', which is one of the following:

    • ack
    • publish
    • delta_publish
    • subscribe
    • delta_subscribe
    • oof
    • sow
    • sow_and_subscribe
    • sow_and_delta_subscribe
    • sow_delete
    • unsubscribe

    Returns the command name.

    Returns string

    The command name value.

commandId

  • commandId(): string
  • Returns the command id.

    Returns string

    The command id value.

correlationId

  • correlationId(): string
  • Returns the correlation id: opaque token set by an application and returned with the message. Must be base64 encoded characters only.

    Returns string

    The correlationId value.

expiration

  • expiration(): number
  • Returns the Message expiration value (in seconds).

    Returns number

    The Message expiration value.

filter

  • filter(): string
  • Returns the content filter value.

    Returns string

    The content filter value.

groupSequenceNumber

  • groupSequenceNumber(): number
  • Returns the Group Sequence Number for each batch message of a SOW response.

    Returns number

leasePeriod

  • leasePeriod(): string
  • For messages from a queue, returns the time at which the lease expires.

    Returns string

matches

  • matches(): number
  • As a part of the acknowledgement to a SOW query, returns the number of matches.

    Returns number

messageLength

  • messageLength(): number
  • Sent with XML formatted message data to indicate the number of bytes used by the message body.

    Returns number

options

  • options(): string
  • Returns a comma-delimited list of options on a specific command.

    Returns string

    The options value.

orderBy

  • orderBy(): string
  • Returns the SOW topic key(s) by which to order SOW query.

    Returns string

    The orderBy value.

queryId

  • queryId(): string
  • Returns the query id.

    Returns string

    The query id.

reason

  • reason(): string
  • Returns the failure message that appears when an acknowledgement returns a status of failure.

    Returns string

    The failure reason value.

recordsDeleted

  • recordsDeleted(): number
  • Returns the number of records deleted from the SOW with a sow_delete command. Used in conjunction with the stats acknowledgement.

    Returns number

    The recordsDeleted value.

recordsInserted

  • recordsInserted(): number
  • Returns the number of records inserted into the SOW. Used in conjunction with the stats acknowledgement.

    Returns number

    The recordsInserted value.

recordsReturned

  • recordsReturned(): number
  • Returns number of records in the store. The value is returned in the acknowledgement to an SOW query.

    Returns number

    The recordsReturned value.

recordsUpdated

  • recordsUpdated(): number
  • Returns the number of records updated in the SOW. Used in conjunction with the stats acknowledgement.

    Returns number

    The recordsUpdated value.

sequenceId

  • Returns an integer that corresponds to the publish message sequence number. For more information see the Replication section in the User Guide.

    Returns BigInteger

    The sequenceId value.

sowKey

  • sowKey(): string
  • Returns the sow key value. A SOW key will accompany each message returned in an SOW batch. A SowKey may also be added to messages coming in on a subscription when the published message matches a record in the SOW.

    Format:

    • string containing the digits of an unsigned long for AMPS-generated SOW keys

    OR

    • arbitrary string in the base64 character set for user-provided SOW keys.

    Returns string

    The sow key value.

sowKeys

  • sowKeys(): string
  • Returns the sowKeys as a comma-delimited value.

    Returns string

    The sowKeys value.

status

  • status(): string
  • Returns the client status when client is monitored for heartbeats.

    Returns string

    The client status value.

subId

  • subId(): string
  • Returns the subscription id.

    Returns string

    The subscription id.

subIds

  • subIds(): string
  • Returns a comma-separated list of SubIds sent from AMPS engine to identify which client subscriptions match a given publish message.

    Returns string

    The subIds (comma-delimited) value.

timestamp

  • timestamp(): string
  • Returns the message timestamp set by the server in a ISO-8601 date-time format.

    Returns string

    The timestamp value.

topN

  • topN(): number
  • Returns the number of records to return. Note: If TopN is not equally divisible by the batch size, then more records will be returned so that the total number of records is equally divisible by the batch size setting.

    Returns number

    The top N value.

topic

  • topic(): string
  • Returns the topic value.

    Returns string

    The topic value.

topicMatches

  • topicMatches(): number
  • Returns the number of topic matches for the SOW query. Sent in stats acknowledgement message.

    Returns number

    The topicMatches value.

transmissionTime

  • transmissionTime(): string
  • Returns the transmission time value.

    Returns string

    The transmission time value.

userId

  • userId(): string
  • Returns the user id used to identify the user of a command.

    Returns string

    The userId value.