On 19/03/2019 8:33 am, Schaik, Jacco van wrote:
Hello,


Absolute beginner in the world of AMQP and Qpid here.


I'm trying to set up a C application where the AMQP traffic takes place over a socket 
that is under control of the application, effectively using select() to wait for data and 
then having Qpid handle it. As I understand it, I need to use a "connection 
driver" for this, but I haven't been able to find any examples that show me how.

I'm not an expert on the c api, but you don't *need* to use connection_driver. It is there as a convenience.

You can just manage the transport, connection and event collector yourself, pushing data from your socket into the transport, pulling data out the transport and writing it to your socket etc. In fact this is what qpidd does (i.e. the c++ broker).

The connection_driver is a utility that simplifies some of the interactions for that (and gives them more intuitive names).

I have looked at the C examples in the Qpid software distribution (particularly 
send.c and receive.c), and I'm beginning to see how things are started rolling 
after the PN_CONNECTION_INIT event comes in. Can I simply call 
pn_connection_driver_init at that point to create a connection driver? I assume 
the code as-is creates its own network connection, and I want to supply my own, 
so I assume I need to take something out too. But what?

I don't think connection_driver is actually tied to any io implementation, so you can still use it with your own sockets and your own io loop.

Unfortunately, (and ironically since that was originally its main purpose) there is not a great deal of documentation about integrating the proton engine into an existing c event/io loop.

The basic idea is that there is a'top half', the pn_connection_t, pn_link_t etc that lets you invoke the AMQP behaviour you want and react to AMQP events. Then there is a bootom half (the pn_transport_t, or pn_connection_driver_t if you prefer, which hides the transport), which operates on a bytes in and bytes out abstraction.

Can anyone tell me how to proceed? Are there examples that I simply haven't 
found yet? Or am I barking up entirely the wrong tree here? Any guidance would 
be appreciated.


Groeten, Jacco



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to