Shared registration AutobahnCpp

57 views
Skip to first unread message

Rosa Lisin

unread,
Mar 27, 2015, 2:16:26 PM3/27/15
to autob...@googlegroups.com
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

Tobias Oberstein

unread,
Mar 30, 2015, 2:36:12 PM3/30/15
to autob...@googlegroups.com
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

Rosa Lisin

unread,
Mar 30, 2015, 2:57:12 PM3/30/15
to autob...@googlegroups.com
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

Dave Barndt

unread,
Mar 30, 2015, 3:27:05 PM3/30/15
to autob...@googlegroups.com
Hi Tobias,

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

Thanks,
Dave

Tobias Oberstein

unread,
Mar 30, 2015, 4:03:03 PM3/30/15
to autob...@googlegroups.com
Am 30.03.2015 um 21:27 schrieb Dave Barndt:
> 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.

> 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.

Dave Barndt

unread,
Mar 30, 2015, 4:55:44 PM3/30/15
to autob...@googlegroups.com
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

Tobias Oberstein

unread,
Mar 30, 2015, 6:28:30 PM3/30/15
to autob...@googlegroups.com
Am 30.03.2015 um 22:55 schrieb Dave Barndt:
> 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


>
> 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>.

Tobias Oberstein

unread,
Apr 4, 2015, 4:40:47 PM4/4/15
to autob...@googlegroups.com
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
> <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>.
Reply all
Reply to author
Forward
0 new messages