This commit is contained in:
Graham Christensen 2018-01-30 20:30:46 -05:00
parent cb18c0d5b1
commit c0cab43513
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 37 additions and 3 deletions

View file

@ -57,8 +57,8 @@ fn main() {
consumer_tag: format!("{}-builder", cfg.whoami()),
no_local: false,
no_ack: false,
no_wait: false,
exclusive: false,
nowait: false,
arguments: None
},
)

View file

@ -5,12 +5,46 @@ use amqp;
use amqp::Basic;
pub struct ConsumeConfig {
/// Specifies the name of the queue to consume from.
pub queue: String,
/// Specifies the identifier for the consumer. The consumer tag is
/// local to a channel, so two clients can use the same consumer
/// tags. If this field is empty the server will generate a unique
/// tag.
///
/// The client MUST NOT specify a tag that refers to an existing
/// consumer. Error code: not-allowed
pub consumer_tag: String,
/// If the no-local field is set the server will not send messages
/// to the connection that published them.
pub no_local: bool,
/// If this field is set the server does not expect
/// acknowledgements for messages. That is, when a message is
/// delivered to the client the server assumes the delivery will
/// succeed and immediately dequeues it. This functionality may
/// increase performance but at the cost of reliability. Messages
/// can get lost if a client dies before they are delivered to the
/// application.
pub no_ack: bool,
/// Request exclusive consumer access, meaning only this consumer
/// can access the queue.
///
/// The client MAY NOT gain exclusive access to a queue that
/// already has active consumers. Error code: access-refused
pub exclusive: bool,
pub nowait: bool,
/// If set, the server will not respond to the method. The client
/// should not wait for a reply method. If the server could not
/// complete the method it will raise a channel or connection
/// exception.
pub no_wait: bool,
/// A set of arguments for the consume. The syntax and semantics
/// of these arguments depends on the server implementation.
pub arguments: Option<amqp::Table>,
}
@ -59,7 +93,7 @@ impl TypedWrappers for amqp::Channel {
config.no_local,
config.no_ack,
config.exclusive,
config.nowait,
config.no_wait,
config.arguments.unwrap_or(amqp::Table::new()),
)
}