Hi Martin, I must say I was working with websockets yesterday. And it's delightful experience. Have to check how it does scale but it seams just great.
I have a doubt. Since I'm doing fully async I'm doing fully async request with WebSocketResource. I suppose that there's no way to update the interface from there. I mean, if we are sending a message because a model changed on server. Can I trigger the repain of a widget? I suppose this option is only available if using behavior right? I saw the broadcast example you did. But does it worth mix WebSocketResource and WebSocketBehavior? What is best, more scalable? 1. Doing a WebSocketResource with 1 connection that via Javascript notifies all components in page. 2. Use WebSocketResource + 1 WebSocketBehavior per component, and then broadcast to all. As I told what I'm doing is a Javascript hub that receives messages (via WebSocketResource) and sends to the widgets async so they can update. But I suppose that following this approach it's quite difficult update components from Javascript. And so the opposite. If a component updates it's internal model on server, there's no way to push to the interface. Can I have both? The ability to update components (graphs mainly) from javascript datasource, but from time to time, update components on wicket and send updates to the UI (html)? Best regards, El 06/03/17 a las 09:08, Martin Grigorov escribió: > Hi, > > > On Mon, Mar 6, 2017 at 3:57 AM, Gonzalo Aguilar Delgado < > gagui...@aguilardelgado.com> wrote: > >> Hello, >> >> I'm using the fantastic Decebals dashboard, adding a widget json >> registry and some other improvements. The idea is to provide data >> streaming functionality like the one provided by graphana, kibana and >> friends. >> >> So the server will contain the datasources. And the dashboard will apply >> to one or more datasources on the server. >> >> But I don't know what's the best way to go with wicket. >> >> My first idea is to provide a websocket connection with a DataManager >> for each user dashboard (only 1 at a time active), subscribe to >> datasources, and receive the streaming over the websockets. The >> DataManager then will keep track of what topic each chart wants to >> receive and multiplex the result to each chart via Javascript. >> >> This way there's only 1 connection to the server. But data can be shared >> among widgets. I suppose it's not easy task. >> >> The other way is do ajax with each chart. But I think this would make a >> lot of calls to the server and I suppose it's not scalable. >> >> Soooo. What's the best way to go?! >> > I'd use WebSockets for this! > > >> >> Any good chart integration on wicket apart of highcharts? D3js or >> similar... >> > The demo app for > http://wicketinaction.com/2012/07/wicket-6-native-websockets/ uses Google > Charts library without any Wicket component integration. > > >> >> Preview of the current work is this link: >> >> https://pbs.twimg.com/media/C6M_hG6WYAEeysz.jpg >> >> >> -- Gonzalo Aguilar Delgado *Level2 CRM* Gonzalo Aguilar Delgado Consultor CRM - Ingeniero en Informática M. +34 607 81 42 76 T. +34 918 40 95 78 E. gagui...@level2crm.com <mailto:gagui...@level2crm.com>