[rabbitmq-discuss] Draft of C++ rabbitMq API

Sid Young sid.young at gmail.com
Tue Feb 4 05:41:43 GMT 2014


Hi,

I've been using your C++ AMQP library and its not bad, are you planning to 
add any enhancements to support rabbitmq-c v0.5 ?? in particular the socket 
interface has been deprecated in favour of the amqp_tcp_socket_new<http://alanxz.github.io/rabbitmq-c/docs/0.5.0/amqp__tcp__socket_8h.html#a3276c8bfa7b263aa3c755517b4b97ac8>
 (amqp_connection_state_t<http://alanxz.github.io/rabbitmq-c/docs/0.5.0/amqp_8h.html#a59cfdff3bfbf28aba201be5636365fa4>
 state)

I was also wondering if you would object to me submitting a few more 
example programs so more people might look at implementing the library.

Thanks

Sid


On Monday, March 1, 2010 9:55:57 PM UTC+10, Alexandre Kalendarev wrote:
>
> Hi colleagues!
>
> I developed the C++ interface, see below
>
> If You have any ideas - wellcome! 
>
> the Draft of C++ API
>
> Connection class
>
> class AMQPConnection {
>         AMQPConnection();
>         AMQPConnection( string connectionString );
>         AMQPConnection( string connectionString , int channelNumber);
>         
>         void Open( string connectionString );
>         void Open( string connectionString , int channelNumber);
>         
>         void Close();
>         
>         setChannel(int channelNumber);
> }
>
> const AMQPCnnDebug = "localhost:5672"
>
> the example:
>         AMQPConnection * cnn = new AMQPConnection( 
>  "guest:guest at localhost:5673/somevhost" );
>
>         default connection string is "localhost:5672"
>         the debug connection string   AMQPCnnDebug  is 
> "guest:guest at localhost:5673" 
>
>
> Exchange class
>
> class AMQPExchange {
>         AMQPExchange( AMQPConnection * cnn );
>         
>         void Declare(string name);
>         void Declare(string name, int parms);
>         void Declare(string name, int parms, map properties ); // *)?
>
>         void Delete(string name)
> }
>
> the parms is set of constants as AMQPDurable, AMQPAutodelete etc
> the type of exchange is AMQPDirect default or AMQPFanout, or AMQPTopic 
>
>
> Example:
>         AMQPExchange * ex = new  AMQPExchange(new AMQPConnection());
>         ex->Declare("my_exchange");
>
> Queue class
>
> class AMQPQueue {
>         AMQPQueue(AMQPConnection * cnn);
>
>         void Declare(string name);
>         void Declare(string name, int parms);
>         void Declare(string name, int parms, map properties ); // *)?
>
>         void Delete(string name)
>
>         void Purge (string name)
>
> }
> the parms is set of constants as AMQPDurable, AMQPAutodelete etc
>
>
> example:
>         AMQPEQueue * qu = new AMQPEQueue(new AMQPConnection());
>         qu->Declare("qu_mylife");
>
> Basic class:
>
> class AMQPBasic {
>         AMQPBasic(AMQPConnection * cnn);
>
>         void setProperty(string name, string value  );
>         void setProperty(string name, int value  );
>
>         void Bind (string exchangeName, string queueName );
>         void Bind (string exchangeName, string queueName , string key);
>
>         void Publish( string exchangeName, string message);
>         void Publish( string exchangeName, uchar* message);
>         void Publish( string exchangeName, string message, string key);
>         void Publish( string exchangeName, uchar* message, string key);
>
>         void Cancel( string queueName)
>
>         AMQPMessage *  Get( string queueName)
>
>
>         void Ask( string queueName ) ????
>
>         void Reject( string queueName ) ????
>
>         void Consume( string queueName , IAMQPCallback * callbackName );
>
> }
>
> class AMQPMessage  ????
>  int timestamp
>  int expiration
>  string contentType
>  string deliveryTag
>  uchar* message or string 
>  int number // internal number message
>  string exchange 
>  string key
> ....
>
>  IAMQPCallback is abstract class, the callbackName is derived from 
> IAMQPCallback.
> after received each the message call the method run of derived 
> AMQPCallback base class.
>
>
> *) properties is map of addional property, it will to resolve in future.
>
> Examples:
>
>         // publish message        
>         AMQPConnection * cnn = new AMQPConnection();
>         AMQPExchange * ex = new  AMQPExchange(cnn);
>         ex->Declare("my_exchange", AMQPTopic);
>         basic = new AMQPBasic(cnn);
>         basic->Bind("my_exchange", "qu_mylive", "news" );
>         basic->Publish("my_exchange", "12345" , "news");
>
>
>         // consume message
>         class printMessage : IAMQPCallback {
>                 void run (uchar* message) {
>                         std::cout << message << std::endl;
>                 }
>         }
>         
>         AMQPConnection * cnn = new AMQPConnection();
>         basic = new AMQPBasic(cnn);
>         printMessage * pm = new printMessage();
>         basic->Consume("qu_mylive", pm); 
>
>
> unrealise classes(it will to resolve in future):  AMQPFile, AMQPStreams 
> etc ...
>
> exceptions:
>
> AMQPnoConnectException
> AMQPnonAutorizeException
> AMQPnotFoundException 
> AMQPnotAllowedException 
> ...
> AMQPerrorException (AMQPcommandInvalidException  )
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq... at lists.rabbitmq.com <javascript:>
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140203/e816eecb/attachment.html>


More information about the rabbitmq-discuss mailing list