Here an exemple that I would want to make : a web page html which will display e.g. CPU or/and RAM ressources of several servers.
So I thought doing my application like this : one server using Jmxtrans or something like this which will POST on an Atmoshere's server which will redirect the information to the client.
Since the design of applications in the Atmosphere samples are like this :
1. User post some data
2. Server receives data
3. Server resend data
4. users receive data
Here this would be more like this :
1. Server sends data
2. users receive data
That's why I thought using a daemon like jmxtrans to send data as the only user who will be able to POST. But I'm not sure if there is a prettier way to do this.
Otherwise if I want the Atmosphere server to send the data by itself how do I tell him he has to send the data , regardless the method used (websocket, long pulling, etc) like in the pubsub sample ? I have to call an overrided AtmosphereServlet class in my application and use a modified onMessage() method ?
Do you have some pieces of advice ?
I'm not sure if I understand your question, but sending data to the active clients is done by using the Broadcaster.
On Wed, Jul 20, 2011 at 3:35 PM, ltribolet <[hidden email]> wrote:
In reply to this post by ltribolet
I think I understand what you asked.. So you got two servers, one running jmxtrans and another running atmosphere. Jmstrans server will post results periodically to the atmosphere server by POST on a specific topic, following a pub/sub model where the subscribed clients will received notifications, right? Your approach definitely works... but is it a requirement to have two isolated servers? If yes.... I personally don't like two java servers communicating via HTTP Post, you could use several technologies, like JMS, where the atmosphere server hosts a jms Queue and the jmxtrans can lookup that queue and publish your monitorization. Ofc this depends on what application server you are using, and how much complexity you are willing to accept.
But if you can have mix the jmxtrans and atmosphere into one single server, it would be the cleanest way... since you would only have to lookup the topic broadcaster using the BroadcasterFactory (jmxtrans module classloader must have visibility to the atmosphere module).
I hope I answer your question.
On Wed, Jul 20, 2011 at 2:35 PM, ltribolet <[hidden email]> wrote:
Sorry for late reply. Thanks to the two of you for replying me.
Cunha has understood very well what I meant. However since last time I've modified a bit my method.
Now I have one server Collectd which collects data from other servers. It collects data from my JVM with JMX and MBeans.
By using the pubsub model, Collectd sends Json data over my Atmosphere application with HTTP Post and Atmosphere will send data to all users connected.
But the Post data has no form param and it's pure Json so I've modified the JQueryPubSub class like this :
And my jQuery script is like this :
I made auto connection to the server via GET method which is working good.
I can see the Json data coming when I run in debug mode but the clients in web browser receives nothing.
So here I am so far.
|Free forum by Nabble||Edit this page|