RabbitMQ.Client Object describing various overarching parameters associated with a particular AMQP protocol variant. Construct a connection from a given set of parameters, a frame handler, and no automatic recovery. The "insist" parameter is passed on to the AMQP connection.open method. Construct a connection from a given set of parameters, a frame handler, and automatic recovery settings. Construct a connection from a given set of parameters, a frame handler, a client-provided name, and no automatic recovery. The "insist" parameter is passed on to the AMQP connection.open method. Construct a connection from a given set of parameters, a frame handler, a client-provided name, and automatic recovery settings. Construct a frame handler for a given endpoint. Socket factory method. Timeout in milliseconds. Represents a TCP-addressable AMQP peer: a host name and port number. Construct a protocol model atop a given session. Retrieve the protocol's API name, used for printing, configuration properties, IDE integration, Protocols.cs etc. Retrieve the protocol's default TCP port. Retrieve the protocol's major version number. Retrieve the protocol's minor version number. Retrieve the protocol's revision (if specified). Protocol major version (= 0) Protocol minor version (= 9) Protocol revision (= 1) Protocol API name (= AMQP_0_9_1) Default TCP port (= 5672) (= 1) (= 2) (= 3) (= 8) (= 4096) (= 206) (= 200) (= 311) (= 313) (= 320) (= 402) (= 403) (= 404) (= 405) (= 406) (= 501) (= 502) (= 503) (= 504) (= 505) (= 506) (= 530) (= 540) (= 541) Autogenerated type. AMQP specification method "connection.start". A decoded AMQP method frame. AMQP methods can be RPC requests, RPC responses, exceptions (ChannelClose, ConnectionClose), or one-way asynchronous messages. Currently this information is not recorded in their type or interface: it is implicit in the way the method is used, and the way it is defined in the AMQP specification. A future revision of the RabbitMQ .NET client library may extend the IMethod interface to represent this information explicitly. Retrieves the class ID number of this method, as defined in the AMQP specification XML. Retrieves the method ID number of this method, as defined in the AMQP specification XML. Retrieves the name of this method - for debugging use. Autogenerated type. AMQP specification method "connection.start-ok". Autogenerated type. AMQP specification method "connection.secure". Autogenerated type. AMQP specification method "connection.secure-ok". Autogenerated type. AMQP specification method "connection.tune". Autogenerated type. AMQP specification method "connection.tune-ok". Autogenerated type. AMQP specification method "connection.open". Autogenerated type. AMQP specification method "connection.open-ok". Autogenerated type. AMQP specification method "connection.close". Autogenerated type. AMQP specification method "connection.close-ok". Autogenerated type. AMQP specification method "connection.blocked". Autogenerated type. AMQP specification method "connection.unblocked". Autogenerated type. AMQP specification method "channel.open". Autogenerated type. AMQP specification method "channel.open-ok". Autogenerated type. AMQP specification method "channel.flow". Autogenerated type. AMQP specification method "channel.flow-ok". Autogenerated type. AMQP specification method "channel.close". Autogenerated type. AMQP specification method "channel.close-ok". Autogenerated type. AMQP specification method "exchange.declare". Autogenerated type. AMQP specification method "exchange.declare-ok". Autogenerated type. AMQP specification method "exchange.delete". Autogenerated type. AMQP specification method "exchange.delete-ok". Autogenerated type. AMQP specification method "exchange.bind". Autogenerated type. AMQP specification method "exchange.bind-ok". Autogenerated type. AMQP specification method "exchange.unbind". Autogenerated type. AMQP specification method "exchange.unbind-ok". Autogenerated type. AMQP specification method "queue.declare". Autogenerated type. AMQP specification method "queue.declare-ok". Autogenerated type. AMQP specification method "queue.bind". Autogenerated type. AMQP specification method "queue.bind-ok". Autogenerated type. AMQP specification method "queue.unbind". Autogenerated type. AMQP specification method "queue.unbind-ok". Autogenerated type. AMQP specification method "queue.purge". Autogenerated type. AMQP specification method "queue.purge-ok". Autogenerated type. AMQP specification method "queue.delete". Autogenerated type. AMQP specification method "queue.delete-ok". Autogenerated type. AMQP specification method "basic.qos". Autogenerated type. AMQP specification method "basic.qos-ok". Autogenerated type. AMQP specification method "basic.consume". Autogenerated type. AMQP specification method "basic.consume-ok". Autogenerated type. AMQP specification method "basic.cancel". Autogenerated type. AMQP specification method "basic.cancel-ok". Autogenerated type. AMQP specification method "basic.publish". Autogenerated type. AMQP specification method "basic.return". Autogenerated type. AMQP specification method "basic.deliver". Autogenerated type. AMQP specification method "basic.get". Autogenerated type. AMQP specification method "basic.get-ok". Autogenerated type. AMQP specification method "basic.get-empty". Autogenerated type. AMQP specification method "basic.ack". Autogenerated type. AMQP specification method "basic.reject". Autogenerated type. AMQP specification method "basic.recover-async". Autogenerated type. AMQP specification method "basic.recover". Autogenerated type. AMQP specification method "basic.recover-ok". Autogenerated type. AMQP specification method "basic.nack". Autogenerated type. AMQP specification method "tx.select". Autogenerated type. AMQP specification method "tx.select-ok". Autogenerated type. AMQP specification method "tx.commit". Autogenerated type. AMQP specification method "tx.commit-ok". Autogenerated type. AMQP specification method "tx.rollback". Autogenerated type. AMQP specification method "tx.rollback-ok". Autogenerated type. AMQP specification method "confirm.select". Autogenerated type. AMQP specification method "confirm.select-ok". Autogenerated type. AMQP specification content header properties for content class "basic" A decoded AMQP content header frame. Retrieve the AMQP class ID of this content header. Retrieve the AMQP class name of this content header. Fill this instance from the given byte buffer stream. Retrieve the AMQP class ID of this content header. Retrieve the AMQP class name of this content header. Common AMQP Basic content-class headers interface, spanning the union of the functionality offered by versions 0-8, 0-8qpid, 0-9 and 0-9-1 of AMQP. The specification code generator provides protocol-version-specific implementations of this interface. To obtain an implementation of this interface in a protocol-version-neutral way, use . Each property is readable, writable and clearable: a cleared property will not be transmitted over the wire. Properties on a fresh instance are clear by default. Clear the property. Clear the property (cluster id is deprecated in AMQP 0-9-1). Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the Type property. Clear the property. Returns true if the property is present. Returns true if the property is present (cluster id is deprecated in AMQP 0-9-1). Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the Type property is present. Returns true if the UserId property is present. Sets to either persistent (2) or non-persistent (1). The numbers 1 and 2 for delivery mode are "magic" in that they appear in the AMQP 0-8 and 0-9 specifications as part of the definition of the DeliveryMode Basic-class property, without being defined as named constants. Calling this method causes to take on a value. In order to reset to the default empty condition, call . Application Id. Intra-cluster routing identifier (cluster id is deprecated in AMQP 0-9-1). MIME content encoding. MIME content type. Application correlation identifier. Non-persistent (1) or persistent (2). Message expiration specification. Message header field table. Is of type . Application message Id. Sets to either persistent (2) or non-persistent (1). Message priority, 0 to 9. Destination to reply to. Convenience property; parses property using , and serializes it using . Returns null if property cannot be parsed by . Message timestamp. Message type name. User Id. Clear the property. Clear the property (cluster id is deprecated in AMQP 0-9-1). Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Clear the Type property. Clear the property. Returns true if the property is present. Returns true if the property is present (cluster id is deprecated in AMQP 0-9-1). Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the Type property is present. Returns true if the UserId property is present. Sets to either persistent (2) or non-persistent (1). The numbers 1 and 2 for delivery mode are "magic" in that they appear in the AMQP 0-8 and 0-9 specifications as part of the definition of the DeliveryMode Basic-class property, without being defined as named constants. Calling this method causes to take on a value. In order to reset to the default empty condition, call . Application Id. Intra-cluster routing identifier (cluster id is deprecated in AMQP 0-9-1). MIME content encoding. MIME content type. Application correlation identifier. Non-persistent (1) or persistent (2). Message expiration specification. Message header field table. Is of type . Application message Id. Sets to either persistent (2) or non-persistent (1). Message priority, 0 to 9. Destination to reply to. Convenience property; parses property using , and serializes it using . Returns null if property cannot be parsed by . Message timestamp. Message type name. User Id. Autogenerated type. Private implementation class - do not use directly. Retrieves the class ID number of this method, as defined in the AMQP specification XML. Retrieves the method ID number of this method, as defined in the AMQP specification XML. Retrieves the name of this method - for debugging use. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Autogenerated type. Private implementation class - do not use directly. Not part of the public API. Extension of IModel to include utilities and connection-setup routines needed by the implementation side. This interface is used by the API autogeneration process. The AMQP XML specifications are read by the spec compilation tool, and after the basic method interface and implementation classes are generated, this interface is scanned, and a spec-version-specific implementation is autogenerated. Annotations are used on certain methods, return types, and parameters, to customise the details of the autogeneration process. Common AMQP model, spanning the union of the functionality offered by versions 0-8, 0-8qpid, 0-9 and 0-9-1 of AMQP. Extends the interface, so that the "using" statement can be used to scope the lifetime of a channel when appropriate. Abort this session. If the session is already closed (or closing), then this method does nothing but wait for the in-progress close operation to complete. This method will not return to the caller until the shutdown is complete. In comparison to normal method, will not throw or or any other during closing model. Abort this session. The method behaves in the same way as , with the only difference that the model is closed with the given model close code and message. The close code (See under "Reply Codes" in the AMQP specification) A message indicating the reason for closing the model (Spec method) Acknowledge one or more delivered message(s). Delete a Basic content-class consumer. Start a Basic content-class consumer. The consumer is started with noAck=false (i.e. BasicAck is required), an empty consumer tag (i.e. the server creates and returns a fresh consumer tag), noLocal=false and exclusive=false. Start a Basic content-class consumer. The consumer is started with an empty consumer tag (i.e. the server creates and returns a fresh consumer tag), noLocal=false and exclusive=false. Start a Basic content-class consumer. The consumer is started with noLocal=false and exclusive=false. Start a Basic content-class consumer. (Spec method) Retrieve an individual message, if one is available; returns null if the server answers that no messages are currently available. See also . Reject one or more delivered message(s). (Spec method) Convenience overload of BasicPublish. The publication occurs with mandatory=false and immediate=false. (Spec method) Convenience overload of BasicPublish. The publication occurs with mandatory=false (Spec method) Convenience overload of BasicPublish. (Spec method) Configures QoS parameters of the Basic content-class. (Spec method). (Spec method). (Spec method) Reject a delivered message. Close this session. If the session is already closed (or closing), then this method does nothing but wait for the in-progress close operation to complete. This method will not return to the caller until the shutdown is complete. Close this session. The method behaves in the same way as Close(), with the only difference that the model is closed with the given model close code and message. The close code (See under "Reply Codes" in the AMQP specification) A message indicating the reason for closing the model Enable publisher acknowledgements. Construct a completely empty content header for use with the Basic content class. (Extension method) Bind an exchange to an exchange. (Extension method) Bind an exchange to an exchange. Like ExchangeBind but sets nowait to true. (Spec method) Declare an exchange. The exchange is declared non-passive and non-internal. The "nowait" option is not exercised. (Spec method) Declare an exchange. The exchange is declared non-passive, non-autodelete, and non-internal, with no arguments. The "nowait" option is not exercised. (Spec method) Declare an exchange. The exchange is declared non-passive, non-durable, non-autodelete, and non-internal, with no arguments. The "nowait" option is not exercised. Same as ExchangeDeclare but sets nowait to true and returns void (as there will be no response from the server). (Spec method) Declare an exchange. The exchange is declared passive. (Spec method) Delete an exchange. (Spec method) Delete an exchange. The exchange is deleted regardless of any queue bindings. Like ExchangeDelete but sets nowait to true. (Extension method) Unbind an exchange from an exchange. (Extension method) Unbind an exchange from an exchange. Like ExchangeUnbind but sets nowait to true. (Spec method) Bind a queue to an exchange. (Spec method) Bind a queue to an exchange. Same as QueueBind but sets nowait parameter to true. (Spec method) Declare a queue. The queue is declared non-passive, non-durable, but exclusive and autodelete, with no arguments. The server autogenerates a name for the queue - the generated name is the return value of this method. (Spec method) Declare a queue. Same as QueueDeclare but sets nowait to true and returns void (as there will be no response from the server). Declare a queue passively. The queue is declared passive, non-durable, non-exclusive, and non-autodelete, with no arguments. The queue is declared passively; i.e. only check if it exists. Returns the number of messages in a queue ready to be delivered to consumers. This method assumes the queue exists. If it doesn't, an exception will be closed with an exception. The name of the queue Returns the number of consumers on a queue. This method assumes the queue exists. If it doesn't, an exception will be closed with an exception. The name of the queue (Spec method) Delete a queue. Returns the number of messages purged during queue deletion. uint.MaxValue. (Spec method) Delete a queue. Returns the number of messages purged during queue deletion. Same as QueueDelete but sets nowait parameter to true and returns void (as there will be no response from the server) (Spec method) Purge a queue of messages. Returns the number of messages purged. (Spec method) Unbind a queue from an exchange. (Spec method) Commit this session's active TX transaction. (Spec method) Roll back this session's active TX transaction. (Spec method) Enable TX mode for this session. Wait until all published messages have been confirmed. Waits until all messages published since the last call have been either ack'd or nack'd by the broker. Returns whether all the messages were ack'd (and none were nack'd). Note, throws an exception when called on a non-Confirm channel. Wait until all published messages have been confirmed. True if no nacks were received within the timeout, otherwise false. How long to wait (at most) before returning whether or not any nacks were returned. Waits until all messages published since the last call have been either ack'd or nack'd by the broker. Returns whether all the messages were ack'd (and none were nack'd). Note, throws an exception when called on a non-Confirm channel. Wait until all published messages have been confirmed. True if no nacks were received within the timeout, otherwise false. How long to wait (at most) before returning whether or not any nacks were returned. True if the method returned because the timeout elapsed, not because all messages were ack'd or at least one nack'd. Waits until all messages published since the last call have been either ack'd or nack'd by the broker. Returns whether all the messages were ack'd (and none were nack'd). Note, throws an exception when called on a non-Confirm channel. Wait until all published messages have been confirmed. Waits until all messages published since the last call have been ack'd by the broker. If a nack is received, throws an OperationInterrupedException exception immediately. Wait until all published messages have been confirmed. Waits until all messages published since the last call have been ack'd by the broker. If a nack is received or the timeout elapses, throws an OperationInterrupedException exception immediately. Channel number, unique per connections. Returns null if the session is still in a state where it can be used, or the cause of its closure otherwise. Signalled when an unexpected message is delivered Under certain circumstances it is possible for a channel to receive a message delivery which does not match any consumer which is currently set up via basicConsume(). This will occur after the following sequence of events: ctag = basicConsume(queue, consumer); // i.e. with explicit acks // some deliveries take place but are not acked basicCancel(ctag); basicRecover(false); Since requeue is specified to be false in the basicRecover, the spec states that the message must be redelivered to "the original recipient" - i.e. the same channel / consumer-tag. But the consumer is no longer active. In these circumstances, you can register a default consumer to handle such deliveries. If no default consumer is registered an InvalidOperationException will be thrown when such a delivery arrives. Most people will not need to use this. Returns true if the model is no longer in a state where it can be used. Returns true if the model is still in a state where it can be used. Identical to checking if equals null. When in confirm mode, return the sequence number of the next message to be published. Signalled when a Basic.Ack command arrives from the broker. Signalled when a Basic.Nack command arrives from the broker. All messages received before this fires that haven't been ack'ed will be redelivered. All messages received afterwards won't be. Handlers for this event are invoked by the connection thread. It is sometimes useful to allow that thread to know that a recover-ok has been received, rather than the thread that invoked . Signalled when a Basic.Return command arrives from the broker. Signalled when an exception occurs in a callback invoked by the model. Examples of cases where this event will be signalled include exceptions thrown in methods, or exceptions thrown in delegates etc. Notifies the destruction of the model. If the model is already destroyed at the time an event handler is added to this event, the event handler will be fired immediately. Amount of time protocol operations (e.g. queue.declare) are allowed to take before timing out. Sends a Connection.TuneOk. Used during connection initialisation. Handle incoming Basic.Ack methods. Signals a BasicAckEvent. Handle incoming Basic.CancelOk methods. Handle incoming Basic.ConsumeOk methods. Handle incoming Basic.Deliver methods. Dispatches to waiting consumers. Handle incoming Basic.GetEmpty methods. Routes the information to a waiting Basic.Get continuation. Note that the clusterId field is ignored, as in the specification it notes that it is "deprecated pending review". Handle incoming Basic.GetOk methods. Routes the information to a waiting Basic.Get continuation. Handle incoming Basic.Nack methods. Signals a BasicNackEvent. Handle incoming Basic.RecoverOk methods received in reply to Basic.Recover. Handle incoming Basic.Return methods. Signals a BasicReturnEvent. Handle an incoming Channel.Close. Shuts down the session and model. Handle an incoming Channel.CloseOk. Handle incoming Channel.Flow methods. Either stops or resumes sending the methods that have content. Handle an incoming Connection.Blocked. Handle an incoming Connection.Close. Shuts down the connection and all sessions and models. Handle an incoming Connection.OpenOk. Handle incoming Connection.Secure methods. Handle an incoming Connection.Start. Used during connection initialisation. Handle incoming Connection.Tune methods. Handle an incominga Connection.Unblocked. Handle incoming Queue.DeclareOk methods. Routes the information to a waiting Queue.DeclareOk continuation. Used to send a Basic.Cancel method. The public consume API calls this while also managing internal datastructures. Used to send a Basic.Consume method. The public consume API calls this while also managing internal datastructures. Used to send a Basic.Get. Basic.Get is a special case, since it can result in a Basic.GetOk or a Basic.GetEmpty, so this level of manual control is required. Used to send a Basic.Publish method. Called by the public publish method after potential null-reference issues have been rectified. Used to send a Channel.Close. Called during session shutdown. Used to send a Channel.CloseOk. Called during session shutdown. Used to send a Channel.FlowOk. Confirms that Channel.Flow from the broker was processed. Used to send a Channel.Open. Called during session initialisation. Used to send a Confirm.Select method. The public confirm API calls this while also managing internal datastructures. Used to send a Connection.Close. Called during connection shutdown. Used to send a Connection.CloseOk. Called during connection shutdown. Used to send a Connection.Open. Called during connection startup. Used to send a Connection.SecureOk. Again, this is special, like Basic.Get. Used to send a Connection.StartOk. This is special, like Basic.Get. Used to send a Exchange.Bind method. Called by the public bind method. Used to send a Exchange.Declare method. Called by the public declare method. Used to send a Exchange.Delete method. Called by the public delete method. Used to send a Exchange.Unbind method. Called by the public unbind method. Used to send a Queue.Bind method. Called by the public bind method. Used to send a Queue.Declare method. Called by the public declare method. Used to send a Queue.Delete method. Called by the public delete method. Used to send a Queue.Purge method. Called by the public purge method. A marker interface for entities that are recoverable (currently connection or channel). Only used to kick-start a connection open sequence. See Broadcasts notification of the final shutdown of the model. Do not call anywhere other than at the end of OnSessionShutdown. Must not be called when m_closeReason == null, because otherwise there's a window when a new continuation could be being enqueued at the same time as we're broadcasting the shutdown event. See the definition of Enqueue() above. Handle incoming Connection.Tune methods. Represents a TCP-addressable AMQP peer: a host name and port number. Some of the constructors take, as a convenience, a System.Uri instance representing an AMQP server address. The use of Uri here is not standardised - Uri is simply a convenient container for internet-address-like components. In particular, the Uri "Scheme" property is ignored: only the "Host" and "Port" properties are extracted. Default Amqp ssl port. Indicates that the default port for the protocol should be used. Creates a new instance of the . Hostname. Port number. If the port number is -1, the default port number will be used. Ssl option. Creates a new instance of the . Hostname. Port number. If the port number is -1, the default port number will be used. Construct an AmqpTcpEndpoint with "localhost" as the hostname, and using the default port. Creates a new instance of the with the given Uri and ssl options. Please see the class overview documentation for information about the Uri format in use. Creates a new instance of the with the given Uri. Please see the class overview documentation for information about the Uri format in use. Clones the endpoint. A copy with the same hostname, port, and TLS settings Clones the endpoint using the provided hostname. Hostname to use A copy with the provided hostname and port/TLS settings of this endpoint Construct an instance from a protocol and an address in "hostname:port" format. If the address string passed in contains ":", it is split into a hostname and a port-number part. Otherwise, the entire string is used as the hostname, and the port-number is set to -1 (meaning the default number for the protocol variant specified). Hostnames provided as IPv6 must appear in square brackets ([]). Splits the passed-in string on ",", and passes the substrings to . Accepts a string of the form "hostname:port, hostname:port, ...", where the ":port" pieces are optional, and returns a corresponding array of s. Compares this instance by value (protocol, hostname, port) against another instance. Implementation of hash code depending on protocol, hostname and port, to line up with the implementation of . Returns a URI-like string of the form amqp-PROTOCOL://HOSTNAME:PORTNUMBER. This method is intended mainly for debugging and logging use. Retrieve or set the hostname of this . Retrieve or set the port number of this AmqpTcpEndpoint. A port number of -1 causes the default port number. Retrieve IProtocol of this . Retrieve the SSL options for this AmqpTcpEndpoint. If not set, null is returned. Structure holding an AMQP timestamp, a posix 64-bit time_t. When converting between an AmqpTimestamp and a System.DateTime, be aware of the effect of your local timezone. In particular, different versions of the .NET framework assume different defaults. We have chosen a signed 64-bit time_t here, since the AMQP specification through versions 0-9 is silent on whether timestamps are signed or unsigned. Construct an . Unix time. Provides a debugger-friendly display. Unix time. Represents a version of the AMQP specification. Vendor-specific variants of particular official specification versions exist: this class simply represents the AMQP specification version, and does not try to represent information about any custom variations involved. AMQP version 0-8 peers sometimes advertise themselves as version 8-0: for this reason, this class's constructor special-cases 8-0, rewriting it at construction time to be 0-8 instead. Construct an from major and minor version numbers. Converts major=8 and minor=0 into major=0 and minor=8. Please see the class comment. Implement value-equality comparison. Implement hashing as for value-equality. Format appropriately for display. The specification currently uses "MAJOR-MINOR" as a display format. The AMQP specification major version number. The AMQP specification minor version number. A pluggable authentication mechanism. Handle one round of challenge-response. Return a new authentication mechanism implementation. The name of the authentication mechanism, as negotiated on the wire. Represents Basic.GetOk responses from the server. Basic.Get either returns an instance of this class, or null if a Basic.GetEmpty was received. Sets the new instance's properties from the arguments passed in. Delivery tag for the message. Redelivered flag for the message The exchange this message was published to. Routing key with which the message was published. The number of messages pending on the queue, excluding the message being delivered. The Basic-class content header properties for the message. Retrieves the Basic-class content header properties for this message. Retrieves the body of this message. Retrieve the delivery tag for this message. See also . Retrieve the exchange this message was published to. Retrieve the number of messages pending on the queue, excluding the message being delivered. Note that this figure is indicative, not reliable, and can change arbitrarily as messages are added to the queue and removed by other clients. Retrieve the redelivered flag for this message. Retrieve the routing key with which this message was published. Wrapper for a byte[]. May appear as values read from and written to AMQP field tables. The sole reason for the existence of this class is to permit encoding of byte[] as 'x' in AMQP field tables, an extension to the specification that is part of the tentative JMS mapping implemented by QPid. Instances of this object may be found as values held in IDictionary instances returned from RabbitMQ.Client.Impl.WireFormatting.ReadTable, e.g. as part of IBasicProperties.Headers tables. Likewise, instances may be set as values in an IDictionary table to be encoded by RabbitMQ.Client.Impl.WireFormatting.WriteTable. When an instance of this class is encoded/decoded, the type tag 'x' is used in the on-the-wire representation. The AMQP standard type tag 'S' is decoded to a raw byte[], and a raw byte[] is encoded as 'S'. Instances of System.String are converted to a UTF-8 binary representation, and then encoded using tag 'S'. In order to force the use of tag 'x', instances of this class must be used. Creates a new instance of the with null for its Bytes property. Creates a new instance of the . The wrapped byte array, as decoded or as to be encoded. The wrapped byte array, as decoded or as to be encoded. Main entry point to the RabbitMQ .NET AMQP client API. Constructs instances. A simple example of connecting to a broker: IConnectionFactory factory = new ConnectionFactory(); // // The next six lines are optional: factory.UserName = ConnectionFactory.DefaultUser; factory.Password = ConnectionFactory.DefaultPass; factory.VirtualHost = ConnectionFactory.DefaultVHost; factory.HostName = hostName; factory.Port = AmqpTcpEndpoint.UseDefaultPort; // IConnection conn = factory.CreateConnection(); // IModel ch = conn.CreateModel(); // // ... use ch's IModel methods ... // ch.Close(Constants.ReplySuccess, "Closing the channel"); conn.Close(Constants.ReplySuccess, "Closing the connection"); The same example, written more compactly with AMQP URIs: ConnectionFactory factory = new ConnectionFactory(); factory.Uri = "amqp://localhost"; IConnection conn = factory.CreateConnection(); ... Please see also the API overview and tutorial in the User Guide. Note that the Uri property takes a string representation of an AMQP URI. Omitted URI parts will take default values. The host part of the URI cannot be omitted and URIs of the form "amqp://foo/" (note the trailling slash) also represent the default virtual host. The latter issue means that virtual hosts with an empty name are not addressable. Set custom socket options by providing a SocketFactory. Creates a new instance of the . Specifies the addressing scheme. New instance of a . Given a list of mechanism names supported by the server, select a preferred mechanism, or null if we have none in common. Create a connection to the specified endpoint. Create a connection to the specified endpoint. /// Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable. Connects to the first reachable hostname from the list. List of host names to use Connects to the first reachable hostname from the list. List of host names to use Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable. Dictionary of client properties to be sent to the server. Password to use when authenticating to the server. Maximum channel number to ask for. Frame-max parameter to ask for (in bytes). Heartbeat setting to request (in seconds). When set to true, background threads will be used for I/O and heartbeats. Username to use when authenticating to the server. Virtual host to access during this connection. Advanced option. What task scheduler should consumer dispatcher use. Amount of time protocol handshake operations are allowed to take before timing out. Amount of time protocol operations (e.g. queue.declare) are allowed to take before timing out. Default value for the desired maximum channel number, with zero meaning unlimited (value: 0). PLEASE KEEP THIS MATCHING THE DOC ABOVE. Default value for connection attempt timeout, in milliseconds. Default value for the desired maximum frame size, with zero meaning unlimited (value: 0). PLEASE KEEP THIS MATCHING THE DOC ABOVE. Default value for desired heartbeat interval, in seconds, with zero meaning none (value: 60). PLEASE KEEP THIS MATCHING THE DOC ABOVE. Default password (value: "guest"). PLEASE KEEP THIS MATCHING THE DOC ABOVE. Default user name (value: "guest"). PLEASE KEEP THIS MATCHING THE DOC ABOVE. Default virtual host (value: "/"). PLEASE KEEP THIS MATCHING THE DOC ABOVE. Default SASL auth mechanisms to use. SASL auth mechanisms to use. Set to true to enable automatic connection recovery. Used to select next hostname to try when performing connection recovery (re-connecting). Is not used for non-recovering connections. The host to connect to. Amount of time client will wait for before re-trying to recover connection. The port to connect on. indicates the default for the protocol should be used. Protocol used, only AMQP 0-9-1 is supported in modern versions. Timeout setting for connection attempts (in milliseconds). Timeout setting for socket read operations (in milliseconds). Timeout setting for socket write operations (in milliseconds). Ssl options setting. Set to true to make automatic connection recovery also recover topology (exchanges, queues, bindings, etc). Construct a fresh instance, with all fields set to their respective defaults. Given a list of mechanism names supported by the server, select a preferred mechanism, or null if we have none in common. Create a connection to the specified endpoint. When the configured hostname was not reachable. Create a connection to the specified endpoint. Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable. When the configured hostname was not reachable. Create a connection using a list of hostnames. The first reachable hostname will be used initially. Subsequent hostname picks are determined by the configured. List of hostnames to use for the initial connection and recovery. Open connection When no hostname was reachable. Create a connection using a list of hostnames. The first reachable hostname will be used initially. Subsequent hostname picks are determined by the configured. List of hostnames to use for the initial connection and recovery. Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable. Open connection When no hostname was reachable. Create a connection using a list of hostnames. The first reachable hostname will be used initially. Subsequent hostname picks are determined by the configured. List of endpoints to use for the initial connection and recovery. Open connection When no hostname was reachable. Create a connection using a list of hostnames. The first reachable hostname will be used initially. Subsequent hostname picks are determined by the configured. List of endpoints to use for the initial connection and recovery. Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable. Open connection When no hostname was reachable. Unescape a string, protecting '+'. Amount of time protocol handshake operations are allowed to take before timing out. Amount of time protocol operations (e.g. queue.declare) are allowed to take before timing out. Task scheduler connections created by this factory will use when dispatching consumer operations, such as message deliveries. Connection endpoint. Set connection parameters using the amqp or amqps scheme. Set connection parameters using the amqp or amqps scheme. Dictionary of client properties to be sent to the server. Password to use when authenticating to the server. Maximum channel number to ask for. Frame-max parameter to ask for (in bytes). Heartbeat timeout to use when negotiating with the server (in seconds). When set to true, background thread will be used for the I/O loop. Username to use when authenticating to the server. Virtual host to access during this connection. Useful default/base implementation of . Subclass and override in application code. Note that the "Handle*" methods run in the connection's thread! Consider using , which exposes events that can be subscribed to consumer messages. Consumer interface. Used to receive messages from a queue by subscription. See IModel.BasicConsume, IModel.BasicCancel. Note that the "Handle*" methods run in the connection's thread! Consider using QueueingBasicConsumer, which uses a SharedQueue instance to safely pass received messages across to user threads. Called when the consumer is cancelled for reasons other than by a basicCancel: e.g. the queue has been deleted (either by this channel or by any other channel). See for notification of consumer cancellation due to basicCancel Consumer tag this consumer is registered. Called upon successful deregistration of the consumer from the broker. Consumer tag this consumer is registered. Called upon successful registration of the consumer with the broker. Consumer tag this consumer is registered. Called each time a message arrives for this consumer. Does nothing with the passed in information. Note that in particular, some delivered messages may require acknowledgement via . The implementation of this method in this class does NOT acknowledge such messages. Called when the model shuts down. Common AMQP model. Information about the reason why a particular model, session, or connection was destroyed. Retrieve the this consumer is associated with, for use in acknowledging received messages, for instance. Signalled when the consumer gets cancelled. Creates a new instance of an . Constructor which sets the Model property to the given value. Common AMQP model. Called when the consumer is cancelled for reasons other than by a basicCancel: e.g. the queue has been deleted (either by this channel or by any other channel). See for notification of consumer cancellation due to basicCancel Consumer tag this consumer is registered. Called upon successful deregistration of the consumer from the broker. Consumer tag this consumer is registered. Called upon successful registration of the consumer with the broker. Consumer tag this consumer is registered. Called each time a message arrives for this consumer. Does nothing with the passed in information. Note that in particular, some delivered messages may require acknowledgement via . The implementation of this method in this class does NOT acknowledge such messages. Called when the model shuts down. Common AMQP model. Information about the reason why a particular model, session, or connection was destroyed. Default implementation - overridable in subclasses. This default implementation simply sets the property to false, and takes no further action. Retrieve the consumer tag this consumer is registered as; to be used when discussing this consumer with the server, for instance with . Returns true while the consumer is registered and expecting deliveries from the broker. If our shuts down, this property will contain a description of the reason for the shutdown. Otherwise it will contain null. See . Signalled when the consumer gets cancelled. Retrieve the this consumer is associated with, for use in acknowledging received messages, for instance. Convenience class providing compile-time names for standard headers. Use the static members of this class as headers for the arguments for Queue and Exchange declaration or Consumer creation. The broker may be extended with additional headers that do not appear in this class. x-max-priority header x-max-length header x-max-length-bytes header x-dead-letter-exchange header x-dead-letter-routing-key header x-message-ttl header x-expires header alternate-exchange header x-priority header Convenience class providing compile-time names for standard exchange types. Use the static members of this class as values for the "exchangeType" arguments for IModel methods such as ExchangeDeclare. The broker may be extended with additional exchange types that do not appear in this class. Exchange type used for AMQP direct exchanges. Exchange type used for AMQP fanout exchanges. Exchange type used for AMQP headers exchanges. Exchange type used for AMQP topic exchanges. Retrieve a collection containing all standard exchange types. Handle one round of challenge-response. Return a new authentication mechanism implementation. The name of the authentication mechanism, as negotiated on the wire. Main interface to an AMQP connection. Instances of are used to create fresh sessions/channels. The class is used to construct instances. Please see the documentation for ConnectionFactory for an example of usage. Alternatively, an API tutorial can be found in the User Guide. Extends the interface, so that the "using" statement can be used to scope the lifetime of a channel when appropriate. Common interface for network (TCP/IP) connection classes. Local port. Remote port. Abort this connection and all its channels. Note that all active channels, sessions, and models will be closed if this method is called. In comparison to normal method, will not throw or during closing connection. This method waits infinitely for the in-progress close operation to complete. Abort this connection and all its channels. The method behaves in the same way as , with the only difference that the connection is closed with the given connection close code and message. The close code (See under "Reply Codes" in the AMQP specification) A message indicating the reason for closing the connection Abort this connection and all its channels and wait with a timeout for all the in-progress close operations to complete. This method, behaves in a similar way as method with the only difference that it explictly specifies the timeout given for all the in-progress close operations to complete. If timeout is reached and the close operations haven't finished, then socket is forced to close. To wait infinitely for the close operations to complete use . Abort this connection and all its channels and wait with a timeout for all the in-progress close operations to complete. The method behaves in the same way as , with the only difference that the connection is closed with the given connection close code and message. The close code (See under "Reply Codes" in the AMQP specification). A message indicating the reason for closing the connection. Close this connection and all its channels. Note that all active channels, sessions, and models will be closed if this method is called. It will wait for the in-progress close operation to complete. This method will not return to the caller until the shutdown is complete. If the connection is already closed (or closing), then this method will throw . It can also throw when socket was closed unexpectedly. Close this connection and all its channels. The method behaves in the same way as , with the only difference that the connection is closed with the given connection close code and message. The close code (See under "Reply Codes" in the AMQP specification). A message indicating the reason for closing the connection. Close this connection and all its channels and wait with a timeout for all the in-progress close operations to complete. Note that all active channels, sessions, and models will be closed if this method is called. It will wait for the in-progress close operation to complete with a timeout. If the connection is already closed (or closing), then this method will throw . It can also throw when socket was closed unexpectedly. If timeout is reached and the close operations haven't finished, then socket is forced to close. To wait infinitely for the close operations to complete use . Close this connection and all its channels and wait with a timeout for all the in-progress close operations to complete. The method behaves in the same way as , with the only difference that the connection is closed with the given connection close code and message. The close code (See under "Reply Codes" in the AMQP specification). A message indicating the reason for closing the connection. Create and return a fresh channel, session, and model. Handle incoming Connection.Blocked methods. Handle incoming Connection.Unblocked methods. If true, will close the whole connection as soon as there are no channels open on it; if false, manual connection closure will be required. DON'T set AutoClose to true before opening the first channel, because the connection will be immediately closed if you do! The maximum channel number this connection supports (0 if unlimited). Usable channel numbers range from 1 to this number, inclusive. A copy of the client properties that has been sent to the server. Returns null if the connection is still in a state where it can be used, or the cause of its closure otherwise. Applications should use the ConnectionShutdown event to avoid race conditions. The scenario to avoid is checking , seeing it is null (meaning the was available for use at the time of the check), and interpreting this mistakenly as a guarantee that the will remain usable for a time. Instead, the operation of interest should simply be attempted: if the is not in a usable state, an exception will be thrown (most likely , but may vary depending on the particular operation being attempted). Retrieve the endpoint this connection is connected to. The maximum frame size this connection supports (0 if unlimited). The current heartbeat setting for this connection (0 for disabled), in seconds. Returns true if the connection is still in a state where it can be used. Identical to checking if equal null. Returns the known hosts that came back from the broker in the connection.open-ok method at connection startup time. Null until the connection is completely open and ready for use. The this connection is using to communicate with its peer. A dictionary of the server properties sent by the server while establishing the connection. This typically includes the product name and version of the server. Returns the list of objects that contain information about any errors reported while closing the connection in the order they appeared Application-specific connection name, will be displayed in the management UI if RabbitMQ server supports it. This value doesn't have to be unique and cannot be used as a connection identifier, e.g. in HTTP API requests. This value is supposed to be human-readable. Signalled when an exception occurs in a callback invoked by the connection. This event is signalled when a ConnectionShutdown handler throws an exception. If, in future, more events appear on , then this event will be signalled whenever one of those event handlers throws an exception, as well. Raised when the connection is destroyed. If the connection is already destroyed at the time an event handler is added to this event, the event handler will be fired immediately. Picks a hostname from a list of options that should be used by . Common AMQP Stream content-class headers interface, spanning the union of the functionality offered by versions 0-8, 0-8qpid, 0-9 and 0-9-1 of AMQP. The specification code generator provides protocol-version-specific implementations of this interface. To obtain an implementation of this interface in a protocol-version-neutral way, use IModel.CreateStreamProperties(). Each property is readable, writable and clearable: a cleared property will not be transmitted over the wire. Properties on a fresh instance are clear by default. Clear the property. Clear the property. Clear the property. Clear the property. Clear the property. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. Returns true if the property is present. MIME content encoding. MIME content type. Message header field table. Message priority, 0 to 9. Message timestamp. Wrapper interface for standard TCP-client. Provides socket for socket frame handler class. Contains all methods that are currenty in use in rabbitmq client. Return a new authentication mechanism implementation. The name of the authentication mechanism, as negotiated on the wire. Provides access to the supported implementations. Protocol version 0-9-1 as modified by Pivotal. Retrieve the current default protocol variant (currently AMQP_0_9_1). Container for an exchange name, exchange type and routing key, usable as the target address of a message to be published. The syntax used for the external representation of instances of this class is compatible with QPid's "Reply-To" field pseudo-URI format. The pseudo-URI format is (exchange-type)://(exchange-name)/(routing-key), where exchange-type is one of the permitted exchange type names (see class ExchangeType), exchange-name must be present but may be empty, and routing-key must be present but may be empty. The syntax is as it is solely for compatibility with QPid's existing usage of the ReplyTo field; the AMQP specifications 0-8 and 0-9 do not define the format of the field, and do not define any format for the triple (exchange name, exchange type, routing key) that could be used instead. Please see also the way class RabbitMQ.Client.MessagePatterns.SimpleRpcServer uses the ReplyTo field. Regular expression used to extract the exchange-type, exchange-name and routing-key from a string. Creates a new instance of the . Exchange type. Exchange name. Routing key. Parse a out of the given string, using the regex. Reconstruct the "uri" from its constituents. Retrieve the exchange name. Retrieve the exchange type string. Retrieve the routing key. Represents Queue info. Creates a new instance of the . Queue name. Message count. Consumer count. Consumer count. Message count. Queue name. A implementation that uses a to buffer incoming deliveries. Received messages are placed in the SharedQueue as instances of . Note that messages taken from the SharedQueue may need acknowledging with . When the consumer is closed, through BasicCancel or through the shutdown of the underlying or , the method is called, which causes any Enqueue() operations, and Dequeue() operations when the queue is empty, to throw EndOfStreamException (see the comment for ). The following is a simple example of the usage of this class: IModel channel = ...; QueueingBasicConsumer consumer = new QueueingBasicConsumer(channel); channel.BasicConsume(queueName, null, consumer); // At this point, messages will be being asynchronously delivered, // and will be queueing up in consumer.Queue. while (true) { try { BasicDeliverEventArgs e = (BasicDeliverEventArgs) consumer.Queue.Dequeue(); // ... handle the delivery ... channel.BasicAck(e.DeliveryTag, false); } catch (EndOfStreamException ex) { // The consumer was cancelled, the model closed, or the // connection went away. break; } } Creates a fresh , initialising the property to null and the property to a fresh . Creates a fresh , with set to the argument, and set to a fresh . Creates a fresh , initialising the and properties to the given values. Overrides 's implementation, building a instance and placing it in the Queue. Overrides 's OnCancel implementation, extending it to call the Close() method of the . Retrieves the that messages arrive on. Information about the reason why a particular model, session, or connection was destroyed. The and properties should be used to determine the originator of the shutdown event. Construct a with the given parameters and 0 for and . Construct a with the given parameters. Override ToString to be useful for debugging. Object causing the shutdown, or null if none. AMQP content-class ID, or 0 if none. Returns the source of the shutdown event: either the application, the library, or the remote peer. AMQP method ID within a content-class, or 0 if none. One of the standardised AMQP reason codes. See RabbitMQ.Client.Framing.*.Constants. Informative human-readable reason text. Describes the source of a shutdown event. The shutdown event originated from the application using the RabbitMQ .NET client library. The shutdown event originated from the RabbitMQ .NET client library itself. Shutdowns with this ShutdownInitiator code may appear if, for example, an internal error is detected by the client, or if the server sends a syntactically invalid frame. Another potential use is on IConnection AutoClose. The shutdown event originated from the remote AMQP peer. A valid received connection.close or channel.close event will manifest as a shutdown with this ShutdownInitiator. Single entry object in the shutdown report that encapsulates description of the error which occured during shutdown. Description provided in the error. object that occured during shutdown, or null if unspecified. Represents an which does the actual heavy lifting to set up an SSL connection, using the config options in an to make things cleaner. Upgrade a Tcp stream to an Ssl stream using the SSL options provided. Represents a configurable SSL option, used in setting up an SSL connection. Constructs an SslOption specifying both the server cannonical name and the client's certificate path. Constructs an with no parameters set. Retrieve or set the set of ssl policy errors that are deemed acceptable. Retrieve or set the path to client certificate. Retrieve or set the path to client certificate. An optional client specified SSL certificate selection callback. If this is not specified, the first valid certificate found will be used. An optional client specified SSL certificate validation callback. If this is not specified, the default callback will be used in conjunction with the property to determine if the remote server certificate is valid. Retrieve or set the X509CertificateCollection containing the client certificate. If no collection is set, the client will attempt to load one from the specified . Flag specifying if Ssl should indeed be used. Retrieve or set server's Canonical Name. This MUST match the CN on the Certificate else the SSL connection will fail. Retrieve or set the Ssl protocol version. Framework for constructing various types of AMQP. Basic-class application messages. Interface for constructing application messages. Subinterfaces provide specialized data-writing methods. This base interface deals with the lowest common denominator: bytes, with no special encodings for higher-level objects. Finish and retrieve the content body for transmission. Finish and retrieve the content header for transmission. Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant. Write a single byte into the message body, without encoding or interpretation. Write a byte array into the message body, without encoding or interpretation. Write a section of a byte array into the message body, without encoding or interpretation. Retrieve the being used to construct the message body. Retrieves the dictionary that will be used to construct the message header table. It is of type . By default, new instances of BasicMessageBuilder and its subclasses will have this much initial buffer space. Construct an instance ready for writing. The is used for the initial accumulator buffer size. Construct an instance ready for writing. Finish and retrieve the content body for transmission. Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant. Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant. Write a single byte into the message body, without encoding or interpretation. Write a byte array into the message body, without encoding or interpretation. Write a section of a byte array into the message body, without encoding or interpretation. Retrieve the associated with this instance. Retrieve this instance's writing to BodyStream. If no instance exists, one is created, pointing at the beginning of the accumulator. If one already exists, the existing instance is returned. The instance is not reset. Retrieve the being used to construct the message body. Retrieves the dictionary that will be used to construct the message header table. It is of type . Framework for analyzing various types of AMQP Basic-class application messages. Interface for analyzing application messages. Subinterfaces provide specialized data-reading methods. This base interface deals with the lowest common denominator: bytes, with no special encodings for higher-level objects. Read a single byte from the body stream, without encoding or interpretation. Returns -1 for end-of-stream. Read bytes from the body stream into a section of an existing byte array, without encoding or interpretation. Returns the number of bytes read from the body and written into the target array, which may be less than the number requested if the end-of-stream is reached. Retrieve the message body, as a byte array. Retrieve the being used to read from the message body. Retrieves the content header properties of the message being read. Is of type . Construct an instance ready for reading. Read a single byte from the body stream, without encoding or interpretation. Returns -1 for end-of-stream. Read bytes from the body stream into a section of an existing byte array, without encoding or interpretation. Returns the number of bytes read from the body and written into the target array, which may be less than the number requested if the end-of-stream is reached. Retrieve the associated with this instance. Retrieve this instance's NetworkBinaryReader reading from . If no NetworkBinaryReader instance exists, one is created, pointing at the beginning of the body. If one already exists, the existing instance is returned. The instance is not reset. Retrieve the message body, as a byte array. Retrieve the being used to read from the message body. Retrieves the content header properties of the message being read. Is of type . Constructs AMQP Basic-class messages binary-compatible with QPid's "BytesMessage" wire encoding. Interface for constructing messages binary-compatible with QPid's "BytesMessage" wire encoding. Write a section of a byte array into the message body being assembled. Writes a value into the message body being assembled. Write a array into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes an value into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. MIME type associated with QPid BytesMessages. Construct an instance for writing. See . Construct an instance for writing. See . Write a section of a byte array into the message body being assembled. Writes a value into the message body being assembled. Write a array into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes an value into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant. Analyzes AMQP Basic-class messages binary-compatible with QPid's "BytesMessage" wire encoding. Analyzes messages binary-compatible with QPid's "BytesMessage" wire encoding. Reads a given number ("count") of bytes from the message body, placing them into "target", starting at "offset". Reads a from the message body. Reads a given number of bytes from the message body. Reads a from the message body. Reads a from the message body. Reads a from the message body. Reads an from the message body. Reads a from the message body. Reads a from the message body. Reads a from the message body. MIME type associated with QPid BytesMessages. Construct an instance for reading. See . Reads a given number ("count") of bytes from the message body, placing them into "target", starting at "offset". Reads a from the message body. Reads a given number of bytes from the message body. Reads a from the message body. Reads a from the message body. Reads a from the message body. Reads an from the message body. Reads a from the message body. Reads a from the message body. Reads a from the message body. Internal support class for use in reading and writing information binary-compatible with QPid's "BytesMessage" wire encoding. Interface for constructing messages binary-compatible with QPid's "MapMessage" wire encoding. Retrieves the dictionary that will be written into the body of the message. Analyzes messages binary-compatible with QPid's "MapMessage" wire encoding. Parses the message body into an instance. Interface for constructing messages binary-compatible with QPid's "StreamMessage" wire encoding. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes a section of a byte array into the message body being assembled. Writes a array into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes an value into the message body being assembled. Writes a value into the message body being assembled. Writes an value into the message body being assembled. The only permitted types are bool, int, short, byte, char, long, float, double, byte[] and string. Writes objects using WriteObject(), one after the other. No length indicator is written. See also . Writes a value into the message body being assembled. Writes a string value into the message body being assembled. Analyzes messages binary-compatible with QPid's "StreamMessage" wire encoding. Reads a from the message body. Reads a from the message body. Reads a array from the message body. The body contains information about the size of the array to read. Reads a from the message body. Reads a from the message body. Reads a from the message body. Reads an from the message body. Reads a from the message body. Reads an from the message body. Reads array from the message body until the end-of-stream is reached. Reads a from the message body. Reads a from the message body. Constructs AMQP Basic-class messages binary-compatible with QPid's "MapMessage" wire encoding. MIME type associated with QPid MapMessages. Construct an instance for writing. See . Construct an instance for writing. See . Finish and retrieve the content body for transmission. Calling this message clears Body to null. Subsequent calls will fault. Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant. Retrieves the dictionary that will be written into the body of the message. Analyzes AMQP Basic-class messages binary-compatible with QPid's "MapMessage" wire encoding. MIME type associated with QPid MapMessages. Construct an instance for reading. See . Parses the message body into an instance. . Internal support class for use in reading and writing information binary-compatible with QPid's "MapMessage" wire encoding. Utility class for extracting typed values from strings. Creates the protocol violation exception. Type of the target. The source. Instance of the . Attempt to parse a string representation of a . Attempt to parse a string representation of a . Attempt to parse a string representation of a . Attempt to parse a string representation of a . Attempt to parse a string representation of an . Attempt to parse a string representation of a . Attempt to parse a string representation of a . Constructs AMQP Basic-class messages binary-compatible with QPid's "StreamMessage" wire encoding. MIME type associated with QPid StreamMessages. Construct an instance for writing. See . Construct an instance for writing. See . Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes a section of a byte array into the message body being assembled. Writes a array into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes a value into the message body being assembled. Writes an value into the message body being assembled. Writes a value into the message body being assembled. Writes an value into the message body being assembled. The only permitted types are bool, int, short, byte, char, long, float, double, byte[] and string. Writes objects using WriteObject(), one after the other. No length indicator is written. See also . Writes a value into the message body being assembled. Writes a string value into the message body being assembled. Analyzes AMQP Basic-class messages binary-compatible with QPid's "StreamMessage" wire encoding. MIME type associated with QPid StreamMessages. Construct an instance for reading. See . Reads a from the message body. Reads a from the message body. Reads a array from the message body. The body contains information about the size of the array to read. Reads a from the message body. Reads a from the message body. Reads a from the message body. Reads an from the message body. Reads a from the message body. Reads an from the message body. Reads array from the message body until the end-of-stream is reached. Reads a from the message body. Reads a from the message body. Tags used in parsing and generating StreamWireFormatting message bodies. Internal support class for use in reading and writing information binary-compatible with QPid's "StreamMessage" wire encoding. Contains all the information about a message acknowledged from an AMQP broker within the Basic content-class. The sequence number of the acknowledged message, or the closed upper bound of acknowledged messages if multiple is true. Whether this acknoledgement applies to one message or multiple messages. Contains all the information about a message delivered from an AMQP broker within the Basic content-class. Default constructor. Constructor that fills the event's properties from its arguments. The content header of the message. The message body. The consumer tag of the consumer that the message was delivered to. The delivery tag for this delivery. See IModel.BasicAck. The exchange the message was originally published to. The AMQP "redelivered" flag. The routing key used when the message was originally published. Contains all the information about a message nack'd from an AMQP broker within the Basic content-class. The sequence number of the nack'd message, or the closed upper bound of nack'd messages if multiple is true. Whether this nack applies to one message or multiple messages. Ignore Clients should ignore this field. Contains all the information about a message returned from an AMQP broker within the Basic content-class. The content header of the message. The message body. The exchange the returned message was originally published to. The AMQP reason code for the return. See RabbitMQ.Client.Framing.*.Constants. Human-readable text from the broker describing the reason for the return. The routing key used when the message was originally published. Wrap an exception thrown by a callback. Access helpful information about the context in which the wrapped exception was thrown. Access the wrapped exception. Describes an exception that was thrown during the library's invocation of an application-supplied callback handler. When an exception is thrown from a callback registered with part of the RabbitMQ .NET client library, it is caught, packaged into a CallbackExceptionEventArgs, and passed through the appropriate IModel's or IConnection's CallbackException event handlers. If an exception is thrown in a CallbackException handler, it is silently swallowed, as CallbackException is the last chance to handle these kinds of exception. Code constructing CallbackExceptionEventArgs instances will usually place helpful information about the context of the call in the IDictionary available through the Detail property. Event relating to connection being blocked. Access the reason why connection is blocked. Event relating to a successful consumer registration or cancellation. Construct an event containing the consumer-tag of the consumer the event relates to. Access the consumer-tag of the consumer the event relates to. Initializes a new instance of the class. The tag before. The tag after. Gets the tag before. Gets the tag after. Experimental class exposing an IBasicConsumer's methods as separate events. Constructor which sets the Model property to the given value. Fires the Unregistered event. Fires the Registered event. Fires the Received event. Fires the Shutdown event. Event fired on HandleBasicDeliver. Event fired on HandleBasicConsumeOk. Event fired on HandleModelShutdown. Event fired on HandleBasicCancelOk. Event relating to flow control. Access the flow control setting. Initializes a new instance of the class. The name before. The name after. Gets the name before. Gets the name after. Describes an exception that was thrown during automatic connection recovery performed by the library. Thrown when the application tries to make use of a session or connection that has already been shut down. Thrown when a session is destroyed during an RPC call to a broker. For example, if a TCP connection dropping causes the destruction of a session in the middle of a QueueDeclare operation, an OperationInterruptedException will be thrown to the caller of IModel.QueueDeclare. Construct an OperationInterruptedException with the passed-in explanation, if any. Construct an OperationInterruptedException with the passed-in explanation and prefix, if any. Retrieves the explanation for the shutdown. May return null if no explanation is available. Construct an instance containing the given shutdown reason. Thrown when the cause is an authentication failure. Thrown when the likely cause is an authentication failure. Thrown when no connection could be opened during a ConnectionFactory.CreateConnection attempt. Construct a BrokerUnreachableException. The inner exception is associated with only one connection attempt. Thrown when a SessionManager cannot allocate a new channel number, or the requested channel number is already in use. Indicates that there are no more free channels. Indicates that the specified channel is in use The requested channel number Retrieves the channel number concerned; will return -1 in the case where "no more free channels" is being signalled, or a non-negative integer when "channel is in use" is being signalled. Thrown when a connection to the broker fails Thrown to indicate that the peer didn't understand the packet received from the client. Peer sent default message describing protocol version it is using and transport parameters. The peer's {'A','M','Q','P',txHi,txLo,major,minor} packet is decoded into instances of this class. Fills the new instance's properties with the values passed in. The peer's AMQP specification major version. The peer's AMQP specification minor version. The peer's high transport byte. The peer's low transport byte. Thrown to indicate that the peer does not support the wire protocol version we requested immediately after opening the TCP socket. Fills the new instance's properties with the values passed in. The client's AMQP specification major version. The client's AMQP specification minor version. The peer's AMQP specification major version. The peer's AMQP specification minor version. Thrown when the model receives an RPC reply that it wasn't expecting. The unexpected reply method. Thrown when the model receives an RPC request it cannot satisfy. The name of the RPC request that could not be sent. Thrown when the model cannot transmit a method field because the version of the protocol the model is implementing does not contain a definition for the field in question. The name of the unsupported field. The name of the method involved. Thrown when the wire-formatting code cannot encode a particular .NET value to AMQP protocol format. Construct a WireFormattingException with no particular offender (i.e. null) Construct a WireFormattingException with the given offender Object which this exception is complaining about; may be null if no particular offender exists API-side invocation of connection abort. API-side invocation of connection abort. API-side invocation of connection abort with timeout. API-side invocation of connection abort with timeout. API-side invocation of connection.close. API-side invocation of connection.close. API-side invocation of connection.close with timeout. API-side invocation of connection.close with timeout. Thrown when the server sends a frame along a channel that we do not currently have a Session entry in our SessionManager for. Subclass of ProtocolException representing problems requiring a connection.close. Instances of subclasses of subclasses HardProtocolException and SoftProtocolException are thrown in situations when we detect a problem with the connection-, channel- or wire-level parts of the AMQP protocol. Retrieve the reply code to use in a connection/channel close method. Retrieve the shutdown details to use in a connection/channel close method. Defaults to using ShutdownInitiator.Library, and this.ReplyCode and this.Message as the reply code and text, respectively. The channel number concerned. Heartbeat frame for transmission. Reusable across connections. Try to close connection in a graceful way Shutdown reason contains code and text assigned when closing the connection, as well as the information about what initiated the close Abort flag, if true, signals to close the ongoing connection immediately and do not report any errors if it was already closed. Timeout determines how much time internal close operations should be given to complete. Negative or Timeout.Infinite value mean infinity. Loop only used while quiescing. Use only to cleanly close connection We need to close the socket, otherwise attempting to unload the domain could cause a CannotUnloadAppDomainException Broadcasts notification of the final shutdown of the connection. Sets the channel named in the SoftProtocolException into "quiescing mode", where we issue a channel.close and ignore everything except for subsequent channel.close messages and the channel.close-ok reply that should eventually arrive. Since a well-behaved peer will not wait indefinitely before issuing the close-ok, we don't bother with a timeout here; compare this to the case of a connection.close-ok, where a timeout is necessary. We need to send the close method and politely wait for a reply before marking the channel as available for reuse. As soon as SoftProtocolException is detected, we should stop servicing ordinary application work, and should concentrate on bringing down the channel as quickly and gracefully as possible. The way this is done, as per the close-protocol, is to signal closure up the stack *before* sending the channel.close, by invoking ISession.Close. Once the upper layers have been signalled, we are free to do what we need to do to clean up and shut down the channel. May be called more than once. Should therefore be idempotent. API-side invocation of connection abort. API-side invocation of connection abort. API-side invocation of connection abort with timeout. API-side invocation of connection abort with timeout. API-side invocation of connection.close. API-side invocation of connection.close. API-side invocation of connection.close with timeout. API-side invocation of connection.close with timeout. Another overload of a Protocol property, useful for exposing a tighter type. Explicit implementation of IConnection.Protocol. A type of . Returns a random item from the list. Element item type Input list Read a frame from the underlying transport. Returns null if the read operation timed out (see Timeout property). Socket read timeout, in milliseconds. Zero signals "infinity". Socket write timeout, in milliseconds. Zero signals "infinity". Essential information from an incoming Connection.Tune method. The peer's suggested channel-max parameter. The peer's suggested frame-max parameter. The peer's suggested heartbeat parameter. Base class for attributes for controlling the API autogeneration process. The specification namespace (i.e. version) that this attribute applies to, or null for all specification versions. Causes the API generator to ignore the attributed method. Mostly used to declare convenience overloads of various AMQP methods in the IModel interface. Also used to omit an autogenerated implementation of a method which is not required for one protocol version. The API autogeneration process should of course not attempt to produce an implementation of the convenience methods, as they will be implemented by hand with sensible defaults, delegating to the autogenerated variant of the method concerned. Causes the API generator to generate asynchronous receive code for the attributed method. Causes the API generator to generate exception-throwing code for, instead of simply ignoring, the attributed method. Informs the API generator which AMQP method field to use for either a parameter in a request, or for a simple result in a reply. Informs the API generator which AMQP method to use for either a request (if applied to an IModel method) or a reply (if applied to an IModel method result). This attribute, if placed on a parameter in an IModel method, causes it to be interpreted as a "nowait" parameter for the purposes of autogenerated RPC reply continuation management and control. This attribute, if placed on a method in IModel, causes the method to be interpreted as a factory method producing a protocol-specific implementation of a common content header interface. This attribute, if placed on a parameter in a content-carrying IModel method, causes it to be sent as part of the content header frame. This attribute, if placed on a parameter in a content-carrying IModel method, causes it to be sent as part of the content body frame. This attribute, placed on an IModel method, causes what would normally be an RPC, sent with ModelRpc, to be sent as if it were oneway, with ModelSend. The assumption that this is for a custom continuation (e.g. for BasicConsume/BasicCancel etc.) Gets the channel number. Gets the close reason. Single recipient - no need for multiple handlers to be informed of arriving commands. Gets the connection. Gets a value indicating whether this session is open. Multicast session shutdown event. Small ISession implementation used only for channel 0. Normal ISession implementation used during normal channel operation. Set channel 0 as quiescing Method should be idempotent. Cannot use base.Close method call because that would prevent us from sending/receiving Close/CloseOk commands Thrown when frame parsing code detects an error in the wire-protocol encoding of a frame. For example, potential MalformedFrameException conditions include frames too short, frames missing their end marker, and invalid protocol negotiation headers. Small ISession implementation used during channel quiescing. Manages a queue of waiting AMQP RPC requests. Currently, pipelining of requests is forbidden by this implementation. The AMQP 0-8 and 0-9 specifications themselves forbid pipelining, but only by the skin of their teeth and under a somewhat generous reading. Enqueue a continuation, marking a pending RPC. Continuations are retrieved in FIFO order by calling Next(). In the current implementation, only one continuation can be queued up at once. Calls to Enqueue() when a continuation is already enqueued will result in NotSupportedException being thrown. Interrupt all waiting continuations. There's just the one potential waiter in the current implementation. Retrieve the next waiting continuation. It is an error to call this method when there are no waiting continuations. In the current implementation, if this happens, null will be returned (which will usually result in an immediate NullPointerException in the caller). Correct code will always arrange for a continuation to have been Enqueue()d before calling this method. Called from CheckAutoClose, in a separate thread, when we decide to close the connection. If m_autoClose and there are no active sessions remaining, Close()s the connection with reason code 200. Replace an active session slot with a new ISession implementation. Used during channel quiescing. Make sure you pass in a channelNumber that's currently in use, as if the slot is unused, you'll get a null pointer exception. Subclass of ProtocolException representing problems requiring a channel.close. Thrown when our peer sends a frame that contains illegal values for one or more fields. Simple wrapper around TcpClient. TCP-Client with support for http tunnel through http proxy server Constructor. Host name or IP address of the proxy server. Port number to connect to the proxy server. Username for the proxy server. Password for the proxy server. Open TCP connection through HTTP-Tunnel. Method invokes method 'createConnection' asynchronously. Destination host name or IP address. Port number to connect to on the destination host. Callback Creates a remote TCP connection through a proxy server to the destination host on the destination port. Destination host name or IP address. Port number to connect to on the destination host. AdressFamliy for tcp client. Currently ignored. Dto for all container infos Returns an open TcpClient object that can be used normally to communicate with the destination server This method creates a connection to the proxy server and instructs the proxy server to make a pass through connection to the specified destination host on the specified port. Container for proxy related information Simple container for response message Event arguments class for the EncryptAsyncCompleted event. Constructor. Exception information generated by the event. Cancelled event flag. This flag is set to true if the event was cancelled. Proxy Connection. The initialized and open TcpClient proxy connection. The proxy connection. This exception is thrown when a general, unexpected proxy error. Constructor. Constructor. Exception message text. Constructor. Exception message text. The inner exception object. Constructor. Serialization information. Stream context information. Collection of helper methods Thrown when the connection receives a frame that it wasn't expecting. Thrown when the protocol handlers detect an unknown class number or method number. The AMQP content-class ID. The AMQP method ID within the content-class, or 0 if none. Reads an AMQP "table" definition from the reader. Supports the AMQP 0-8/0-9 standard entry types S, I, D, T and F, as well as the QPid-0-8 specific b, d, f, l, s, t, x and V types and the AMQP 0-9-1 A type. A . Writes an AMQP "table" to the writer. In this method, we assume that the stream that backs our NetworkBinaryWriter is a positionable stream - which it is currently (see Frame.m_accumulator, Frame.GetWriter and Command.Transmit). Supports the AMQP 0-8/0-9 standard entry types S, I, D, T and F, as well as the QPid-0-8 specific b, d, f, l, s, t x and V types and the AMQP 0-9-1 A type. Writes an AMQP "table" to the writer. In this method, we assume that the stream that backs our NetworkBinaryWriter is a positionable stream - which it is currently (see Frame.m_accumulator, Frame.GetWriter and Command.Transmit). Supports the AMQP 0-8/0-9 standard entry types S, I, D, T and F, as well as the QPid-0-8 specific b, d, f, l, s, t x and V types and the AMQP 0-9-1 A type. Implements a simple RPC client. This class sends requests that can be processed by remote SimpleRpcServer instances. The basic pattern for accessing a remote service is to determine the exchange name and routing key needed for submissions of service requests, and to construct a SimpleRpcClient instance using that address. Once constructed, the various Call() and Cast() overloads can be used to send requests and receive the corresponding replies. string queueName = "ServiceRequestQueue"; // See also Subscription ctors using (IConnection conn = new ConnectionFactory() .CreateConnection(serverAddress)) { using (IModel ch = conn.CreateModel()) { SimpleRpcClient client = new SimpleRpcClient(ch, queueName); client.TimeoutMilliseconds = 5000; // optional /// ... make use of the various Call() overloads } } Instances of this class declare a queue, so it is the user's responsibility to ensure that the exchange concerned exists (using IModel.ExchangeDeclare) before invoking Call() or Cast(). This class implements only a few basic RPC message formats - to extend it with support for more formats, either subclass, or transcode the messages before transmission using the built-in byte[] format. Construct an instance with no configured Address. The Address property must be set before Call() or Cast() are called. Construct an instance that will deliver to the default exchange (""), with routing key equal to the passed in queueName, thereby delivering directly to a named queue on the AMQP server. Construct an instance that will deliver to the named and typed exchange, with the given routing key. Construct an instance that will deliver to the given address. Sends a "jms/stream-message"-encoded RPC request, and expects an RPC reply in the same format. The arguments passed in must be of types that are representable as JMS StreamMessage values, and so must the results returned from the service in its reply message. Calls OnTimedOut() and OnDisconnected() when a timeout or disconnection, respectively, is detected when waiting for our reply. Returns null if the request timed out or if we were disconnected before a reply arrived. The reply message, if any, is acknowledged to the AMQP server via Subscription.Ack(). Sends a simple byte[] message, without any custom headers or properties. Delegates directly to Call(IBasicProperties, byte[]), and discards the properties of the received reply, returning only the body of the reply. Calls OnTimedOut() and OnDisconnected() when a timeout or disconnection, respectively, is detected when waiting for our reply. Returns null if the request timed out or if we were disconnected before a reply arrived. The reply message, if any, is acknowledged to the AMQP server via Subscription.Ack(). Sends a byte[] message and IBasicProperties header, returning both the body and headers of the received reply. Sets the "replyProperties" outbound parameter to the properties of the received reply, and returns the byte[] body of the reply. Calls OnTimedOut() and OnDisconnected() when a timeout or disconnection, respectively, is detected when waiting for our reply. Both sets "replyProperties" to null and returns null when either the request timed out or we were disconnected before a reply arrived. The reply message, if any, is acknowledged to the AMQP server via Subscription.Ack(). Sends a byte[]/IBasicProperties RPC request, returning full information about the delivered reply as a BasicDeliverEventArgs. This is the most general/lowest-level Call()-style method on SimpleRpcClient. It sets CorrelationId and ReplyTo on the request message's headers before transmitting the request to the service via the AMQP server. If the reply's CorrelationId does not match the request's CorrelationId, ProtocolViolationException will be thrown. Calls OnTimedOut() and OnDisconnected() when a timeout or disconnection, respectively, is detected when waiting for our reply. Returns null if the request timed out or if we were disconnected before a reply arrived. The reply message, if any, is acknowledged to the AMQP server via Subscription.Ack(). Sends an asynchronous/one-way message to the service. Close the reply subscription associated with this instance, if any. Simply delegates to calling Subscription.Close(). Clears the Subscription property, so that subsequent Call()s, if any, will re-initialize it to a fresh Subscription instance. Signals that the Subscription we use for receiving our RPC replies was disconnected while we were waiting. Fires the Disconnected event. Signals that the configured timeout fired while waiting for an RPC reply. Fires the TimedOut event. Implement the IDisposable interface, permitting SimpleRpcClient instances to be used in using statements. Should initialise m_subscription to be non-null and usable for fetching RPC replies from the service through the AMQP server. Retrieves the reply for the request with the given correlation ID from our internal Subscription. Currently requires replies to arrive in the same order as the requests were sent out. Subclasses may override this to provide more sophisticated behaviour. This event is fired whenever Call() detects the disconnection of the underlying Subscription while waiting for a reply from the service. See also OnDisconnected(). Note that the sending of a request may result in OperationInterruptedException before the request is even sent. This event is fired whenever Call() decides that a timeout has occurred while waiting for a reply from the service. See also OnTimedOut(). Retrieve or modify the address that will be used for the next Call() or Cast(). This address represents the service, i.e. the destination service requests should be published to. It can be changed at any time before a Call() or Cast() request is sent - the value at the time of the call is used by Call() and Cast(). Retrieve the IModel this instance uses to communicate. Retrieve the Subscription that is used to receive RPC replies corresponding to Call() RPC requests. May be null. Upon construction, this property will be null. It is initialised by the protected virtual method EnsureSubscription upon the first call to Call(). Calls to Cast() do not initialise the subscription, since no replies are expected or possible when using Cast(). Retrieve or modify the timeout (in milliseconds) that will be used for the next Call(). This property defaults to System.Threading.Timeout.Infinite (i.e. -1). If it is set to any other value, Call() will only wait for the specified amount of time before returning indicating a timeout. See also TimedOut event and OnTimedOut(). Implements a simple RPC service, responding to requests received via a Subscription. This class interprets requests such as those sent by instances of SimpleRpcClient. The basic pattern for implementing a service is to subclass SimpleRpcServer, overriding HandleCall and HandleCast as appropriate, and then to create a Subscription object for receiving requests from clients, and start an instance of the SimpleRpcServer subclass with the Subscription. string queueName = "ServiceRequestQueue"; // See also Subscription ctors using (IConnection conn = new ConnectionFactory() .CreateConnection(serverAddress)) { using (IModel ch = conn.CreateModel()) { Subscription sub = new Subscription(ch, queueName); new MySimpleRpcServerSubclass(sub).MainLoop(); } } Note that this class itself does not declare any resources (exchanges, queues or bindings). The Subscription we use for receiving RPC requests should have already declared all the resources we need. See the Subscription constructors and the Subscription.Bind method. If you are implementing a service that responds to "jms/stream-message"-formatted requests (as implemented by RabbitMQ.Client.Content.IStreamMessageReader), override HandleStreamMessageCall. Otherwise, override HandleSimpleCall or HandleCall as appropriate. Asynchronous, one-way requests are dealt with by HandleCast etc. Every time a request is successfully received and processed within the server's MainLoop, the request message is Ack()ed using Subscription.Ack before the next request is retrieved. This causes the Subscription object to take care of acknowledging receipt and processing of the request message. If transactional service is enabled, via SetTransactional(), then after every successful ProcessRequest, IModel.TxCommit is called. Making use of transactional service has effects on all parts of the application that share an IModel instance, completely changing the style of interaction with the AMQP server. For this reason, it is initially disabled, and must be explicitly enabled with a call to SetTransactional(). Please see the documentation for SetTransactional() for details. To stop a running RPC server, call Close(). This will in turn Close() the Subscription, which will cause MainLoop() to return to its caller. Unless overridden, ProcessRequest examines properties in the request content header, and uses them to dispatch to one of the Handle[...]() methods. See the documentation for ProcessRequest and each Handle[...] method for details. Create, but do not start, an instance that will receive requests via the given Subscription. The instance is initially in non-transactional mode. See SetTransactional(). Call MainLoop() to start the request-processing loop. Shut down the server, causing MainLoop() to return to its caller. Acts by calling Close() on the server's Subscription object. Called by ProcessRequest(), this is the most general method that handles RPC-style requests. This method should map requestProperties and body to replyProperties and the returned byte array. The default implementation checks requestProperties.ContentType, and if it is "jms/stream-message" (i.e. the current value of StreamMessageBuilder.MimeType), parses it using StreamMessageReader and delegates to HandleStreamMessageCall before encoding and returning the reply. If the ContentType is any other value, the request is passed to HandleSimpleCall instead. The isRedelivered flag is true when the server knows for sure that it has tried to send this request previously (although not necessarily to this application). It is not a reliable indicator of previous receipt, however - the only claim it makes is that a delivery attempt was made, not that the attempt succeeded. Be careful if you choose to use the isRedelivered flag. Called by ProcessRequest(), this is the most general method that handles asynchronous, one-way requests. The default implementation checks requestProperties.ContentType, and if it is "jms/stream-message" (i.e. the current value of StreamMessageBuilder.MimeType), parses it using StreamMessageReader and delegates to HandleStreamMessageCall, passing in null as the replyWriter parameter to indicate that no reply is desired or possible. If the ContentType is any other value, the request is passed to HandleSimpleCast instead. The isRedelivered flag is true when the server knows for sure that it has tried to send this request previously (although not necessarily to this application). It is not a reliable indicator of previous receipt, however - the only claim it makes is that a delivery attempt was made, not that the attempt succeeded. Be careful if you choose to use the isRedelivered flag. Called by the default HandleCall() implementation as a fallback. If the MIME ContentType of the request did not match any of the types specially recognised (e.g. "jms/stream-message"), this method is called instead with the raw bytes of the request. It should fill in replyProperties (or set it to null) and return a byte array to send back to the remote caller as a reply message. Called by the default HandleCast() implementation as a fallback. If the MIME ContentType of the request did not match any of the types specially recognised (e.g. "jms/stream-message"), this method is called instead with the raw bytes of the request. Called by HandleCall and HandleCast when a "jms/stream-message" request is received. The args array contains the values decoded by HandleCall or HandleCast. The replyWriter parameter will be null if we were called from HandleCast, in which case a reply is not expected or possible, or non-null if we were called from HandleCall. Use the methods of replyWriter in this case to assemble your reply, which will be sent back to the remote caller. This default implementation does nothing, which effectively sends back an empty reply to any and all remote callers. Enters the main loop of the RPC service. Retrieves requests repeatedly from the service's subscription. Each request is passed to ProcessRequest. Once ProcessRequest returns, the request is acknowledged via Subscription.Ack(). If transactional mode is enabled, TxCommit is then called. Finally, the loop begins again. Runs until the subscription ends, which happens either as a result of disconnection, or of a call to Close(). Process a single request received from our subscription. If the request's properties contain a non-null, non-empty CorrelationId string (see IBasicProperties), it is assumed to be a two-way call, requiring a response. The ReplyTo header property is used as the reply address (via PublicationAddress.Parse, unless that fails, in which case it is treated as a simple queue name), and the request is passed to HandleCall(). If the CorrelationId is absent or empty, the request is treated as one-way asynchronous event, and is passed to HandleCast(). Usually, overriding HandleCall(), HandleCast(), or one of their delegates is sufficient to implement a service, but in some cases overriding ProcessRequest() is required. Overriding ProcessRequest() gives the opportunity to implement schemes for detecting interaction patterns other than simple request/response or one-way communication. Enables transactional mode. Once enabled, transactional mode is not only enabled for all users of the underlying IModel instance, but cannot be disabled without shutting down the entire IModel (which involves shutting down all the services depending on it, and should not be undertaken lightly). This method calls IModel.TxSelect, every time it is called. (TxSelect is idempotent, so this is harmless.) Implement the IDisposable interface, permitting SimpleRpcServer instances to be used in using statements. Returns true if we are in "transactional" mode, or false if we are not. Manages a subscription to a queue. This convenience class abstracts away from much of the detail involved in receiving messages from a queue. Once created, the Subscription consumes from a queue (using a EventingBasicConsumer). Received deliveries can be retrieved by calling Next(), or by using the Subscription as an IEnumerator in, for example, a foreach loop. Note that if the "noAck" option is enabled (which it is by default), then received deliveries are automatically acked within the server before they are even transmitted across the network to us. Calling Ack() on received events will always do the right thing: if "noAck" is enabled, nothing is done on an Ack() call, and if "noAck" is disabled, IModel.BasicAck() is called with the correct parameters. Creates a new Subscription in "noAck" mode, consuming from a named queue. Creates a new Subscription, with full control over both "noAck" mode and the name of the queue. Creates a new Subscription, with full control over both "noAck" mode, the name of the queue, and the consumer tag. If LatestEvent is non-null, passes it to Ack(BasicDeliverEventArgs). Causes LatestEvent to become null. If we are not in "noAck" mode, calls IModel.BasicAck with the delivery-tag from ; otherwise, sends nothing to the server. if is the same as LatestEvent by pointer comparison, sets LatestEvent to null. Passing an event that did not originate with this Subscription's channel, will lead to unpredictable behaviour Closes this Subscription, cancelling the consumer record in the server. If LatestEvent is non-null, passes it to Nack(BasicDeliverEventArgs, false, requeue). Causes LatestEvent to become null. If LatestEvent is non-null, passes it to Nack(BasicDeliverEventArgs, multiple, requeue). Causes LatestEvent to become null. If we are not in "noAck" mode, calls IModel.BasicNack with the delivery-tag from ; otherwise, sends nothing to the server. if is the same as LatestEvent by pointer comparison, sets LatestEvent to null. Passing an event that did not originate with this Subscription's channel, will lead to unpredictable behaviour Retrieves the next incoming delivery in our subscription queue. Returns null when the end of the stream is reached and on every subsequent call. End-of-stream can arise through the action of the Subscription.Close() method, or through the closure of the IModel or its underlying IConnection. Updates LatestEvent to the value returned. Does not acknowledge any deliveries at all (but in "noAck" mode, the server will have auto-acknowledged each event before it is even sent across the wire to us). Retrieves the next incoming delivery in our subscription queue, or times out after a specified number of milliseconds. Returns false only if the timeout expires before either a delivery appears or the end-of-stream is reached. If false is returned, the out parameter "result" is set to null, but LatestEvent is not updated. Returns true to indicate a delivery or the end-of-stream. If a delivery is already waiting in the queue, or one arrives before the timeout expires, it is removed from the queue and placed in the "result" out parameter. If the end-of-stream is detected before the timeout expires, "result" is set to null. Whenever this method returns true, it updates LatestEvent to the value placed in "result" before returning. End-of-stream can arise through the action of the Subscription.Close() method, or through the closure of the IModel or its underlying IConnection. This method does not acknowledge any deliveries at all (but in "noAck" mode, the server will have auto-acknowledged each event before it is even sent across the wire to us). A timeout of -1 (i.e. System.Threading.Timeout.Infinite) will be interpreted as a command to wait for an indefinitely long period of time for an item or the end of the stream to become available. Usage of such a timeout is equivalent to calling Next() with no arguments (modulo predictable method signature differences). Implementation of the IDisposable interface, permitting Subscription to be used in using statements. Simply calls Close(). Implementation of the IEnumerable interface, for permitting Subscription to be used in foreach loops. Implementation of the IEnumerator interface, for permitting Subscription to be used in foreach loops. Does not acknowledge any deliveries at all. Ack() must be called explicitly on received deliveries. Dummy implementation of the IEnumerator interface, for permitting Subscription to be used in foreach loops; Reset()ting a Subscription doesn't make sense, so this method always throws InvalidOperationException. Retrieve the IBasicConsumer that is receiving the messages from the server for us. Normally, you will not need to access this property - use Next() and friends instead. Retrieve the consumer-tag that this subscription is using. Will usually be a server-generated name. Returns the most recent value returned by Next(), or null when either no values have been retrieved yet, the end of the subscription has been reached, or the most recent value has already been Ack()ed. See also the documentation for Ack(). Retrieve the IModel our subscription is carried by. Returns true if we are in "noAck" mode, where calls to Ack() will be no-ops, and where the server acks messages before they are delivered to us. Returns false if we are in a mode where calls to Ack() are required, and where such calls will actually send an acknowledgement message across the network to the server. Retrieve the queue name we have subscribed to. Implementation of the IEnumerator interface, for permitting Subscription to be used in foreach loops. As per the IEnumerator interface definition, throws InvalidOperationException if LatestEvent is null. Does not acknowledge any deliveries at all. Ack() must be called explicitly on received deliveries. A thread-safe single-assignment reference cell. A fresh BlockingCell holds no value (is empty). Any thread reading the Value property when the cell is empty will block until a value is made available by some other thread. The Value property can only be set once - on the first call, the BlockingCell is considered full, and made immutable. Further attempts to set Value result in a thrown InvalidOperationException. Return valid timeout value If value of the parameter is less then zero, return 0 to mean infinity Retrieve the cell's value, waiting for the given timeout if no value is immediately available. If a value is present in the cell at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either a value appears, or operation times out. If no value was available before the timeout, an exception is thrown. Retrieve the cell's value, waiting for the given timeout if no value is immediately available. If a value is present in the cell at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either a value appears, or operation times out. If no value was available before the timeout, an exception is thrown. Retrieve the cell's value, blocking if none exists at present, or supply a value to an empty cell, thereby filling it. Miscellaneous debugging and development utilities. Not part of the public API. Print a hex dump of the supplied bytes to stdout. Print a hex dump of the supplied bytes to the supplied TextWriter. Prints an indented key/value pair; used by DumpProperties() Recurses into the value using DumpProperties(). Dump properties of objects to the supplied writer. Used internally by class Either. Models the disjoint union of two alternatives, a "left" alternative and a "right" alternative. Borrowed from ML, Haskell etc. Private constructor. Use the static methods Left, Right instead. Constructs an Either instance representing a Left alternative. Constructs an Either instance representing a Right alternative. Retrieve the alternative represented by this instance. Retrieve the value carried by this instance. A class for allocating integer IDs in a given range. Creates an IntAllocator allocating integer IDs within the inclusive range [start, end] Allocate a fresh integer from the range, or return -1 if no more integers are available. This operation is guaranteed to run in O(1) Make the provided integer available for allocation again. This operation runs in amortized O(sqrt(range size)) time: About every sqrt(range size) operations will take O(range_size + number of intervals) to complete and the rest run in constant time. No error checking is performed, so if you double Free or Free an integer that was not originally Allocated the results are undefined. Sorry. Subclass of BinaryReader that reads integers etc in correct network order. Kludge to compensate for .NET's broken little-endian-only BinaryReader. Relies on BinaryReader always being little-endian. Construct a NetworkBinaryReader over the given input stream. Construct a NetworkBinaryReader over the given input stream, reading strings using the given encoding. Helper method for constructing a temporary BinaryReader over a byte[]. Override BinaryReader's method for network-order. Override BinaryReader's method for network-order. Override BinaryReader's method for network-order. Override BinaryReader's method for network-order. Override BinaryReader's method for network-order. Override BinaryReader's method for network-order. Override BinaryReader's method for network-order. Override BinaryReader's method for network-order. Subclass of BinaryWriter that writes integers etc in correct network order.

Kludge to compensate for .NET's broken little-endian-only BinaryWriter.

See also NetworkBinaryReader.

Construct a NetworkBinaryWriter over the given input stream. Construct a NetworkBinaryWriter over the given input stream, reading strings using the given encoding. Helper method for constructing a temporary BinaryWriter streaming into a fresh MemoryStream provisioned with the given initialSize. Helper method for extracting the byte[] contents of a BinaryWriter over a MemoryStream, such as constructed by TemporaryBinaryWriter. Override BinaryWriter's method for network-order. Override BinaryWriter's method for network-order. Override BinaryWriter's method for network-order. Override BinaryWriter's method for network-order. Override BinaryWriter's method for network-order. Override BinaryWriter's method for network-order. Override BinaryWriter's method for network-order. Override BinaryWriter's method for network-order. A thread-safe shared queue implementation. A thread-safe shared queue implementation. Flag holding our current status. The shared queue. Subclasses must ensure appropriate locking discipline when accessing this field. See the implementation of Enqueue, Dequeue. Close the queue. Causes all further Enqueue() operations to throw EndOfStreamException, and all pending or subsequent Dequeue() operations to throw an EndOfStreamException once the queue is empty. Retrieve the first item from the queue, or block if none available Callers of Dequeue() will block if no items are available until some other thread calls Enqueue() or the queue is closed. In the latter case this method will throw EndOfStreamException. Retrieve the first item from the queue, or return nothing if no items are available after the given timeout If one or more items are present on the queue at the time the call is made, the call will return immediately. Otherwise, the calling thread blocks until either an item appears on the queue, or millisecondsTimeout milliseconds have elapsed. Returns true in the case that an item was available before the timeout, in which case the out parameter "result" is set to the item itself. If no items were available before the timeout, returns false, and sets "result" to null. A timeout of -1 (i.e. System.Threading.Timeout.Infinite) will be interpreted as a command to wait for an indefinitely long period of time for an item to become available. Usage of such a timeout is equivalent to calling Dequeue() with no arguments. See also the MSDN documentation for System.Threading.Monitor.Wait(object,int). If no items are present and the queue is in a closed state, or if at any time while waiting the queue transitions to a closed state (by a call to Close()), this method will throw EndOfStreamException. Retrieve the first item from the queue, or return defaultValue immediately if no items are available If one or more objects are present in the queue at the time of the call, the first item is removed from the queue and returned. Otherwise, the defaultValue that was passed in is returned immediately. This defaultValue may be null, or in cases where null is part of the range of the queue, may be some other sentinel object. The difference between DequeueNoWait() and Dequeue() is that DequeueNoWait() will not block when no items are available in the queue, whereas Dequeue() will. If at the time of call the queue is empty and in a closed state (following a call to Close()), then this method will throw EndOfStreamException. Place an item at the end of the queue. If there is a thread waiting for an item to arrive, the waiting thread will be woken, and the newly Enqueued item will be passed to it. If the queue is closed on entry to this method, EndOfStreamException will be thrown. Implementation of the IEnumerable interface, for permitting SharedQueue to be used in foreach loops. Implementation of the IEnumerable interface, for permitting SharedQueue to be used in foreach loops. Call only when the lock on m_queue is held. Implementation of the IEnumerator interface, for permitting SharedQueue to be used in foreach loops. Construct an enumerator for the given SharedQueue. Reset()ting a SharedQueue doesn't make sense, so this method always throws InvalidOperationException. Miscellaneous helpful XML utilities. Private constructor - this class has no instances Constructs an indenting XmlTextWriter that writes to a fresh MemoryStream. Constructs an indenting XmlTextWriter that writes to the supplied stream. Constructs an indenting XmlTextWriter that writes to the supplied file name. Serializes an arbitrary serializable object to an XML document.