-
-
Notifications
You must be signed in to change notification settings - Fork 750
Clustering Atmosphere using Apache TomEE and ActiveMQ
Jeanfrancois Arcand edited this page Jun 27, 2014
·
5 revisions
Clustering Atmosphere using Apache TomEE and ActiveMQ is ssssimple. First, just install Apache TomEE, which, fortunalty for us, comes with ActiveMQ!.
Just edit conf/tomee.xml
and add
<Resource id="atmosphere" type="javax.jms.Topic" />
<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
BrokerXmlConfig = broker:(tcp://0.0.0.0:61616)
ServerUrl = vm://localhost
</Resource>
<Resource id="atmosphereFactory" type="javax.jms.ConnectionFactory">
ResourceAdapter = MyJmsResourceAdapter
</Resource>
First, add in pom.xml
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-jms</artifactId>
<version>2.X</version>
</dependency>
Next in web.xml
or atmosphere.xml
<init-param>
<param-name>org.atmosphere.plugin.jms.JMSBroadcaster.JNDINamespace</param-name>
<param-value>java:comp/env/jms/</param-value>
</init-param>
And finally, add in web.xml
<resource-ref>
<res-ref-name>jms/atmosphereFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<res-ref-name>jms/atmosphere</res-ref-name>
<res-type>javax.jms.Topic</res-type>
<res-auth>Container</res-auth>
</resource-ref>
That's it!
- 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