Boost Pub/Sub message service model Implementation

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Boost Pub/Sub message service model Implementation

Boost - Dev mailing list
Hello,



Currently, I am working on an IoT project where I need to send data from
client to server. To transfer data, I need to setup a Pub/Sub message
service model. Presently, I am using MQTT Paho C libraries  to transmit
data to server over TCP IP protocol but I want to switch to boost C++
library for the publish/subscribe model.



I am a newbie to this library and have some queries:



*1) Is there any boost C++ library for pub/sub model? If yes, please give
me the details or link for the tutorial.*



*2) If no library is present, please tell me how to implement a
message pub/sub
<https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern> service
to communicate using boost C++ library?*



Please, help me to solve these issues.



Thanks & Regards,

Rakshita Parihar

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost Pub/Sub message service model Implementation

Boost - Dev mailing list
On Mon, Dec 14, 2020 at 10:27 AM Rakshita Parihar via Boost <
[hidden email]> wrote:

> [...], I need to setup a Pub/Sub message service model. Presently, I am
> using MQTT Paho C

libraries  to transmit data to server over TCP IP protocol but I want to
> switch to boost C++
> library for the publish/subscribe model.
>
> *1) Is there any boost C++ library for pub/sub model? If yes, please give
> me the details or link for the tutorial.*
>

Nothing built-in, no.  There's Boost.Beast, so you could build it on top of
WebSocket yourself. C++11.
https://www.boost.org/doc/libs/1_75_0/libs/beast/doc/html/index.html

*2) If no library is present, please tell me how to implement a
> message pub/sub
> <https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern> service
> to communicate using boost C++ library?*
>

Outside Boost, there's also https://github.com/uNetworking/uWebSockets
which is C++17 and has PubSub.
(Warning, examples require C++20, and author is not friendly to newbie
questions)

Both approaches depend on WebSocket, so available from the Browser too. But
you could also use
Boost.ASIO directly if you want to avoid WebSocket, and go one level down
to pure TCP/IP.
https://www.boost.org/doc/libs/1_75_0/doc/html/boost_asio.html

I'm a novice in this field though. Hopefully you'll get a better answer
later.
In all cases, there's a learning curve to what you're trying to do :) --DD

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost Pub/Sub message service model Implementation

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On 12/14/20 12:27 AM, Rakshita Parihar via Boost wrote:

> Hello,
>
>
>
> Currently, I am working on an IoT project where I need to send data from
> client to server. To transfer data, I need to setup a Pub/Sub message
> service model. Presently, I am using MQTT Paho C libraries  to transmit
> data to server over TCP IP protocol but I want to switch to boost C++
> library for the publish/subscribe model.
>
>
>
> I am a newbie to this library and have some queries:
>
>
>
> *1) Is there any boost C++ library for pub/sub model? If yes, please give
> me the details or link for the tutorial.*
>
>
>
> *2) If no library is present, please tell me how to implement a
> message pub/sub
> <https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern> service
> to communicate using boost C++ library?*
>
>

Here is boosts implementation for this software pattern.

https://www.boost.org/doc/libs/1_75_0/doc/html/signals2.html

Robert Ramey


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost Pub/Sub message service model Implementation

Boost - Dev mailing list
On 12/14/20 9:54 PM, Robert Ramey via Boost wrote:

> On 12/14/20 12:27 AM, Rakshita Parihar via Boost wrote:
>> Hello,
>>
>> Currently, I am working on an IoT project where I need to send data from
>> client to server. To transfer data, I need to setup a Pub/Sub message
>> service model. Presently, I am using MQTT Paho C libraries  to transmit
>> data to server over TCP IP protocol but I want to switch to boost C++
>> library for the publish/subscribe model.
>>
>> I am a newbie to this library and have some queries:
>>
>> *1) Is there any boost C++ library for pub/sub model? If yes, please give
>> me the details or link for the tutorial.*
>>
>> *2) If no library is present, please tell me how to implement a
>> message pub/sub
>> <https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern> service
>> to communicate using boost C++ library?*
>
> Here is boosts implementation for this software pattern.
>
> https://www.boost.org/doc/libs/1_75_0/doc/html/signals2.html

Boost.Signals2 doesn't deal with network communication, which I think is
what OP is asking.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost Pub/Sub message service model Implementation

Boost - Dev mailing list
On 12/14/20 12:17 PM, Andrey Semashev via Boost wrote:
> On 12/14/20 9:54 PM, Robert Ramey via Boost wrote:
>> On 12/14/20 12:27 AM, Rakshita Parihar via Boost wrote:

>>> *1) Is there any boost C++ library for pub/sub model? If yes, please
>>> give
>>> me the details or link for the tutorial.*

>>
>> Here is boosts implementation for this software pattern.
>>
>> https://www.boost.org/doc/libs/1_75_0/doc/html/signals2.html
>
> Boost.Signals2 doesn't deal with network communication, which I think is
> what OP is asking.

Hmmm. I read the above as a request for details or link to the tutorial
for a boost implementation of the publish/subscribe model, which is what
I gave him.

Robert Ramey


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Boost Pub/Sub message service model Implementation

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On Mon, Dec 14, 2020 at 1:27 AM Rakshita Parihar via Boost
<[hidden email]> wrote:
> *1) Is there any boost C++ library for pub/sub model? If yes, please give
> me the details or link for the tutorial.*

This program implements a server which receives and broadcasts
messages to all clients:

<https://www.boost.org/doc/libs/1_75_0/libs/beast/doc/html/beast/examples.html#beast.examples.chat_server>

There is also a video presentation on how it all works:

<https://www.youtube.com/watch?v=7FQwAjELMek>

Hope this helps!

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost