Skip to content

Message

Paul Spangler edited this page May 9, 2019 · 2 revisions

NationalInstruments.SystemLink.Clients.Message

Contents

IEventingMessageSession type

Namespace

NationalInstruments.SystemLink.Clients.Message

Summary

Represents an open session for sending and receiving messages between systems connected to the same SystemLink instance. The messages are received automatically via events.

IMessageSession type

Namespace

NationalInstruments.SystemLink.Clients.Message

Summary

Represents an open session for sending and receiving messages between systems connected to the same SystemLink instance.

Close() method

Summary

Closes the message session and releases the client- and server-side resources associated with the session. Any messages queued for the session are lost, and any messages pending publication will not be sent.

Parameters

This method has no parameters.

CloseAsync() method

Summary

Closes the message session and releases the client- and server-side resources associated with the session. Any messages queued for the session are lost, and any messages pending publication will not be sent.

Returns

A task representing the asynchronous operation.

Parameters

This method has no parameters.

Publish(topic,message) method

Summary

Broadcasts a message to a topic. Subscribers of a topic receive every message published to the topic.

Parameters
Name Type Description
topic System.String The topic to publish to.
message System.String The message to publish.
Exceptions
Name Description
System.ArgumentNullException if topic or message is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

PublishAsync(topic,message) method

Summary

Broadcasts a message to a topic. Subscribers of a topic receive every message published to the topic.

Returns

A task representing the asynchronous operation.

Parameters
Name Type Description
topic System.String The topic to publish to.
message System.String The message to publish.
Exceptions
Name Description
System.ArgumentNullException if topic or message is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Subscribe(topic) method

Summary

Subscribes to a topic to receive all messages broadcast with the specified topic name.

Parameters
Name Type Description
topic System.String The topic to subscribe to.
Exceptions
Name Description
System.ArgumentNullException if topic is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

SubscribeAsync(topic) method

Summary

Subscribes to a topic to receive all messages broadcast with the specified topic name.

Returns

A task representing the asynchronous operation.

Parameters
Name Type Description
topic System.String The topic to subscribe to.
Exceptions
Name Description
System.ArgumentNullException if topic is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Unsubscribe(topic) method

Summary

Unsubscribes from a topic to stop receiving messages for that topic.

Parameters
Name Type Description
topic System.String The topic to unsubscribe from.
Exceptions
Name Description
System.ArgumentNullException if topic is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

UnsubscribeAsync(topic) method

Summary

Unsubscribes from a topic to stop receiving messages for that topic.

Returns

A task representing the asynchronous operation.

Parameters
Name Type Description
topic System.String The topic to unsubscribe from.
Exceptions
Name Description
System.ArgumentNullException if topic is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

IQueuedMessageSession type

Namespace

NationalInstruments.SystemLink.Clients.Message

Summary

Represents an open session for sending and receiving messages between systems connected to the same SystemLink instance. The messages are received by manually reading from a queue.

MaxQueueSize property

Summary

Gets the maximum size (in bytes) of the message queue associated with this session. This is helpful for determining how much total memory is available for storing messages.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

QueueSize property

Summary

Gets the size (in bytes) of the message queue associated with this session. This is helpful for determining the amount of memory that unread messages are consuming.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Flush() method

Summary

Clears all messages from the session queue without reading them.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

FlushAsync() method

Summary

Clears all messages from the session queue without reading them.

Returns

A task representing the asynchronous operation.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

GetMaxQueueSizeAsync() method

Summary

Gets the maximum size (in bytes) of the message queue associated with this session. This is helpful for determining how much total memory is available for storing messages.

Returns

A task representing the asynchronous operation.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

GetQueueSizeAsync() method

Summary

Gets the size (in bytes) of the message queue associated with this session. This is helpful for determining the amount of memory that unread messages are consuming.

Returns

A task representing the asynchronous operation.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Read() method

Summary

Reads a message from the queue with a default timeout determined by the server administrator. To read a message, subscribe to a topic first.

Returns

The message that was read and information about the topic it was published to, or null if no messages were available within the timeout period.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Read(timeoutMilliseconds) method

Summary

Reads a message from the queue. To read a message, subscribe to a topic first.

Returns

The message that was read and information about the topic it was published to, or null if no messages were available within the timeout period.

Parameters
Name Type Description
timeoutMilliseconds System.Int32 Amount of time, in milliseconds, to keep the
messaging connection open. May be overridden by a maximum value that the server
administrator allows.
Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

ReadAsync() method

Summary

Reads a message from the queue with a default timeout determined by the server administrator. To read a message, subscribe to a topic first.

Returns

A task representing the asynchronous operation. When complete, the task contains the message that was read and information about the topic it was published to, or null if no messages were available within the timeout period.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

ReadAsync(timeoutMilliseconds) method

Summary

Reads a message from the queue. To read a message, subscribe to a topic first.

Returns

A task representing the asynchronous operation. When complete, the task contains the message that was read and information about the topic it was published to, or null if no messages were available within the timeout period.

Parameters
Name Type Description
timeoutMilliseconds System.Int32 Amount of time, in milliseconds, to keep the
messaging connection open. May be overridden by a maximum value that the server
administrator allows.
Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

MessageReceivedEventArgs type

Namespace

NationalInstruments.SystemLink.Clients.Message

Summary

Represents event data for receiving a message.

#ctor(topic,message) constructor

Summary

Initializes an instance.

Parameters
Name Type Description
topic System.String The topic the message was published to.
message System.String The message that was published.
Exceptions
Name Description
System.ArgumentNullException if topic
or message is null.

Message property

Summary

Gets the message that was published.

Topic property

Summary

Gets the topic the message was published to.

MessageSession type

Namespace

NationalInstruments.SystemLink.Clients.Message

Summary

Provides an IQueuedMessageSession over HTTP or HTTPS for sending and receiving messages between systems connected to the same SystemLink instance. The message queue is managed by the web server. Messages may be dropped if the queue becomes full. The service cleans up sessions that are not used within a certain period of time.

MaxQueueSize property

Summary

Gets the maximum size (in bytes) of the message queue associated with this session. This is helpful for determining how much total memory is available for storing messages.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

QueueSize property

Summary

Gets the size (in bytes) of the message queue associated with this session. This is helpful for determining the amount of memory that unread messages are consuming.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Close() method

Summary

Closes the message session and releases the client- and server-side resources associated with the session. Any messages queued for the session are lost, and any messages pending publication will not be sent.

Parameters

This method has no parameters.

CloseAsync() method

Summary

Closes the message session and releases the client- and server-side resources associated with the session. Any messages queued for the session are lost, and any messages pending publication will not be sent.

Returns

A task representing the asynchronous operation.

Parameters

This method has no parameters.

Dispose() method

Summary

Closes the message session and releases the client- and server-side resources associated with the session. Any messages queued for the session are lost, and any messages pending publication will not be sent.

Parameters

This method has no parameters.

Flush() method

Summary

Clears all messages from the session queue without reading them.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

FlushAsync() method

Summary

Clears all messages from the session queue without reading them.

Returns

A task representing the asynchronous operation.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

GetMaxQueueSizeAsync() method

Summary

Gets the maximum size (in bytes) of the message queue associated with this session. This is helpful for determining how much total memory is available for storing messages.

Returns

A task representing the asynchronous operation.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

GetQueueSizeAsync() method

Summary

Gets the size (in bytes) of the message queue associated with this session. This is helpful for determining the amount of memory that unread messages are consuming.

Returns

A task representing the asynchronous operation.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Open() method

Summary

Opens a new message session on the web server specified by SystemLink Client. The system must be either be registered to a SystemLink Server, or it must be a SystemLink server itself.

Returns

The opened session.

Parameters

This method has no parameters.

Exceptions
Name Description
NationalInstruments.SystemLink.Clients.Core.ApiException if the current system cannot communicate with a SystemLink Server,
if the configuration provided by SystemLink Client cannot be found,
or if the API call to open a session fails.

Open(configuration) method

Summary

Opens a new message session on the web server specified in configuration.

Returns

The opened session.

Parameters
Name Type Description
configuration NationalInstruments.SystemLink.Clients.Core.IHttpConfiguration Defines the web server to connect to and
information about how to connect.
Exceptions
Name Description
System.ArgumentNullException if configuration is null.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call to open a session fails.

OpenAsync() method

Summary

Asynchronously opens a new message session on the web server specified by SystemLink Client. The system must be either be registered to a SystemLink Server, or it must be a SystemLink server itself.

Returns

The opened session.

Parameters

This method has no parameters.

Exceptions
Name Description
NationalInstruments.SystemLink.Clients.Core.ApiException if the current system cannot communicate with a SystemLink Server,
if the configuration provided by SystemLink Client cannot be found,
or if the API call to open a session fails.

OpenAsync(configuration) method

Summary

Asynchronously opens a new message session on the web server specified in configuration.

Returns

A task representing the asynchronous operation. On successful completion, contains the opened session.

Parameters
Name Type Description
configuration NationalInstruments.SystemLink.Clients.Core.IHttpConfiguration Defines the web server to connect to and
information about how to connect.
Exceptions
Name Description
System.ArgumentNullException if configuration is null.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call to open a session fails.

Publish(topic,message) method

Summary

Broadcasts a message to a topic. Subscribers of a topic receive every message published to the topic.

Parameters
Name Type Description
topic System.String The topic to publish to.
message System.String The message to publish.
Exceptions
Name Description
System.ArgumentNullException if topic or message is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

PublishAsync(topic,message) method

Summary

Broadcasts a message to a topic. Subscribers of a topic receive every message published to the topic.

Returns

A task representing the asynchronous operation.

Parameters
Name Type Description
topic System.String The topic to publish to.
message System.String The message to publish.
Exceptions
Name Description
System.ArgumentNullException if topic or message is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Read() method

Summary

Reads a message from the queue with a default timeout determined by the server administrator. To read a message, subscribe to a topic first.

Returns

The message that was read and information about the topic it was published to, or null if no messages were available within the timeout period.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Read(timeoutMilliseconds) method

Summary

Reads a message from the queue. To read a message, subscribe to a topic first.

Returns

The message that was read and information about the topic it was published to, or null if no messages were available within the timeout period.

Parameters
Name Type Description
timeoutMilliseconds System.Int32 Amount of time, in milliseconds, to keep the
messaging connection open. May be overridden by a maximum value that the server
administrator allows.
Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

ReadAsync() method

Summary

Reads a message from the queue with a default timeout determined by the server administrator. To read a message, subscribe to a topic first.

Returns

A task representing the asynchronous operation. When complete, the task contains the message that was read and information about the topic it was published to, or null if no messages were available within the timeout period.

Parameters

This method has no parameters.

Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

ReadAsync(timeoutMilliseconds) method

Summary

Reads a message from the queue. To read a message, subscribe to a topic first.

Returns

A task representing the asynchronous operation. When complete, the task contains the message that was read and information about the topic it was published to, or null if no messages were available within the timeout period.

Parameters
Name Type Description
timeoutMilliseconds System.Int32 Amount of time, in milliseconds, to keep the
messaging connection open. May be overridden by a maximum value that the server
administrator allows.
Exceptions
Name Description
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Subscribe(topic) method

Summary

Subscribes to a topic to receive all messages broadcast with the specified topic name.

Parameters
Name Type Description
topic System.String The topic to subscribe to.
Exceptions
Name Description
System.ArgumentNullException if topic is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

SubscribeAsync(topic) method

Summary

Subscribes to a topic to receive all messages broadcast with the specified topic name.

Returns

A task representing the asynchronous operation.

Parameters
Name Type Description
topic System.String The topic to subscribe to.
Exceptions
Name Description
System.ArgumentNullException if topic is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

Unsubscribe(topic) method

Summary

Unsubscribes from a topic to stop receiving messages for that topic.

Parameters
Name Type Description
topic System.String The topic to unsubscribe from.
Exceptions
Name Description
System.ArgumentNullException if topic is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

UnsubscribeAsync(topic) method

Summary

Unsubscribes from a topic to stop receiving messages for that topic.

Returns

A task representing the asynchronous operation.

Parameters
Name Type Description
topic System.String The topic to unsubscribe from.
Exceptions
Name Description
System.ArgumentNullException if topic is null.
System.ObjectDisposedException if the instance has been closed or disposed.
NationalInstruments.SystemLink.Clients.Core.ApiException if the API call fails.

MessageWithTopic type

Namespace

NationalInstruments.SystemLink.Clients.Message

Summary

Encapsulates a message and the topic it was published to.

#ctor(topic,message) constructor

Summary

Initializes an instance.

Parameters
Name Type Description
topic System.String The topic the message was published to.
message System.String The message that was published.
Exceptions
Name Description
System.ArgumentNullException if topic
or message is null.

Message property

Summary

Gets the message that was published.

Topic property

Summary

Gets the topic the message was published to.

Clone this wiki locally