Symfony + Thruway (Client) + Crossbar + Beanstalkd ...

#1

Howdy Everyone…

Thanks for working so hard on the WAMP Protocol and related projects. I’m an independent IT & Business consultant. I see Crossbar and WAMP as something I intend to use across multiple of my clients… However, right now I’m working on an implementation for an Aerospace company.

With this Aerospace company, we have a legacy code base, and our new Symfony/PHP code base. Right now we are looking to implement (and I’m in the middle of it) Crossbar as a method of being able to notify anything of events happening in the new Symfony system. This way if the legacy code needs to know about something it can (Legacy code is in Perl / Mason). In the future we are thinking of allowing the Mason code to call into the new system for things such as creating users so we aren’t duplicating that code, as well as it will give the new app control of the users. So we see a lot of potential for Crossbar, but below is how we’re trying to start. We may be over complicating it a bit.

Essentially we need some background tasks to be processed. We think immediately of a message queue, and settled on beanstalkd. As I’m setting up Crossbar, I realize that I could use it as a “task queue”, but I would then need to build on top of it to do so. Unless this part is trivial, I’m thinking of leaving beanstalkd in the mix, and it will publish / subscribe to notifications in Crossbar based on the jobs it’s running. So the first implementation need of Crossbar is to pass job messages around. I could talk directly to the message queue, but I am thinking Crossbar will keep me de-coupled from the queue. Am I headed in the right direction?

We in the future of this project also intend to use Crossbar for notifications, chat, and other real-time features.

I’m trying to use the Thruway client, and I wrote a quick Symfony Console command to attempt to publish something, and I’m using a JavaScript client to “test” my setup and see if I’m receiving the messages. So far I’ve been unable to get the Thruway client to do anything useful so I’m unable to tell if I have Crossbar setup appropriately. I am able to connect the Autobahn|JS client to the Crossbar instance. However, I’m not able to see/do anything.

Any thoughts or help appreciated… I realize that this configuration isn’t good for production, but this is my configuration.

There is a major need for better documentation and tutorials on how to setup Crossbar and get it working in different scenarios. Especially the common scenarios that it might be used for. I really don’t want/need the advanced stuff of Crossbar like using it as a web server and it would seem to me that ALL of your examples and inits use it as a web server.

Also, we are potentially interested in Commercial Support as it would almost seem that without it we will just be bumbling around in the dark, and we need to get this to production ASAP. If we are unable to get it figured, or the Commercial Support isn’t manageable we will not be able to use Crossbar in this project. I hope that doesn’t happen as I want to use Crossbar, but so far the learning curve to even start is pretty high.

Thanks again for all the efforts!

Jarvis

0 Likes

#2

I realize I didn’t actually attach my configuration…

{

“version”: 2,

“controller”: {},

“workers”: [

{

“type”: “router”,

“realms”: [

{

“name”: “realm1”,

“roles”: [

{

“name”: “anonymous”,

“permissions”: [

{

“uri”: “”,

“match”: “prefix”,

“allow”: {

“call”: true,

“register”: true,

“publish”: true,

“subscribe”: true

},

“disclose”: {

“caller”: false,

“publisher”: false

},

“cache”: true

}

]

}

]

}

],

“transports”: [

{

“type”: “universal”,

“endpoint”: {

“type”: “tcp”,

“port”: 8080

},

“rawsocket”: {

},

“websocket”: {

“ws”: {

“type”: “websocket”

}

}

}

]

}

]

}

``

Again the Autobahn|JS client does connect to the Crossbar instance.

Thanks!

0 Likes

#3

BTW, I have reached out to Crossbar.io PLUS to start the discussions of commercial level support!

0 Likes

#4

Could you post the client-side JS code you’re using to connect?

···

On Wednesday, 19 April 2017 19:11:13 UTC+2, Jarvis Stubblefield wrote:

BTW, I have reached out to Crossbar.io PLUS to start the discussions of commercial level support!

0 Likes

#5

The JavaScript isn’t my issue, but here’s the plunkr that you can get working with your own Crossbar instance. It does use someone’s CDN of Autobahn on a free CDN so please be aware of that. If you have your own hosted version, then you should likely use that so it’s the same version and the exact Autobahn you expect it to be.

Here’s the link: http://plnkr.co/edit/aMDpflr0eOqhCzXVcQIg?p=preview

0 Likes

#6

Okay… so I have gotten further…

I was able to get the ThruwayBundle to connect, but I had to supply my own Client. I couldn’t just use the “configured” one. There’s not enough documentation on the ThruwayBundle to know what it provides and how to get it to work.

I figured out part of my issue was DNS Resolving. I’ve fixed that in my own client version by using the PHP function gethostbyname. However, I went a step further, and added the URLs as ENV variables in my Docker Containers. So it’s resolved the DNS before it even gets placed into the Symfony configuration.

So now I’m stuck not understanding further on the ThruwayBundle. I have created a service and annotated one of the methods as a subscriber. I never see Thruway even attempting to connect to my server.

Please any help is appreciated!

0 Likes

#7

Are you able to publish events using the JS client?

0 Likes

#8

Adam,

Yes I’m able to get events from and to the JavaScript, and now that I have figured out with the ThruwayBundle I need to start a worker … (I was confused by the term ‘worker’ when in my head workers are on configured on crossbar) to publish and subscribe via Thruway. There was also an issue with DNS resolution of the docker container names necessary for configuration. I was able to use PHP’s gethostbyname() method to resolve that for me.

Are you already successfully running Crossbar or WAMP Router + x?

Thanks,

Jarvis

···

On Thursday, April 20, 2017 at 10:25:18 PM UTC-5, Adam Jorgensen wrote:

Are you able to publish events using the JS client?

0 Likes

#9

Yes, I have a running Crossbar system but it's all Python and JS so I can't help much with your Thruway issues.

It sounds like either your Thruway based components are not running or connecting properly. I'd suggest debugging them.

I'd also try getting things running without Docker. I find it tends to makes things more complex rather than less so...

0 Likes

#10

Adam,

Thank you for your continued efforts to help me move my project forward. I have been successful. I will be writing a ‘blog’ or something that describes the issues I’ve run into and how I’ve solved them. Then I’ll link it here.

Thankfully Docker is something I’ve been able to figure out how to bend to my will so it’s not been the complex part… :slight_smile:

It ended up being more about a lack of documentation of the Crossbar and Thruway projects. More on the Thruway side since I was able to get Crossbar up and running. I’m pretty sure the author of the Thruway system is now working with or for Crossbar.

Thanks!

Jarvis

···

On Saturday, April 22, 2017 at 5:33:13 AM UTC-5, Adam Jorgensen wrote:

Yes, I have a running Crossbar system but it’s all Python and JS so I can’t help much with your Thruway issues.
It sounds like either your Thruway based components are not running or connecting properly. I’d suggest debugging them.

I’d also try getting things running without Docker. I find it tends to makes things more complex rather than less so…

0 Likes