Click or drag to resize

AmqpCFXEndpoint Class

Primary class used by endpoint implementers to facility bi-directional, AMQP 1.0 based communications. Using this class, endpoints may publish messages to one or more destinations, subscribe to receive messages from one or more sources, and process incoming CFX requests from other CFX endpoints. This class also supports security features, including secure AMQP 1.0 protocol (AMQPS or AMQP over TLS), as well as SASL based authentication (Simple Authentication and Security Layer). At the time of this writing, the endpoint has been tested and verified for use with the RabbitMQ broker (with AMQP 1.0 plug-in enabled), as well as the Apache Qpid broker.
Inheritance Hierarchy
SystemObject
  CFX.TransportAmqpCFXEndpoint

Namespace: CFX.Transport
Assembly: CFX (in CFX.dll) Version: 1.7.3
Syntax
public class AmqpCFXEndpoint : IDisposable

The AmqpCFXEndpoint type exposes the following members.

Constructors
 NameDescription
Public methodAmqpCFXEndpoint Default Constructor
Top
Properties
 NameDescription
Public propertyCFXHandle Returns the CFXHandle of the endpoint currently associated with this AMQP endpoint.
Public propertyStatic memberCodec Sets the codec used to transmit messages across the wire, including the newly introduced GZIP Compressed Codec, which is now the default.
Public propertyStatic memberDurableMessages The AMQP 1.0 message framing header includes a "Durable" property that notifies recipients that this message should be maintained in durable storage on the message broker until delivered to all recipients, surviving broker system restarts. When this property is set to true, all messages published by the endpoint will be tagged with the Durable framing header. The default value is true.
Public propertyStatic memberDurableReceiverSetting Establishes the value of the Durable framing header flag for subscription channels. Different brokers will interprety this value differently. Refer to your broker documentation to determine how to set this flag. The default setting is 1 (which signals to RabbitMQ that durable messages should be removed from their queue once successfully delivered to this endpoint).
Public propertyHeartbeatFrequency The AmqpCFXEndpoint class automatically publishies CFX Heartbeat messages on 1 minute intervals by default. You can adjust this frequency using this property. If set to zero (0), automatic publication of Heartbeat messages will be disabled. The minimum frequency is 1 second and the maximum frequency is 5 minutes.
Public propertyIsOpen Read-only property indicating whether or not the endpoint is in an open state.
Public propertyStatic memberKeepAliveEnabled When enabled, the endpoint will automatically refresh (disconnect/reconnect) all of its subscription channels. This is to prevent brokers from timing out the connection when the channel has been dormant for a period of time. The default setting is 60 seconds.
Public propertyStatic memberKeepAliveInterval If keep alive is enabled, this property specifies the time period between keep alive reconnects.
Public propertyStatic memberMaxFrameSize Used by the AMQP protocol to establish the maximum number of bytes to transmit per "frame" (aka "chunk"). Larger messages may be broken down into multiple frames if their size exceeds the max frame size. The default size is 500,000 bytes.
Public propertyStatic memberMaxMessagesPerTransmit When applicable, the endpoint will attempt to publish multiple messages in one AMQP transaction. This is done to maximize effeciency. This property sets the maximum number of messages that may be grouped together in a single AMQP message. The default value is 30 messages.
Public propertyStatic memberReconnectInterval The time interval between attempts to reconnect publish or subscriber channels after a network interruption. The default setting is false.
Public propertyStatic memberRequestTimeout When executing a point to point request/response call to another CFX endpoint, this time span specifies the maximum amount of time that this endpoint will wait for the other endpoint to respond before timing out. The default is 30 seconds.
Public propertyRequestUri Returns the Uri currently being used to accept incoming CFX requests for this endpoint
Public propertySubjectFormat Establishes the format for the subject property of the AMQP message envelope on all messages published by this endpoint. The following tags may be used in the format string:
  • ${cfx-handle} Will be replaced with the handle of your endpoint (CFXEnvelope.Source}
  • ${cfx-topic} Will be replaced with the topic of the message ("CFX.Production" for example)
  • ${cfx-messagename} Will be replaced with the fully qualified name of the message ("CFX.Production.WorkStarted" for example)
If this property is null or an empty string, the default subject format will be utilized: "${cfx-handle}.${cfx-messagename}"
Public propertyValidateCertificates If set to false, certificate validation will be disabled. This should only be used for testing purposes when a valid, commercial SSL certificate is not available for testing.
Top
Methods
 NameDescription
Public methodAddListener Allows this endpoint to listen for and receive unsolicited (published) messages directly from multiple CFX endpoints that have been configured to publish messages to this endpoint, just like a message broker. Your endpoint must be configured to receive requests (via the Open method requestUri parameter) before adding a listener.
Public methodAddMessageSource Set up a message source on this endpoint that other endpoints may subscribe to. Messages published to a message source are placed in a queue, and remain there until a subscriber connects and removes them. The queue is volatile, and will be deleted when the hosting process is restarted.
Public methodAddPublishChannel(AmqpChannelAddress, String, X509Certificate) Adds a new publish channel for this endpoint. All messages published by the endpoint will be transmitted to one or more publish channels that are established using this method. Only call this methoud after this endpoint has been opened by the Open method.
Public methodAddPublishChannel(Uri, String, String, X509Certificate) Adds a new publish channel for this endpoint. All messages published by the endpoint will be transmitted to one or more publish channels that are established using this method. Only call this methoud after this endpoint has been opened by the Open method.
Public methodAddSubscribeChannel(AmqpChannelAddress, String, X509Certificate) Adds a new subscription channel for this endpoint.
Public methodAddSubscribeChannel(Uri, String, String, X509Certificate) Adds a new subscription channel for this endpoint.
Public methodClose Closes the endpoint, including all inbound and outbound channels.
Public methodCloseListener Closes a previously added listener (added with AddListener method).
Public methodCloseMessageSource Closes a previously added message source. All messages in the source's queue will be purged upon closing.
Public methodClosePublishChannel(AmqpChannelAddress) Closes the specified publish channel (that was opened previously via a call to AddPublishChannel.
Public methodClosePublishChannel(Uri, String) Closes the specified publish channel (that was opened previously via a call to AddPublishChannel.
Public methodCloseSubscribeChannel(AmqpChannelAddress) Closes the specified subscription channel (that was opened previously via a call to AddSubscribeChannel.
Public methodCloseSubscribeChannel(Uri, String) Closes the specified subscription channel (that was opened previously via a call to AddSubscribeChannel.
Public methodDispose Disposes the endpoint, closing all inbound and outbound channels.
Public methodExecuteRequest Performs a direct, point-to-point request/response transaction with another CFX Endpoint.
Public methodExecuteRequestAsync Performs a direct, point-to-point request/response transaction with another CFX Endpoint.
Public methodGetSpoolSize Returns the total number of messages spooled for a particular
Public methodOpen(String, Uri, X509Certificate2) Opens and inintializes the Endpoint. This should be called only once prior to closing the endpoint.
Public methodOpen(String, IPAddress, Int32, X509Certificate2) Opens and inintializes the Endpoint. This should be called only once prior to closing the endpoint.
Public methodPublish(CFXEnvelope) Publishes a CFX message. The message will be transmitted to all publish channels.
Public methodPublish(CFXMessage) Publishes a CFX message. A CFX envelope will be automatically generated for your message. The message will be transmitted to all publish channels.
Public methodPublishMany(IEnumerableCFXEnvelope) Publishes multiple CFX messages at one time. The messages will be transmitted to all publish channels.
Public methodPublishMany(IEnumerableCFXMessage) Publishes multiple CFX messages at one time. CFX envelopes will be automatically generated for your messages. The messages will be transmitted to all publish channels.
Public methodPublishManyToChannel(IEnumerableCFXEnvelope, AmqpChannelAddress) Publishes a collection of CFX envelopes to the specified channel.
Public methodPublishManyToChannel(IEnumerableCFXMessage, AmqpChannelAddress) Publishes a collection of CFX messages to the specified channel. CFX envelopes will be automatically generated for each of your messages.
Public methodPublishManyToMessageSource Publishes multiple messages to a message source.
Public methodPublishToChannel(CFXEnvelope, AmqpChannelAddress) Publishes a CFX envelope to the specified channel.
Public methodPublishToChannel(CFXMessage, AmqpChannelAddress) Publishes a CFX message to the specified channel. A CFX envelope will be automatically generated for your message.
Public methodPublishToMessageSource Publishes a single message to a message source.
Public methodPurgeAllSpools Permanently deletes all spooled messages from all Publish channels associated with this endpoint.
Public methodPurgeMessageSource Purges all queued messages for the given message source.
Public methodPurgeSpool Permanently deletes all spooled messages from the specified Publish channel.
Public methodTestChannel Tests if the specified network address is capable of establishing an AMQP connection from this endpoint.
Public methodTestPublishChannel Tests if the specified network address and AMQP target address is capable of receiving messages published from this endpoint.
Public methodTestSubscribeChannel Tests if this endpoint is capable of subscribing to and receiving message from the specified network address and AMQP source address.
Top
Events
 NameDescription
Public eventOnCFXMessageReceived Event that fires whenever a CFX message is received from a subscription type channel.
Public eventOnCFXMessageReceivedFromListener Event that fires whenever a CFX message is received from a listener type channel.
Public eventOnConnectionEvent Event that fires whenever a publish or subscription type connection is established, interrupted, or disconnected. The AmqpCFXEndpoint class will continuously attempt to reconnect any connection that has been interrupted.
Public eventOnMalformedMessageReceived Event that fires whenever a message is received that is not a valid, properly formatted CFX Message
Public eventOnRequestReceived Event that fires whenever a request type CFX message is received by this Endpoint from another Endpoint. Implement this event with your own handler to process incoming point-to-point Request / Response type CFX messages.
Public eventOnValidateCertificate Implement this event with your own handler if you wish to validate the server certificate used for secure, encrypted, AMQPS communications.
Top
See Also