Namespace CodersRealm.AmqpClient
Classes
AcknowledgementCommandException
Represents an exception that is thrown when an acknowledgement command fails due to an underlying error.
AmqpClientFactory
Provides a factory for creating instances of IAmqpClient with specified configuration options or connection strings.
AmqpException
Represents an NMS exception
AmqpSecurityException
Represents a security-related failure that occurs while using the AMQP client. This exception is thrown when an operation is denied due to authentication, authorization, or other security checks performed by the broker or client.
ClientOptions
Represents the configuration options for the NMS AMQP client, including connection string and redelivery policy.
ConnectionException
Represents a failure to establish or maintain a connection with the AMQP broker. This exception is thrown when the client is unable to connect, loses an existing connection, or encounters errors related to the underlying transport.
ConsumerExtensions
Runtime helpers for extracting capability-specific interfaces from a generic IConsumer instance. These helpers avoid breaking changes while providing explicit runtime checks for acknowledgement/transactional features.
ConsumerOptions
Options for configuring a message consumer of a queue.
DefaultRedeliveryPolicy
Represents the default redelivery policy used to determine message redelivery behavior.
IllegalStateException
Thrown when an operation is requested that is invalid given the current state of the object or client. Use this exception to indicate that the requested action cannot be performed until the object reaches an appropriate state (for example, calling an API method when the connection is closed).
InvalidClientIDException
Thrown when the client identifier provided for a connection is invalid. This mirrors the behavior of the Apache NMS InvalidClientIDException and is raised when a client id is malformed, already in use, or otherwise not acceptable to the broker or client implementation.
InvalidDestinationException
Thrown when an operation references a destination that is invalid for the requested action. Examples include non-existent destinations, destinations of the wrong type, or destinations with malformed names.
InvalidSelectorException
Thrown when a message selector is invalid or cannot be parsed/evaluated by the client or broker. This exception indicates that the selector expression is malformed or uses unsupported features.
MessageEOFException
Thrown when an unexpected end-of-file or end-of-stream is encountered while reading a message. This indicates that the message payload or wire-format ended prematurely and the client could not fully deserialize the message.
MessageFormatException
Thrown when a message cannot be parsed or decoded because its format is invalid or unsupported. This indicates that the wire-format or payload does not conform to the expected message schema and the client cannot construct a valid message object from the received data.
MessageNotReadableException
Thrown when an attempt is made to read data from a message that is not readable. This commonly occurs when a message is in a write-only state or when the message payload cannot be accessed for reading.
MessageNotWriteableException
Thrown when an attempt is made to write to a message that is not writable. This occurs for messages that are in a read-only state or when the message content cannot be modified (for example after the message has been sent).
MessageReceivedContext
Represents the context of a received AMQP message, including the message itself, the action to be taken, and an optional reply message.
ProducerOptions
Options used to configure a message producer.
RedeliveryPolicy
A policy used to customize exactly how you want the redelivery to work.
ReplierOptions
Configuration options that control where and how a replier sends reply messages. These options allow specifying an explicit IDestination, or alternatively a destination name and type to be used when creating the reply destination.
ResourceAllocationException
Represents a failure that occurs when required resources cannot be allocated.
SendReplyException
Represents an exception that is thrown when an error occurs while sending a reply message.
ServiceCollectionExtensions
Provides extension methods for IServiceCollection to register NMS AMQP client services.
StartupException
Represents an exception that is thrown when an error occurs while starting up a Message Receiver or a Producer.
SubscriberOptions
Options used to configure a subscriber to a topic.
TransactionInProgressException
Thrown when an operation cannot be performed because a transaction is already in progress on the connection or session. Use this exception to indicate conflicting transaction operations such as attempting to begin a new transaction while another is active, or to mark that certain actions are illegal during a transaction lifecycle.
TransactionRolledBackException
Thrown when a transaction has been rolled back instead of committed. This exception indicates that the work performed within the transaction was not applied, either due to an explicit rollback request, an error during the transaction, or a broker-initiated rollback.
TransactionalCommandException
Represents an exception that is thrown when a transactional command fails during execution.
UserHandlerException
Represents an exception that is thrown when a user-provided handler throws an exception.
Interfaces
IAcknowledgeConsumer
Represents a consumer that supports explicit acknowledge and negative acknowledge operations (e.g. ClientAcknowledge or IndividualAcknowledge modes).
IAmqpClient
Represents a client that manages AMQP connection lifecycle and related producer/consumer/subscriber managers.
IAmqpClientFactory
Defines a factory for creating instances of IAmqpClient with specified configuration options or connection strings.
IBytesMessage
A BytesMessage object is used to send a message containing a stream of uninterpreted bytes. It inherits from the Message interface and adds a bytes message body. The receiver of the message supplies the interpretation of the bytes.
This message type is for client encoding of existing message formats. If possible, one of the other self-defining message types should be used instead.
Although the NMS API allows the use of message properties with byte messages, they are typically not used, since the inclusion of properties may affect the format.
When the message is first created, and when ClearBody is called, the body of the message is in write-only mode. After the first call to Reset has been made, the message body is in read-only mode. After a message has been sent, the client that sent it can retain and modify it without affecting the message that has been sent. The same message object can be sent multiple times. When a message has been received, the provider has called Reset so that the message body is in read-only mode for the client.
If ClearBody is called on a message in read-only mode, the message body is cleared and the message is in write-only mode.
If a client attempts to read a message in write-only mode, a MessageNotReadableException is thrown.
If a client attempts to write a message in read-only mode, a MessageNotWriteableException is thrown.
IConsumer
Represents a message consumer that can receive messages from a destination (queue or topic) in a messaging system.
IConsumerManager
Manager abstraction responsible for creating and managing IConsumer instances. Implementations provide asynchronous creation methods with various configuration options and support deletion/lifecycle management of created consumers.
IDestination
A base interface for destinations such as queues or topics
IDestinationProvider
Provides methods for creating temporary destinations and resolving named destinations (queues and topics) in a messaging system.
IMapMessage
Represents a Map message which contains key and value pairs which are of primitive types
IMessage
Represents a message either to be sent to a message broker or received from a message broker.
IMessageCreator
Defines a contract for creating various types of messages in a messaging system. Implementations of this interface are responsible for providing methods to create different message types, such as bytes, map, object, stream, and text messages, both with and without initial content. All methods are asynchronous and return tasks that complete with the created message instances.
IMessageProducer
Represents a message producer that can create messages and destinations.
IPrimitiveMap
Represents a Map of primitive types where the keys are all string instances and the values are strings or numbers.
IProducer
Defines the contract for a message producer that creates and sends messages to queues or topics in a messaging system. Provides asynchronous methods for message creation, sending, and transaction management. Implementations are expected to be safe for concurrent use and to honor cancellation semantics where applicable.
IProducerManager
Factory abstraction responsible for creating and managing IProducer instances. Implementations create producers for destinations or queues and support deletion and lifecycle observation. All creation methods are asynchronous to allow for remote or I/O-bound producer initialization.
IQueue
Represents a queue in a message broker.
IRedeliveryPolicy
Represents the redelivery policy used by the AMQP client for supporting message brokers.
IStreamMessage
A StreamMessage object is used to send a stream of primitive types in the .NET programming language. It is filled and read sequentially. It inherits from the Message interface and adds a stream message body.
The primitive types can be read or written explicitly using methods for each type. They may also be read or written generically as objects. For instance, a call to IStreamMessage.WriteInt32(6) is equivalent to StreamMessage.WriteObject( (Int32)6 ). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known at compile time.
When the message is first created, and when ClearBody is called, the body of the message is in write-only mode. After the first call to reset has been made, the message body is in read-only mode. After a message has been sent, the client that sent it can retain and modify it without affecting the message that has been sent. The same message object can be sent multiple times. When a message has been received, the provider has called reset so that the message body is in read-only mode for the client.
If ClearBody is called on a message in read-only mode, the message body is cleared and the message body is in write-only mode.
If a client attempts to read a message in write-only mode, a MessageNotReadableException is thrown.
If a client attempts to write a message in read-only mode, a MessageNotWriteableException is thrown.
IStreamMessage objects support the following conversion table. The marked cases must be supported. The unmarked cases must throw a NMSException. The String-to-primitive conversions may throw a runtime exception if the primitive's valueOf() method does not accept it as a valid String representation of the primitive.
A value written as the row type can be read as the column type.
| boolean byte short char int long float double String byte[] | |
|---|---|
| boolean | X X |
| byte | X X X X X |
| short | X X X X |
| char | X X |
| int | X X X |
| long | X X |
| float | X X X |
| double | X X |
| String | X X X X X X X X |
| byte[] | X |
| ---------------------------------------------------------------------- |
ISubscriber
Represents a message consumer that can receive messages from a destination (queue or topic) in a messaging system.
ISubscriberManager
Manager abstraction responsible for creating and managing ISubscriber instances. Implementations provide asynchronous creation methods with various configuration options and support deletion/lifecycle management of created subscribers.
ITemporaryQueue
Represents a temporary queue which exists for the duration of the IConnection which created it.
ITemporaryTopic
Represents a temporary topic which exists for the duration of the IConnection which created it.
ITextMessage
Represents a text based message
ITopic
Represents a topic in a message broker.
ITransactionalConsumer
Represents a consumer that supports transactional commands (Commit/Rollback).
Enums
AcknowledgementMode
The mode used to acknowledge messages after they are consumed
DestinationType
Represents the type of the destination such as a queue or topic.
MessageAction
Defines the actions that can be taken for a message processed by the consumer.
MsgDeliveryMode
Define an enumerated array of message delivery modes. Provider-specific values can be used to extend this enumerated mode. TIBCO is known to provide a third value of ReliableDelivery. At minimum, a provider must support Persistent and NonPersistent.
MsgPriority
Define an enumerated array of message priorities.
ReplyDestinationType
Specifies the type of destination to which a reply message is sent.
Delegates
ErrorHandlerAsync
Delegate invoked when an error occurs while processing messages.
MessageProcessorAsync
Delegate invoked when a message is received from the message queue.
MessageTransformerAsync
A delegate that a client can register that will be called to preprocess messages allowing the client to modify message properties and/or transform a message from one type to another, StreamMessage to TextMessage, ObjectMessage to TextMessage containing XML, etc. Return null or original message if no change.