You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Millieret, Xavier" <Xa...@Eaton.com> on 2021/09/07 12:12:25 UTC

Best practice with qpid-proton for request/reply and pub/sub

Hi all,

I am currently doing a library above qpid-proton in cpp (0.34).
This library must offer 2 patterns, request/reply, and publish/subscribe.

I play with all samples provided by qpid-proton cpp/examples/....

And my question is:

  *   Is the best way, is: building a class who extend proton::messaging_handler, building a container with this class, run it, and after do all stuff with it (so the container and the class is shared inside my library) ?
  *   Or each time when I want to send a message on a queue or on an topic, I must build the class runt it, through a new container, and destroy it, just after than the job is done.



I know with some others libraries (JMS, Mqtt), the best way is keep a connection alive, and building sessions (from this connection) to send message on a queue or on topic.



So my question is, how to use qpid-proton library to be as efficient as possible.

Best regards

Xavier Millieret



________________________________
Eaton Industries (France) S.A.S ~ Si?ge social: 110 Rue Blaise Pascal, Immeuble Le Vis?o - B?timent A Innovall?e, 38330, Montbonnot-St.-Martin, France ~ Lieu d'enregistrement au registre du commerce: Grenoble ~ Num?ro d'enregistrement: 509 653 176 ~ Capital social souscrit et liber?:EUR 16215441 ~ Num?ro de TVA: FR47509653176

________________________________



Re: Best practice with qpid-proton for request/reply and pub/sub

Posted by Robbie Gemmell <ro...@gmail.com>.
You essentially answered your question while asking it, it is of
course more efficient to retain resources (connection as you said, but
also the session and any sender/receiver) and reuse them if you can.

On Tue, 7 Sept 2021 at 13:12, Millieret, Xavier
<Xa...@eaton.com> wrote:
>
> Hi all,
>
> I am currently doing a library above qpid-proton in cpp (0.34).
> This library must offer 2 patterns, request/reply, and publish/subscribe.
>
> I play with all samples provided by qpid-proton cpp/examples/....
>
> And my question is:
>
>   *   Is the best way, is: building a class who extend proton::messaging_handler, building a container with this class, run it, and after do all stuff with it (so the container and the class is shared inside my library) ?
>   *   Or each time when I want to send a message on a queue or on an topic, I must build the class runt it, through a new container, and destroy it, just after than the job is done.
>
>
>
> I know with some others libraries (JMS, Mqtt), the best way is keep a connection alive, and building sessions (from this connection) to send message on a queue or on topic.
>
>
>
> So my question is, how to use qpid-proton library to be as efficient as possible.
>
> Best regards
>
> Xavier Millieret
>
>
>
> ________________________________
> Eaton Industries (France) S.A.S ~ Si?ge social: 110 Rue Blaise Pascal, Immeuble Le Vis?o - B?timent A Innovall?e, 38330, Montbonnot-St.-Martin, France ~ Lieu d'enregistrement au registre du commerce: Grenoble ~ Num?ro d'enregistrement: 509 653 176 ~ Capital social souscrit et liber?:EUR 16215441 ~ Num?ro de TVA: FR47509653176
>
> ________________________________
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


RE: Best practice with qpid-proton for request/reply and pub/sub

Posted by "Millieret, Xavier" <Xa...@Eaton.com>.
Great Robbie,

Thanks a lot for these answers!

From: Millieret, Xavier
Sent: mardi 7 septembre 2021 14:12
To: users@qpid.apache.org
Subject: Best practice with qpid-proton for request/reply and pub/sub

Hi all,

I am currently doing a library above qpid-proton in cpp (0.34).
This library must offer 2 patterns, request/reply, and publish/subscribe.

I play with all samples provided by qpid-proton cpp/examples/....

And my question is:

  *   Is the best way, is: building a class who extend proton::messaging_handler, building a container with this class, run it, and after do all stuff with it (so the container and the class is shared inside my library) ?
  *   Or each time when I want to send a message on a queue or on an topic, I must build the class runt it, through a new container, and destroy it, just after than the job is done.



I know with some others libraries (JMS, Mqtt), the best way is keep a connection alive, and building sessions (from this connection) to send message on a queue or on topic.



So my question is, how to use qpid-proton library to be as efficient as possible.

Best regards

Xavier Millieret



________________________________
Eaton Industries (France) S.A.S ~ Si?ge social: 110 Rue Blaise Pascal, Immeuble Le Vis?o - B?timent A Innovall?e, 38330, Montbonnot-St.-Martin, France ~ Lieu d'enregistrement au registre du commerce: Grenoble ~ Num?ro d'enregistrement: 509 653 176 ~ Capital social souscrit et liber?:EUR 16215441 ~ Num?ro de TVA: FR47509653176

________________________________