-
-
Notifications
You must be signed in to change notification settings - Fork 751
Improving Performance by using the PoolableBroadcasterFactory
Jeanfrancois Arcand edited this page Feb 26, 2015
·
5 revisions
The DefaultBroadcasterFactory
keeps a reference to all created Broadcaster
, and for some applications that heavily creates new Broadcaster
that operation can cause performance issue. If your application creates a lot of Broadcaster, you can take a look at the PoolableBroadcasterFactory
, which can be used to significatly improve throughput of an application. By default, Appache Common Pool2 is used so you need to add
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.3</version>
Next, in your web.xml, define:
<init-param>
<param-name>org.atmosphere.cpr.broadcasterFactory</param-name>
<param-value>org.atmosphere.pool.PoolableBroadcasterFactory</param-value>
</init-param>
By default the PoolableBroadcastFactory
uses an unbounded Apache commons-pool2 implementation. There is also a bounded version.
You can configure or define your own pool by adding in web.xml:
<init-param>
<param-name>org.atmosphere.pool.poolableProvider</param-name>
<param-value>your class that implement org.atmosphere.pool.PoolableProvider</param-value>
</init-param>
The complete implementation can be found here
- 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