-
-
Notifications
You must be signed in to change notification settings - Fork 750
Configuring Atmosphere for the Cloud
An Atmosphere Application can be deployed on the cloud and/or inside a cluster. All you need to do to is to set the appropriate Broadcaster in web/application.xml.
By default, Atmosphere is using the DefaultBroadcaster, which only broadcast events in memory. Enabling one of the Broadcaster described below allow servers/nodes to communicate events between them, e.g when a broadcast operation occurs in on server, the event will also be distributed to other servers. To enable cluster/cloud broadcast, add the following:
<param-name>org.atmosphere.cpr.broadcasterClass</param-name>
<param-value> --- Broadcaster Name --- </param-value>
or add the jar in your classpath and Atmosphere will auto discover it.
The available Broadcasters are:
- JMSBroadcaster: allow events to be broadcasted using JMS implementation like ActiveMQ.
- XMPPBroadcaster: Use the XMPP protocol to broadcast events across multiple server. For example, a GMail account can be used to distribute events (because the GMail chat supports XMPP)
- HazelcastBroadcaster : allow events to be broadcasted using the Hazelcast framework.
- [RedisBroadcaster] (https://github.com/Atmosphere/atmosphere-extensions/blob/master/redis/modules/src/main/java/org/atmosphere/plugin/redis/RedisBroadcaster.java#L36): allow events to be broadcasted using the Redis pubsub API.
- JGroupsBroadcaster: allow events to be broadcasted using the JGroups framework.
- RMIBroadcaster: alow events to be broadcasted using the RMI protocol.
- KafkaBroadcaster : allow events to be broadcasted via the Kafka broker.
BroadcasterCache delivers message broadcasted before the client reconnects. Using a BroadcasterCache will guarantee that no message will be lost. The framework comes with its default reference implementation which is UUIDBroadcasterCache. If atmosphere is clustered, then you need to provide a mechanism that updates the cache when a broadcast is sent from another server.
AtmosphereResourceSession provide a simple way to bind properties to an atmosphere resource (identified with a UUID). The DefaultAtmosphereResourceSession provided by atmosphere is based on a memory map and is not reflected to other JVM running an Atmosphere instance. Make sure you are not using any session in your application, otherwise, you need to implement a replication mechanism.
- Understanding Atmosphere
- Understanding @ManagedService
- Using javax.inject.Inject and javax.inject.PostConstruct annotation
- Understanding Atmosphere's Annotation
- Understanding AtmosphereResource
- Understanding AtmosphereHandler
- Understanding WebSocketHandler
- Understanding Broadcaster
- Understanding BroadcasterCache
- Understanding Meteor
- Understanding BroadcastFilter
- Understanding Atmosphere's Events Listeners
- Understanding AtmosphereInterceptor
- Configuring Atmosphere for Performance
- Understanding JavaScript functions
- Understanding AtmosphereResourceSession
- Improving Performance by using the PoolableBroadcasterFactory
- Using Atmosphere Jersey API
- Using Meteor API
- Using AtmosphereHandler API
- Using Socket.IO
- Using GWT
- Writing HTML5 Server-Sent Events
- Using STOMP protocol
- Streaming WebSocket messages
- Configuring Atmosphere's Classes Creation and Injection
- Using AtmosphereInterceptor to customize Atmosphere Framework
- Writing WebSocket sub protocol
- Configuring Atmosphere for the Cloud
- Injecting Atmosphere's Components in Jersey
- Sharing connection between Browser's windows and tabs
- Understanding AtmosphereResourceSession
- Manage installed services
- Server Side: javadoc API
- Server Side: atmosphere.xml and web.xml configuration
- Client Side: atmosphere.js API