Version: 10.16.0

Function

solace.Message. acknowledge

Acknowledges this message. This is the same as calling solace.Message#settle(solace.MessageOutcome.ACCEPTED). Internally uses Message.settle() with the ACCEPTED MessageOutcome.

If the solace.MessageConsumer on which this message was received is configured to use solace.MessageConsumerAckMode.CLIENT, then when a message is received by an application, the application must call this method to explicitly acknowledge reception of the message. This frees local and router resources associated with an unacknowledged message.

The API does not send acknowledgments immediately. It stores the state for acknowledged messages internally and acknowledges messages, in bulk, when a threshold or timer is reached.

solace.SDTStreamContainer. addField

Appends a field to this stream.

solace.SDTMapContainer. addField

Adds a field to this map. If a key:value mapping already exists for this key, it is replaced.

Deprecated If typeOrField is a solace.SDTField instance, it is added to the map.

The preferred usage is to pass a solace.SDTFieldType, then the API will create a SDTField of this type using value before adding it to the map.

solace.MessageConsumer. addSubscription

Subscribe the queue to a topic, always requesting confirmation from the router.

solace.MessageConsumerEventName.SUBSCRIPTION_OK is generated when subscription is added successfully; otherwise, session event solace.MessageConsumerEventName.SUBSCRIPTION_ERROR is generated.

When the application receives the event solace.MessageConsumerEventName.SUBSCRIPTION_ERROR, it can obtain the failed topic subscription by calling solace.MessageConsumerEvent#reason. The returned string is in the format of "Topic: ".

solace.CacheCBInfo. cacheRequestCallback

This callback is called by a cache session when a cache request completes.

solace.MessageConsumer. clearStats

Clears all statistics for this Guaranteed Message Connection. All previous Guaranteed Message Connection statistics are lost when this is called.

solace.TraceContextSetter. clone

Clone this TraceContextSetter object.

solace.TraceContext. clone

Clone the a TraceContext object used for distributed message tracing.

solace.ReplicationGroupMessageId. compare

Compares with other ReplicationGroupMessageId

solace.Session. connect

Connects the session to the Solace Message Router as configured in the solace.SessionProperties#url.

When the session is successfully connected to the Solace Message Router, the solace.SessionEventCode#UP_NOTICE event is emitted if a listener has been registered.

If solace.SessionProperties#reapplySubscriptions is set to true, this operation re-registers previously registered subscriptions. The connected session event (solace.SessionEventCode#event:UP_NOTICE) is emitted only when all the subscriptions are successfully added to the router.

If the API is unable to connect within solace.SessionProperties#connectTimeoutInMsecs or due to login failures, the session's state transitions back to 'disconnected' and an event is generated.

Note: Before the session's state transitions to 'connected', a client application cannot use the session; any attempt to call functions will throw solace.OperationError.

solace.MessageConsumer. connect

Connects the consumer immediately. The application should add event listeners (see solace.MessageConsumerEventName). If there is no listener added for solace.MessageConsumerEventName#event:MESSAGE then up to a window solace.MessageConsumerProperties.windowSize of messages can be queued internally. to the solace.MessageConsumer before calling this method.

solace.QueueBrowser. connect

Connects the queue browser immediately. The application should add event listeners (see solace.QueueBrowserEventName). If there is no listener added for solace.QueueBrowserEventName#event:MESSAGE then up to a window solace.QueueBrowserProperties.windowSize of messages can be queued internally. before calling this method.

solace.SDTField. create

Create a new SDTField instance representing a Value of a given Type.

solace.Session. createCacheSession

Creates a solace.CacheSession object that uses this Session to service its cache requests.

It should be disposed when the application no longer requires a CacheSession, by calling solace.CacheSession#dispose.

solace.SolclientFactory. createDurableQueueDestination

Creates a durable queue solace.Destination instance. When the returned Destination is set as the destination of a message via solace.Message#setDestination, the message will be delivered to the Guaranteed Message queue on the Solace Message Router of the same name.

solace.SolclientFactory. createMessage

Creates a solace.Message instance.

solace.Session. createMessageConsumer

Creates a solace.MessageConsumer to receive Guaranteed Messages in this Session.

Consumer characteristics and behavior are defined by properties. The consumer properties are supplied as an object; the pertinent fields are exposed in solace.MessageConsumerProperties; other property names are ignored. If the Message Consumer creation specifies a non-durable endpoint, solace.QueueProperties can be used to change the default properties on the non-durable endpoint. Any values not supplied are set to default values.

When the consumer is created, a consumer object is returned to the caller. This is the object from which events are emitted, and upon which operations (for example, starting and stopping the consumer) are performed.

If this session does not support Guaranteed Messaging, this method will throw. The following must be true in order to create a MessageConsumer:

solace.Session. createQueueBrowser

Creates a solace.QueueBrowser to browse Guaranteed Messages on a specified queue in this Session.

Browser characteristics and behavior are defined by properties. The browser properties are supplied as an object; the pertinent fields are exposed in solace.QueueBrowserProperties; other property names are ignored. Any values not supplied are set to default values.

Delivery restrictions imposed by the queue’s Access type (exclusive or non-exclusive), do not apply when browsing messages with a Browser.

When the queue browser is created, a queue browser object is returned to the caller. This is the object from which events are emitted, and upon which operations (for example, starting and stopping the browser) are performed.

If this session does not support Guaranteed Messaging, this method will throw. The following must be true in order to create a QueueBrowser:

solace.SolclientFactory. createReplayStartLocationBeginning

Creates a ReplayStartLocation solace.ReplayStartLocation instance that when set in MessageConsumerProperties indicates that all messages available in the replay log should be retrieved.

solace.SolclientFactory. createReplayStartLocationDate

Creates a ReplayStartLocation solace.ReplayStartLocation instance that when set in MessageConsumerProperties indicates that only messages spooled in the replay log since the given Date should be retrieved.

solace.SolclientFactory. createReplicationGroupMessageId

Creates a solace.ReplicationGroupMessageId instance from string. A ReplicationGroupMessageId is also a solace.ReplayStartLocation instance that when set in MessageConsumerProperties indicates that only messages spooled in the replay log since the message after the given ReplicationGroupMesageId should be replayed.

solace.SolclientFactory. createSession

Creates a session instance.

solace.SolclientFactory. createTopicDestination

Creates a topic solace.Destination instance. When the returned Destination is set as the destination of a message via solace.Message#setDestination, the message will be delivered to direct subscribers or topic endpoints subscribed to the given topic.

solace.SDTMapContainer. deleteField

Delete an SDTField with the given key.

solace.Enum. describe

Create a human-readable string describing the given enumeration value. This result is informational and may vary between SDK versions.

Currently, it either returns the value provided (if the associated key is the same), or a string of the form key (value).

solace.Session. disconnect

Disconnects the session. The session attempts to disconnect cleanly, concluding all operations in progress. The disconnected session event solace.SessionEventCode#event:DISCONNECTED is emitted when these operations complete and the session has completely disconnected.

solace.QueueBrowser. disconnect

Initiates an orderly disconnection of the queue browser. The API will send an unbind request. Any messages subsequently received are discarded silently. When the unbind message is acknowledged, the application receives a solace.QueueBrowserEventName#event:DOWN event if it has set a listener for that event.

solace.MessageConsumer. disconnect

Initiates an orderly disconnection of the Message Consumer. The API will send any pending client acknowledgements on the Message Consumer, then send an unbind request. Any messages subsequently received are discarded silently. When the unbind message is acknowledged, the application receives a solace.MessageConsumerEventName#event:DOWN event if it has set a listener for that event.

solace.CacheSession. dispose

Disposes the session. No cache requests will be sent by this CacheSession after it is _disposed.

Any subsequent operations on the session will throw {OperationError}.

Any pending operations will immediately terminate, returning

solace.MessageConsumer. dispose

Disposes the Guaranteed Message connection, removing all listeners and releasing references.

solace.Session. dispose

Release all resources associated with the session. It is recommended to call disconnect() first for proper handshake with the message-router.

solace.Message. dump

Produces a human-readable dump of the message's properties and contents. Applications must not parse the output, as its format is not a defined part of the API and subject to change.

Output can be controlled by the flags parameter. The values are:

  • MessageDumpFlag.MSGDUMP_BRIEF Display only the length of the binary attachment, xml attachment, and user property map
  • MessageDumpFlag.MSGDUMP_FULL Display the entire message.

solace.TraceContextSetter. fromTraceContext

Gets a new instance of the Message Trace Context Setter from the values in the SMF header associated with the message.

solace.Message. getApplicationMessageId

Gets the application-provided message ID.

solace.Message. getApplicationMessageType

Gets the application message type. This value is used by applications only, and is passed through the API and Solace Message Router untouched.

solace.Message. getBaggage

Retrieves a solace.Baggage carrier object used for carrying over of the distributed tracing message baggage information across service boundaries. It must not be altered by intermediaries.

solace.Message. getBinaryAttachment

Gets the binary attachment part of the message.

Backward compatibility note: Using the version10 factory profile or older, the binary attachment is returned as a 'latin1' String: Each character has a code in the range * 0-255 representing the value of a single received byte at that position.

solace.CacheSessionProperties. getCacheName

Gets the cache name to which solace.CacheSession requests should be sent, for sessions constructed using these properties.

solace.Message. getCacheRequestId

Given a Message containing a cached message, return the cache Request Id that the application set in the call to solace.CacheSession#sendCacheRequest.

solace.Message. getCacheStatus

Gets the cache status of this message.

solace.Session. getCapability

Get the value of an router capability, or null if unknown. This function must be called after connecting the session.

SDT Type conversions:

solace.Message. getCorrelationId

Gets the correlation ID. The message Correlation Id is carried in the Solace message headers unmodified by the API and the Solace Message Router. This field may be used for peer-to-peer message synchronization and is commonly used for correlating a request to a reply. See solace.Session#sendRequest.

solace.Message. getCorrelationKey

Gets the correlation Key. A correlation key is used to correlate a message with its acknowledgement or rejection. The correlation key is an object that is passed back to the client during the router acknowledgement or rejection.

The correlation key is a local reference used by applications generating Guaranteed messages. Messages that are sent in either solace.MessageDeliveryModeType.PERSISTENT or solace.MessageDeliveryModeType.NON_PERSISTENT mode may set the correlation key.

solace.Message. getCreationContext

Retrieves a solace.TraceContext object used for carrying over of the distributed tracing message creation context information usable by intermediary instrumentation across service boundaries. It allows correlating the producer with the consumers of a message, regardless of intermediary instrumentation. It must not be altered by intermediaries.

solace.Message. getDeliveryCount

Returns the delivery count.

solace.Message. getDeliveryMode

Gets the delivery mode of the message.

solace.Message. getDestination

Gets the destination to which the message was published.

solace.MessageConsumer. getDestination

Returns the destination that should be used to publish messages that this consumer will receive.

  • For topic endpoints, this is the topic to which the topic endpoint is subscribed.
  • For queues, this is the associated queue destination.

The destination returned can be used to set the ReplyTo field in a message, or otherwise communicated to partners that need to send messages to this Message Consumer. This is especially useful for temporary endpoints (Queues and Topic Endpoints), as the destination is unknown before the endpoint is created.

This method will succeed after solace.MessageConsumerEventName#event:UP for temporaries with generated destinations.

solace.TraceContext. getEncodedTraceContext

It returns the encoded bytes that is passed to the SMF header to be encoded in SMF for the message.

solace.CacheRequestResult. getError

Gets the error, if any, associated with the returned result.

solace.SDTMapContainer. getField

Return the SDTField with the given key.

solace.Message. getGMExpiration
solace.Message. getGuaranteedMessageId

This message ID is NOT a universal unique identifier for the message. There is no use for this message ID in an application. Internally this message ID is used when a message is acknowledged calling Message.acknowledge(). No other meaning should be inferred from the value of this message ID.

solace.TraceContext. getIsSampled

Returns true if the sampling for the associated message is on, otherwise false.

solace.SDTMapContainer. getKeys

Get the list of keys in this map, in unspecified order.

solace.SolclientFactory. getLogLevel

Gets the current log level, which was set by solace.SolclientFactory.init or a subsequent call to solace.SolclientFactory.setLogLevel.

solace.CacheSessionProperties. getMaxMessageAgeSec

Gets the maximum allowable message age for messages to be delivered in response to a request made on a solace.CacheSession that was constructed using these properties. 0 means no restriction on age.

solace.CacheSessionProperties. getMaxMessages

Gets the maximum count of messages to be delivered, per solace.Destination, in response to a request issued on a solace.CacheSession constructed using these properties. 0 means no restriction on the number of messages.

solace.Message. getMessageConsumer
solace.Destination. getName
solace.Topic. getName
solace.QueueDescriptor. getName

Gets/sets the remote name to which this descriptor refers.

solace.SDTStreamContainer. getNext

Returns the next field in the stream and advances the read pointer. If the end of the stream is reached, it returns undefined.

solace.Message. getPriority

Gets the Message Priority Parameter (JMS Priority) value for the message. Numerical values between 0 and 255 are valid return values, undefined means the parameter is not present.

If destination queues and topic endpoints for this message are configured to respect message priority, the values 0 through 9 can be used to affect the priority of delivery to consumers of those queues or topic endpoints. For the purposes of prioritized message delivery, values larger than 9 are treated the same as 9.

solace.CacheSession. getProperties

Gets the cache session properties.

solace.MessageConsumer. getProperties

Creates and returns copy of the properties for this MessageConsumer.

If the object was constructed using an solace.AbstractQueueDescriptor, and the queue descriptor was subsequently connected to an endpoint, the MessageConsumerProperties returned will include a solace.QueueDescriptor that contains the resolved name.

A new copy of the properties object is returned each time this property is accessed. The returned object cannot be polled for mutations such as the one described above.

solace.Message. getReceiverTimestamp

Gets the receive timestamp (in milliseconds, from midnight, January 1, 1970 UTC).

solace.Message. getReplicationGroupMessageId

Returns the Replication Group Message Id

solace.Message. getReplyTo

Gets the replyTo destination

solace.CacheRequestResult. getReturnCode

Gets the return code from the cache request result.

solace.CacheRequestResult. getReturnSubcode

Gets the return subcode from the cache request result.

solace.Message. getSdtContainer

Gets the message's structured data container, if this is a structured data message.

solace.Message. getSenderId

Returns the Sender's ID.

solace.Message. getSenderTimestamp

Gets the send timestamp (in milliseconds, from midnight, January 1, 1970 UTC).

solace.Message. getSequenceNumber

Gets the sequence number.

This is an application-defined field, see solace.Message#setSequenceNumber().

solace.Message. getSequenceNumber

Gets the sequence number.

This is an application-defined field, see solace.Message#setSequenceNumber().

solace.Session. getSessionProperties

Returns a clone of the properties for this session.

solace.TraceContext. getSpanId

Gets the value of the span identifier associated with the message.

solace.Session. getStat

Returns the value of a given solace.StatType.

solace.MessageConsumer. getStat

Returns a statistic for this Guaranteed Message connection.

solace.Message. getTimeToLive
solace.CacheSessionProperties. getTimeoutMsec

Gets the timeout for requests issued on a solace.CacheSession constructed using these properties.

  • The valid range is >= 3000.
solace.CacheRequestResult. getTopic

Gets the topic object associated with the cache request.

solace.Message. getTopicSequenceNumber

Returns the Topic Sequence Number. If there is no topic sequence number undefined is returned.

solace.Message. getTraceContextSetter

Retrieves a solace.TraceContextSetter object that is used to modify an appropriate TraceContext associated with a message transparently. When no context is stored in a message it will create and store a creation context with a message that can be used as an initial transport context at the same time. It will never override an existing message creation context. When creation context is present or only transport context is present, it will override an existing transport context information with a newly provided one.

solace.TraceContext. getTraceId

Gets the value of the trace identifier associated with the message.

solace.TraceContext. getTraceState

Gets the value of the trace state associated with the message.

solace.Message. getTransportContext

Retrieves a solace.TraceContext object used for carrying over of the distributed tracing transport context information usable or modifiable by intermediary instrumentation across service boundaries. It allows correlating the producer and the consumer with an intermediary. It also allows correlating multiple intermediaries among each other.

solace.Session. getTransportInfo

Gets a transport session information string. This string is informative only, and applications should not attempt to parse it.

solace.TraceContext. getTruncatedTraceState

Gets the value of the trace state associated with the message.

solace.Topic. getType
solace.AbstractQueueDescriptor. getType

Gets the queue type to which this descriptor refers.

solace.Message. getType

Gets the payload type (solace.MessageType) of the message. A message has a structured payload if one was attached via solace.Message#setSdtContainer otherwise if the payload is attached via Message@setBinaryAttachment then it is unstructured (solace.MessageType#BINARY)

solace.SDTField. getType

Gets the type of field represented.

solace.Destination. getType
solace.Message. getUserCos

Gets the Class of Service (CoS) value for the message. The Class of Service has different semantics for direct and guaranteed messages.

For messages published with solace.MessageDeliveryModeType.DIRECT, the class of service selects the weighted round-robin delivery queue when the message is forwarded to a consumer. solace.MessageUserCosType.COS1 are the lowest priority messages and will use the Solace Message Router D-1 delivery queues.

For messages published as guaranteed messages (solace.MessageDeliveryModeType.PERSISTENT or solace.MessageDeliveryModeType.NON_PERSISTENT), messages published with solace.MessageUserCosType.COS1 can be rejected by the Solace Message Router if that message would cause any queue or topic-endpoint to exceed its configured low-priority-max-msg-count.

solace.Message. getUserData

Gets the user data part of the message.

solace.Message. getUserPropertyMap

Gets the user property map carried in the message binary metadata.

solace.SDTField. getValue

Gets the field value.

solace.TraceContext. getVersion

Gets the version associated with the message trace.

solace.Message. getXmlContent

Gets the XML content part of the message. Notice that the content is encoded as UTF-8 characters, it needs to be decoded as JavaScript surrogate pair: decodeURIComponent(escape(value))

solace.Message. getXmlContentDecoded

Gets the XML content part of the message decoded from UTF-8 encoding of the characters.

solace.Message. getXmlMetadata

Gets the message's XML metadata section.

solace.SDTStreamContainer. hasNext

Returns true if the stream has at least one more solace.SDTField at the current position.

solace.SolclientFactory. init

Initialize global properties. This function must be called before any other API call is made.

Note: After the first call to this method, subsequent calls have no effect.

solace.Message. isAcknowledgeImmediately

Test if the Acknowledge Immediately message property is set or not. When the Acknowledge Immediately property is set to true on an outgoing Guaranteed Message, it indicates that the Solace Message Router should Acknowledge this message immediately upon receipt.

This property, when set by a publisher, may or may not be removed by the Solace Message Router prior to delivery to a consumer, so message consumers must not expect the property value indicates how the message was originally published

solace.Session. isCapable

Check the value of a boolean router capability.

This function is a shortcut for solace.Session#getCapability. It performs the same operation, but instead of returning a solace.SDTField wrapping a capability value, it just returns the boolean value.

Attempting to query a non-boolean capability will return null.

solace.Message. isDMQEligible
solace.Message. isDeliverToOne

Gets whether the message is configured for delivering to one client only.

solace.Message. isDiscardIndication

Indicates whether one or more messages have been discarded prior to the current message. This indicates congestion discards only and is not affected by message eliding.

solace.AbstractQueueDescriptor. isDurable

Gets whether this descriptor refers to a durable queue.

solace.Message. isElidingEligible

Returns whether the message is eligible for eliding.

Message eliding enables filtering of data to avoid transmitting every single update to a subscribing client.

This property does not indicate whether the message was elided.

solace.Message. isRedelivered

Indicates whether the message has been marked as redelivered by the Solace Message Router.

solace.Message. isReplyMessage

Returns whether the message's reply field is set, indicating that this message is a reply to a previous request. See solace.Session#sendRequest.

solace.LogImpl. loggingCallback

A logging callback. It must accept any valid number of arguments of any type. It must not throw.

solace.Enum. nameOf

Returns the canonical name in this enumeration for the given value. This function is designed to facilitate reflection, whereas for display

solace.Enum. nameOf

Returns the name of an enuerated value given the enumeration and the value.

solace.QueueBrowser. removeMessageFromQueue

Removes a message from the queue by acknowledging it.

The solace.QueueBrowser does not automatically acknowledge messages. once they have been received.

The API does not send acknowledgments immediately. It stores the state for acknowledged messages internally and acknowledges messages, in bulk, when a threshold or timer is reached.

solace.MessageConsumer. removeSubscription

Unsubscribe the queue from a topic, requesting confirmation from the router.

solace.MessageConsumerEventName.SUBSCRIPTION_OK is generated when subscription is removed successfully; otherwise, session event solace.MessageConsumerEventName.SUBSCRIPTION_ERROR is generated.

When the application receives the message consumer event solace.MessageConsumerEventName.SUBSCRIPTION_ERROR, it can obtain the failed topic subscription by calling solace.MessageConsumerEvent#reason. The returned string is in the format "Topic: ".

solace.Session. replyReceivedCallback

A callback that returns replies to requests sent via solace.Session#sendRequest. The replyReceivedCallback must be provided to the API as the third argument of solace.Session#sendRequest.

solace.Session. requestFailedCallback

A callback that returns errors associated with requests sent via solace.Session#sendRequest. The requestFailedCallback must be provided to the API as the fourth argument of solace.Session#sendRequest

solace.Message. reset

Releases all memory associated with this message. All values are reinitialized to defaults. The message is no longer associated with any session or consumer.

solace.Session. resetStats

Reset session statistics to initial values.

solace.SDTStreamContainer. rewind

Rewinds the read pointer to the beginning of the stream. Normally when hasNext returns false, a client application must call rewind() to reiterate over the stream's fields.

solace.Session. send

Publish (send) a message over the session. The message is sent to its set destination.

This method is used for sending both direct and Guaranteed Messages. If the message's solace.MessageDeliveryModeType is solace.MessageDeliveryModeType.DIRECT, the message is a direct message; otherwise, it is a guaranteed message.

solace.CacheSession. sendCacheRequest

Issues an asynchronous cache request. The result of the request will be returned via the listener. Messages returned as a result of issuing the request will be returned to the application via the solace.MessageRxCBInfo associated with this solace.CacheSession's solace.Session

solace.Session. sendReply

Sends a reply message to the destination specified in messageToReplyTo.

If messageToReplyTo is non-null:

If messageToReplyTo is null, the application is responsible for setting the destination and correlationId on the replyMessage.

solace.Session. sendRequest

Sends a request using user-specified callback functions.
Note: The API sets the correlationId and replyTo fields of the message being sent; this overwrites any existing correlationId and replyTo values on the message.

solace.Message. setAcknowledgeImmediately

Set the optional Acknoweledge Immediately message property. When the Acknowledge Immediately property is set to true on an outgoing Guaranteed Message, it indicates that the Solace Message Router should acknoweledge this message immediately upon receipt. By default the property is set to false on newly created messages.

This property, when set by a publisher, may or may not be removed by the appliance prior to delivery to a consumer, so message consumers must not expect the property value indicates how the message was originally published. Therefore if a received message is forwarded by the application, the Acknowledge Immediately property should be explicitly set to the desired value (true or false).

Setting this property on an outgoing direct message has no effect.

solace.Message. setApplicationMessageId

Sets the application-provided message ID.

solace.Message. setApplicationMessageType

Sets the application message type. This value is used by applications only, and is passed through the API and Solace Message Router untouched.

solace.Message. setAsReplyMessage

Sets the reply field of the message.

solace.Message. setBinaryAttachment

Sets the binary attachment part of the message.

The binary attachment is conceptually an array of bytes. When this method is used, the message payload type is solace.MessageType#BINARY See solace.Message#getType.

Applications may set the binary attachment to NULL or undefined to remove the binary attachment and create a message with no payload.

The following types are accepted: Buffer (the nodeJS native type or equivalent) ArrayBuffer, Any DataView or TypedArray, 'latin1' String for backwards compatibility: each character has a code in the range 0-255 representing exactly one byte in the attachment.

solace.CacheSessionProperties. setCacheName

Sets the cache name to which requests should be sent. Cannot be null or blank.

solace.Message. setCorrelationId

Sets the correlation ID. The message Correlation Id is carried in the Solace message headers unmodified by the API and the Solace Message Router. This field may be used for peer-to-peer message synchronization and is commonly used for correlating a request to a reply. See solace.Session#sendRequest.

solace.Message. setCorrelationKey

Sets the correlation Key. A correlation key is used to correlate a message with its acknowledgement or rejection. The correlation key is an object that is passed back to the client during the router acknowledgement or rejection.

The correlation key is a local reference used by applications generating Guaranteed Messages. Messages that are sent in either solace.MessageDeliveryModeType.PERSISTENT or solace.MessageDeliveryModeType.NON_PERSISTENT mode may set the correlation key. If this method is used, the correlation information is returned when the solace.SessionEventCode#event:ACKNOWLEDGED_MESSAGE event is later received for an acknowledged message or when the solace.SessionEventCode#event:REJECTED_MESSAGE_ERROR is received for a rejected message.

The API only maintains a reference to the passed object. If the application requires the contents are unmodified for proper correlation, then it is the application's responsibility to ensure the contents of the object are not modified.

Important: The Correlation Key is not included in the transmitted message and is only used with the local API

solace.Message. setDMQEligible
solace.Message. setDeliverToOne

Sets whether the message is configured for delivering to one client only.

solace.Message. setDeliveryMode

Sets the delivery mode of the message.

solace.Message. setDestination

Sets the destination (solace.DestinationType#Topic or solace.DestinationType#Queue) to publish the message to.

solace.Message. setElidingEligible

Sets whether the message is eligible for eliding.

Message eliding enables filtering of data to avoid transmitting every single update to a subscribing client.

This property does not indicate whether the message was elided.

solace.Message. setGMExpiration

Set the expiration time field. The expiration time is the UTC time (that is, the number of milliseconds from midnight January 1, 1970 UTC) when the message is to expire. The expiration time is carried in the message when set to a non-zero value. Expiration time is not included when this value is set to zero or undefined

The message expiration time is carried to clients that receive the message unmodified and does not effect the life cycle of the message. Use solace.Message#setTimeToLive to enforce message expiry in the network.

solace.SolclientFactory. setLogLevel

This method changes the current log level from the level set when solace.SolclientFactory.init was called.

solace.CacheSessionProperties. setMaxMessageAgeSec

Sets the maximum allowable message age. 0 means no restriction on age.

solace.CacheSessionProperties. setMaxMessages

Sets the maximum count of messages to be delivered per solace.Destination in response to a cache request. 0 means no restriction.

solace.Message. setPriority

Sets the Message Priority Parameter (JMS Priority) value for the message. Numerical values between 0 and 255 are accepted, use undefined to unset.

If destination queues and topic endpoints for this message are configured to respect message priority, the values 0 through 9 can be used to affect the priority of delivery to consumers of those queues or topic endpoints. For the purposes of prioritized message delivery, values larger than 9 are treated the same as 9.

solace.Message. setReplyTo

Sets the replyTo destination

solace.TraceContextSetter. setSampled

Turns on or off sampling for the associated message.

solace.Message. setSdtContainer

Makes this message a strutured data message by assigning it a structured data type (SDT) container payload (such as a solace.SDTMapContainer, solace.SDTStreamContainer or a solace.SDTFieldType.String, which is transported in the binary attachment field.

Assigning a SDT container updates the message's Type property to the appropriate value.

The container argument must be a solace.SDTField with a type of solace.SDTFieldType.MAP, solace.SDTFieldType.STREAM, or solace.SDTFieldType.STRING.

solace.Message. setSenderId

Sets the Sender ID for the message

solace.Message. setSenderTimestamp

Sets the send timestamp (in milliseconds, from midnight, January 1, 1970 UTC). This field can be generated automatically during message publishing, but it will not be generated if previously set to a non-null value by this method. See solace.SessionProperties#generateSendTimestamps.

An application that publishes the same solace.Messsage multiple times and also wants generted timestamps on each messages, should set the sender timestamp to undefined after each call to solace.Session#send.

solace.Message. setSequenceNumber

Sets the application-defined sequence number. If the sequence number is not set, or set to undefined, and solace.SessionProperties#generateSequenceNumber is true, then a sequence number is automatically generated for each sent message.

solace.TraceContextSetter. setSpanId

Sets the value of the span identifier associated with the message.

solace.Message. setTimeToLive
solace.CacheSessionProperties. setTimeoutMsec

Sets the timeout for requests.

  • The valid range is >= 3000.
solace.TraceContextSetter. setTraceId

Sets the value of the trace identifier associated with the message.

solace.TraceContextSetter. setTraceState

Sets the value of the trace state associated with the message.

solace.Message. setTransportContext

Set the transport context. Called when the message is received from broker

solace.Message. setUserCos

Sets the Class of Service (CoS) value for the message.

The Class of Service has different semantics for direct and guaranteed messages.

For messages published with solace.MessageDeliveryModeType.DIRECT, the class of service selects the weighted round-robin delivery queue when the message is forwarded to a consumer. solace.MessageUserCosType#COS1 are the lowest priority messages and will use the Solace Message Router D-1 delivery queues.

For messages published as guaranteed messages (solace.MessageDeliveryModeType.PERSISTENT or solace.MessageDeliveryModeType.NON_PERSISTENT), messages published with solace.MessageUserCosType#COS1 can be rejected by the Solace Message Router if that message would cause any queue or topic-endpoint to exceed its configured low-priority-max-msg-count.

solace.Message. setUserData

Sets the user data part of the message.

solace.Message. setUserPropertyMap

Allows users to specify their own user properties to be carried in the message binary metadata separate from the payload.

solace.TraceContextSetter. setVersion

Sets the version

solace.Message. setXmlContent

Sets the XML content part of the message. The content is encoded by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.

solace.Message. setXmlMetadata

Sets the message's XML metadata section.

solace.Message. settle

Settles this message in a requested way.

If the solace.MessageConsumer on which this message was received is configured to use solace.MessageConsumerAckMode.CLIENT, then when a message is received by an application, the application must call this method to explicitly acknowledge reception of the message. This frees local and router resources associated with an unacknowledged message.

The API does not send acknowledgments immediately. It stores the state for acknowledged messages internally and acknowledges messages, in bulk, when a threshold or timer is reached.

solace.QueueBrowser. start

Begins delivery of messages to this queue browser. This method opens the protocol window to the Solace Message Router so further messages can be received.

A newly created queue browser is in started state.

If the queue browser was already started, this method has no effect.

A consumer is stopped by calling solace.QueueBrowser.stop

solace.MessageConsumer. start

Begins delivery of messages to this consumer. This method opens the protocol window to the Solace Message Router so further messages can be received.

A newly created consumer is in started state.

If the consumer was already started, this method has no effect.

A consumer is stopped by calling solace.MessageConsumer.stop

solace.MessageConsumer. stop

Stops messages from being delivered to this consumer from the Solace Message Router. Messages may continue to be prefetched by the API and queued internally until solace.MessageConsumer#start is called.

If the consumer was already stopped, this method has no effect.

solace.QueueBrowser. stop

Stops messages from being delivered to this queue browser from the Solace Message Router. Messages may continue to be prefetched by the API and queued internally until solace.QueueBrowser#start is called.

If the queue browser was already stopped, this method has no effect.

solace.Session. subscribe

Subscribe to a topic, optionally requesting a confirmation from the router.

If requestConfirmation is set to true: solace.SessionEventCode.SUBSCRIPTION_OK is generated when subscription is added successfully; otherwise, session event solace.SessionEventCode.SUBSCRIPTION_ERROR is generated.

If requestConfirmation is set to false, only session event solace.SessionEventCode.SUBSCRIPTION_ERROR is generated upon failure.

When the application receives session event solace.SessionEventCode.SUBSCRIPTION_ERROR, it can obtain the failed topic subscription by calling solace.SessionEvent#reason. The returned string is in the format of "Topic: ".

solace.ReplayStartLocation. toString
solace.QueueDescriptor. toString

An informational summary of this object, subject to change.

solace.Topic. toString
solace.AbstractQueueDescriptor. toString

An informational summary of this object, subject to change.

solace.MessageConsumer. toString
solace.ReplicationGroupMessageId. toString
solace.TraceContext. toString

Returns the string representation of this object

solace.Destination. toString
solace.SessionProperties. toString

Returns a human-readable representation of this Session, subject to change.

solace.Session. unsubscribe

Unsubscribe from a topic, and optionally request a confirmation from the router.

If requestConfirmation is set to true, session event solace.SessionEventCode.SUBSCRIPTION_OK is generated when subscription is removed successfully; otherwise, session event solace.SessionEventCode.SUBSCRIPTION_ERROR is generated.

If requestConfirmation is set to false, only session event solace.SessionEventCode.SUBSCRIPTION_ERROR is generated upon failure.

When the application receives session event solace.SessionEventCode.SUBSCRIPTION_ERROR, it can obtain the failed topic subscription by calling solace.SessionEvent#reason. The returned string is in the format "Topic: ".

solace.Session. unsubscribeDurableTopicEndpoint

Request that a Durable Topic Endpoint stop receiving data on a topic. Unsubscribe requests are only allowed by the router when no clients are bound to the DTE. If the unubscribe request is successful, the DTE will stop attracting messages, and all messages spooled to the DTE will be deleted.

solace.SessionEventCode.UNSUBSCRIBE_TE_TOPIC_OK is generated when the subscription is removed successfully; otherwise, solace.SessionEventCode.UNSUBSCRIBE_TE_TOPIC_ERROR is generated.

When the application receives session event solace.SessionEventCode.UNSUBSCRIBE_TE_TOPIC_ERROR, it can obtain the failed topic subscription by calling solace.SessionEvent#reason.

solace.Session. updateAuthenticationOnReconnect

Modify (some) authentication-related session properties. The modifications take effect the next time the session connects or reconnects to the broker. There is no change to the active connection. Calling this method does not in itself trigger any kind of reconnection, reauthentication or renegotiation.

Note: the update of "accessToken" and "idToken" properties is currently supported. Authentication Properties

  • accessToken to update previously set access token required for OAUTH2 authentication.
  • idToken to update previously set ID token required for OIDC authentication Example: updateAuthenticationOnReconnect({accessToken : “my_new_token”});
solace.Session. updateProperty

Modify a session property after creation of the session.

This method only works for a select few properties, and updates their value on the live broker session.

solace.Enum. values

Returns values defined on this enumeration for the given keys. To get the enumeration keys, use Object#keys.