Shared registration AutobahnCpp

#1

Hello,
I am working on backend component for crossbar.io using autobahnCpp. I’d like to take advantage of shared RPC registrations, because my RPCs potencially can take some time to execute, so I need several components (or threads of the same component?) to be able to execute multiple RPC calls to the same url. From reading the documentation it looks like the shared registration option is available, at least in autobahnJS. However, I do not see that option in autobahnCpp implementation. It looks like the invocation options are hardcoded to none (meaning single registration is allowed).

Please confirm that my understanding is correct.

Is it possible to implement shared RPC registration using the corrent version of autobahnCpp? And if not, arre there any plans to implement that feature?

Thanks a lot.

Rosa

0 Likes

#2

Hi Rosa,

you are right, it is not there: https://github.com/tavendo/AutobahnCpp/issues/34

I am gonna add that this week (it’s easy). I also will hack a C++ examples that demonstrates “scaling out C++ WAMP components” … because this is exactly one use case of shared regs: scaling out CPU intensive stuff.

Do you have some “CPU intensive, but simple, yet vaguely useful” C++ function around that I could use for above example?

Cheers,
/Tobias

···

Am Freitag, 27. März 2015 19:16:26 UTC+1 schrieb Rosa Lisin:

Hello,
I am working on backend component for crossbar.io using autobahnCpp. I’d like to take advantage of shared RPC registrations, because my RPCs potencially can take some time to execute, so I need several components (or threads of the same component?) to be able to execute multiple RPC calls to the same url. From reading the documentation it looks like the shared registration option is available, at least in autobahnJS. However, I do not see that option in autobahnCpp implementation. It looks like the invocation options are hardcoded to none (meaning single registration is allowed).

Please confirm that my understanding is correct.

Is it possible to implement shared RPC registration using the corrent version of autobahnCpp? And if not, arre there any plans to implement that feature?

Thanks a lot.

Rosa

0 Likes

#3

Hi Tobias,
Thanks a lot! That would be most helpful!

Unfortunately I do not have any useful CPU intesive code examples at hand. I was trying to simulate an RPC procedure that takes some time by just putting sleep in the function that provides RPC (just imagine it is not a “sleep”, but some data base query!). All components calling that blocking remote procedure will be waiting in line for the previous call to finish, if there is only one RPC provider.

Regards,

Rosa

···

On Monday, March 30, 2015 at 2:36:12 PM UTC-4, Tobias Oberstein wrote:

Hi Rosa,

you are right, it is not there: https://github.com/tavendo/AutobahnCpp/issues/34

I am gonna add that this week (it’s easy). I also will hack a C++ examples that demonstrates “scaling out C++ WAMP components” … because this is exactly one use case of shared regs: scaling out CPU intensive stuff.

Do you have some “CPU intensive, but simple, yet vaguely useful” C++ function around that I could use for above example?

Cheers,
/Tobias

Am Freitag, 27. März 2015 19:16:26 UTC+1 schrieb Rosa Lisin:

Hello,
I am working on backend component for crossbar.io using autobahnCpp. I’d like to take advantage of shared RPC registrations, because my RPCs potencially can take some time to execute, so I need several components (or threads of the same component?) to be able to execute multiple RPC calls to the same url. From reading the documentation it looks like the shared registration option is available, at least in autobahnJS. However, I do not see that option in autobahnCpp implementation. It looks like the invocation options are hardcoded to none (meaning single registration is allowed).

Please confirm that my understanding is correct.

Is it possible to implement shared RPC registration using the corrent version of autobahnCpp? And if not, arre there any plans to implement that feature?

Thanks a lot.

Rosa

0 Likes

#4

Hi Tobias,

Is this feature already implemented in Autobahn Python as well? (I could always just test it myself…! ;^) )

Thanks,
Dave

0 Likes

#5

Hi Tobias,

Is this feature already implemented in Autobahn Python as well? (I could

Yes, this feature is currently available with

AutobahnJS
AutobahnPython
Crossbar.io

and I will add AutobahnCpp.

It is a quite powerful feature .. load-balancing / scaling-out is just one use case.

Another one is hot-standby / failover.

···

Am 30.03.2015 um 21:27 schrieb Dave Barndt:

always just test it myself...! ;^) )

Thanks,
Dave

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/e8cb43ed-e291-412e-9d06-34aa55b436e1%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/e8cb43ed-e291-412e-9d06-34aa55b436e1%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#6

Spectacular! One other use case - can a caller request a response from every registered callee (i.e., the same RPC registered by each device in an IoT network)? If that’s possible, would Crossbar just aggregate the results from all callees and return them to the caller (maybe using the “Progress” options feature if desired as well)? If so, is there an example of this lurking anywhere?

I have to admit, I’m loving this stuff. :^)

Thanks,
Dave

0 Likes

#7

Spectacular! One other use case - can a caller request a response from
every registered callee (i.e., the same RPC registered by each device in
an IoT network)? If that's possible, would Crossbar just aggregate the
results from all callees and return them to the caller (maybe using the
"Progress" options feature if desired as well)? If so, is there an
example of this lurking anywhere?

What you describe is indeed an upcoming feature .. both variants you mention:

- aggregate in router (as the router doesn't know anything about app stuff, this will just accumulated a list)
- immediately forward results as progressive results

This is a 1-to-all pattern.

It's a long planned thing (in the spec), but now we have the basic stuff in place to actually add it.

We will also have "sharding", where a call is forwarded to the correct data partition / callee.

This will work with any WAMP client library for callees. Including the (also upcoming) PostgreSQL PL/SQL WAMP.

And that will then be really cool: call into your PostgreSQL shards directly into your PL/SQL stored procedures. It's a story in itself .. anyway. Stay tuned for even more stuff!

I have to admit, I'm loving this stuff. :^)

Thanks=)

Please spread the word ..
/Tobias

···

Am 30.03.2015 um 22:55 schrieb Dave Barndt:

Thanks,
Dave

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/dc62692a-7000-4a07-90f8-5016cc47dd36%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/dc62692a-7000-4a07-90f8-5016cc47dd36%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#8

Hi Rosa,

alright, here is a complete C++ example demonstrating shared registrations where you can run multiple instances of a C++ component to scale-out your app layer.

https://github.com/crossbario/crossbarexamples/blob/master/sharedregs/cpp/component.cpp#L123

This required changes in AutobahnCpp|Python and Crossbar.io - means, if you want to try, you need trunk of everything. But all changes will be in next release of each.

Cheers,
/Tobias

···

Am 30.03.2015 um 20:57 schrieb Rosa Lisin:

Hi Tobias,
Thanks a lot! That would be most helpful!
Unfortunately I do not have any useful CPU intesive code examples at
hand. I was trying to simulate an RPC procedure that takes some time by
just putting sleep in the function that provides RPC (just imagine it is
not a "sleep", but some data base query!). All components calling that
blocking remote procedure will be waiting in line for the previous call
to finish, if there is only one RPC provider.

Regards,
Rosa

On Monday, March 30, 2015 at 2:36:12 PM UTC-4, Tobias Oberstein wrote:

    Hi Rosa,

    you are right, it is not there:
    https://github.com/tavendo/AutobahnCpp/issues/34
    <https://github.com/tavendo/AutobahnCpp/issues/34>

    I am gonna add that this week (it's easy). I also will hack a C++
    examples that demonstrates "scaling out C++ WAMP components" ..
    because this is exactly one use case of shared regs: scaling out CPU
    intensive stuff.

    Do you have some "CPU intensive, but simple, yet vaguely useful" C++
    function around that I could use for above example?

    Cheers,
    /Tobias

    Am Freitag, 27. März 2015 19:16:26 UTC+1 schrieb Rosa Lisin:

        Hello,
        I am working on backend component for crossbar.io
        <http://crossbar.io> using autobahnCpp. I'd like to take
        advantage of shared RPC registrations, because my RPCs
        potencially can take some time to execute, so I need several
        components (or threads of the same component?) to be able to
        execute multiple RPC calls to the same url. From reading the
        documentation it looks like the shared registration option is
        available, at least in autobahnJS. However, I do not see that
        option in autobahnCpp implementation. It looks like the
        invocation options are hardcoded to none (meaning single
        registration is allowed).
        Please confirm that my understanding is correct.
        Is it possible to implement shared RPC registration using the
        corrent version of autobahnCpp? And if not, arre there any plans
        to implement that feature?

        Thanks a lot.
        Rosa

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/fce4b297-7a23-415f-ab83-1756e277b100%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/fce4b297-7a23-415f-ab83-1756e277b100%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes