Skip to content
Snippets Groups Projects
Commit bda8b33b authored by srosse's avatar srosse
Browse files

OO-538: enable the JMS powered event bus for single node

parent 96469050
No related branches found
No related tags found
No related merge requests found
......@@ -196,6 +196,12 @@ public class ClusterEventBus extends AbstractEventBus implements MessageListener
} catch(Error er) {
log.error("Error enountered by serve-thread:", er);
// continue
} finally {
try {
DBFactory.getInstance().commitAndCloseSession();
} catch (Exception e) {
e.printStackTrace();
}
}
}
......@@ -256,7 +262,7 @@ public class ClusterEventBus extends AbstractEventBus implements MessageListener
*/
public void fireEventToListenersOf(MultiUserEvent event, OLATResourceable ores) {
// 1. fire directly within vm, because it used to be so before, and in this way this olat node can run even if jms is down
doFire(event, ores);
//TODO jms doFire(event, ores);
// 2. send the event wrapped over jms to all nodes
// (the receiver will detect whether messages are from itself and thus can be ignored, since they were already sent directly.
......@@ -373,11 +379,11 @@ public class ClusterEventBus extends AbstractEventBus implements MessageListener
// message with destination and source both having this vm are ignored here, since they were already
// "inline routed" when having been sent (direct call within the vm).
if (!fromSameNode) {
//TODO jms if (!fromSameNode) {
// distribute the unmarshalled event to all JVM wide listeners for this channel.
doFire(event, ores);
DBFactory.getInstance(false).commitAndCloseSession();
} // else message already sent "in-vm"
//TODO jms } // else message already sent "in-vm"
// stats
final long doneTime = System.currentTimeMillis();
......
......@@ -18,7 +18,7 @@
</bean>
<bean id="coordinatorManager" class="org.olat.core.util.coordinate.CoordinatorManagerImpl">
<property name="coordinator" ref="org.olat.core.util.coordinate.${cluster.mode}Coordinator"/>
<property name="coordinator" ref="org.olat.core.util.coordinate.ClusterCoordinator"/>
</bean>
......@@ -38,13 +38,14 @@
<property name="eventBus" ref="org.olat.commons.coordinate.cluster.jms.ClusterEventBus" />
<property name="cacher" ref="infinispanCacher"/>
</bean>
<!--
<bean id="org.olat.core.util.coordinate.SingleVMCoordinator" class="org.olat.commons.coordinate.singlevm.SingleVMCoordinator" lazy-init="true">
<property name="syncer" ref="org.olat.commons.coordinate.cluster.ClusterSyncer"/>
<property name="eventBus" ref="org.olat.commons.coordinate.singlevm.SingleVMEventBus"/>
<property name="locker" ref="org.olat.commons.coordinate.singlevm.SingleVMLocker"/>
<property name="cacher" ref="infinispanCacher"/>
</bean>
-->
<bean id="infinispanCacheManager" class="org.olat.core.util.cache.infinispan.InfinispanCacheManager" destroy-method="stop">
<property name="configuration" value="infinispan-config.xml"/>
......@@ -143,13 +144,14 @@ init-method="springInit" destroy-method="stop" lazy-init="true">
</bean>
<bean id="clusterLockManager" class="org.olat.commons.coordinate.cluster.lock.ClusterLockManager"/>
<!--
<bean id="org.olat.commons.coordinate.singlevm.SingleVMEventBus" class="org.olat.commons.coordinate.singlevm.SingleVMEventBus" lazy-init="true"/>
<bean id="org.olat.commons.coordinate.singlevm.SingleVMLocker" class="org.olat.commons.coordinate.singlevm.SingleVMLocker" init-method="init" lazy-init="true">
<property name="eventBus" ref="org.olat.commons.coordinate.singlevm.SingleVMEventBus"/>
<lookup-method name="getPersistentLockManager" bean="persistentLockManager"/>
</bean>
-->
<import resource="classpath:/serviceconfig/org/olat/core/_spring/olatcorejms_${jms.provider}.xml"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment