How AmqpClient::Channel works
masterThe AmqpClient::Channel class is the primary interface for the library. It abstracts AMQP channels into an error/consumer scope and represents a connection to an AMQP broker.
Key Behaviors
- Connection: A connection is established automatically upon constructing an instance of the class.
- Object Creation: All classes in the library provide a
Create()method and aptr_ttypedef (equivalent toboost::shared_ptr<>). It is recommended to useCreate()to instantiate objects. - Error Handling:
AmqpClient::ChannelException: Thrown during commands like declaring/binding/unbinding/deleting exchanges or queues. TheChannelobject remains usable after this exception.AmqpClient::ConnectionExceptionorAmqpClient::AmqpResponseLibraryException: Thrown during severe errors. TheChannelobject is no longer usable after these exceptions.
AmqpClient::Channel::ptr_t connection = AmqpClient::Channel::Create("localhost");