Merge pull request #19 from riadvice/web-and-akka-apps-update
Web and akka apps update
This commit is contained in:
commit
98f178b985
@ -69,6 +69,8 @@ On your message terminal, run the following commands. Other components depends o
|
|||||||
|
|
||||||
```
|
```
|
||||||
cd ~/dev/bigbluebutton/bbb-common-message/
|
cd ~/dev/bigbluebutton/bbb-common-message/
|
||||||
|
sbt clean
|
||||||
|
|
||||||
sbt publish
|
sbt publish
|
||||||
sbt publishLocal
|
sbt publishLocal
|
||||||
```
|
```
|
||||||
@ -80,7 +82,7 @@ We've split bbb-apps into bbb-apps-common and bigbluebutton-apps. We need to bui
|
|||||||
On your apps-common terminal, build the bbb-apps-common component.
|
On your apps-common terminal, build the bbb-apps-common component.
|
||||||
|
|
||||||
```
|
```
|
||||||
cd dev/bigbluebutton/bbb-apps-common/
|
cd ~/dev/bigbluebutton/bbb-apps-common/
|
||||||
|
|
||||||
# Force updating of bbb-commons-message
|
# Force updating of bbb-commons-message
|
||||||
sbt clean
|
sbt clean
|
||||||
@ -145,7 +147,7 @@ On your common-web terminal, run these commands
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
cd dev/bigbluebutton/bbb-common-web/
|
cd ~/dev/bigbluebutton/bbb-common-web/
|
||||||
|
|
||||||
# Force updating of dependencies especially bbb-commons-message
|
# Force updating of dependencies especially bbb-commons-message
|
||||||
sbt clean
|
sbt clean
|
||||||
@ -177,6 +179,7 @@ Start bbb-web
|
|||||||
gradle clean
|
gradle clean
|
||||||
gradle resolveDeps
|
gradle resolveDeps
|
||||||
grails clean
|
grails clean
|
||||||
|
sudo chmod -R ugo+rwx /var/log/bigbluebutton
|
||||||
grails -Dserver.port=8888 run-war
|
grails -Dserver.port=8888 run-war
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ organization := "org.bigbluebutton"
|
|||||||
|
|
||||||
version := "0.0.1"
|
version := "0.0.1"
|
||||||
|
|
||||||
scalaVersion := "2.11.6"
|
scalaVersion := "2.12.2"
|
||||||
|
|
||||||
scalacOptions ++= Seq(
|
scalacOptions ++= Seq(
|
||||||
"-unchecked",
|
"-unchecked",
|
||||||
@ -14,7 +14,7 @@ scalacOptions ++= Seq(
|
|||||||
"-Xlint",
|
"-Xlint",
|
||||||
"-Ywarn-dead-code",
|
"-Ywarn-dead-code",
|
||||||
"-language:_",
|
"-language:_",
|
||||||
"-target:jvm-1.7",
|
"-target:jvm-1.8",
|
||||||
"-encoding", "UTF-8"
|
"-encoding", "UTF-8"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "html", "console",
|
|||||||
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/scalatest-reports")
|
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/scalatest-reports")
|
||||||
|
|
||||||
libraryDependencies ++= {
|
libraryDependencies ++= {
|
||||||
val akkaVersion = "2.3.11"
|
val akkaVersion = "2.5.1"
|
||||||
Seq(
|
Seq(
|
||||||
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
|
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
|
||||||
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
|
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
|
||||||
@ -46,13 +46,13 @@ libraryDependencies ++= {
|
|||||||
"ch.qos.logback" % "logback-classic" % "1.0.3",
|
"ch.qos.logback" % "logback-classic" % "1.0.3",
|
||||||
"org.pegdown" % "pegdown" % "1.4.0",
|
"org.pegdown" % "pegdown" % "1.4.0",
|
||||||
"junit" % "junit" % "4.11",
|
"junit" % "junit" % "4.11",
|
||||||
"com.etaty.rediscala" %% "rediscala" % "1.4.0",
|
"com.github.etaty" % "rediscala_2.12" % "1.8.0",
|
||||||
"commons-codec" % "commons-codec" % "1.10",
|
"commons-codec" % "commons-codec" % "1.10",
|
||||||
"joda-time" % "joda-time" % "2.3",
|
"joda-time" % "joda-time" % "2.3",
|
||||||
"com.google.code.gson" % "gson" % "1.7.1",
|
"com.google.code.gson" % "gson" % "1.7.1",
|
||||||
"redis.clients" % "jedis" % "2.1.0",
|
"redis.clients" % "jedis" % "2.1.0",
|
||||||
"org.apache.commons" % "commons-lang3" % "3.2",
|
"org.apache.commons" % "commons-lang3" % "3.2",
|
||||||
"org.bigbluebutton" % "bbb-common-message" % "0.0.19-SNAPSHOT",
|
"org.bigbluebutton" % "bbb-common-message_2.12" % "0.0.19-SNAPSHOT",
|
||||||
"org.bigbluebutton" % "bbb-fsesl-client" % "0.0.4"
|
"org.bigbluebutton" % "bbb-fsesl-client" % "0.0.4"
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -1,23 +1,25 @@
|
|||||||
package org.bigbluebutton.endpoint.redis
|
package org.bigbluebutton.endpoint.redis
|
||||||
|
|
||||||
import akka.actor.Props
|
import java.io.PrintWriter
|
||||||
import akka.actor.OneForOneStrategy
|
import java.io.StringWriter
|
||||||
import akka.actor.SupervisorStrategy.Resume
|
|
||||||
import java.io.{ PrintWriter, StringWriter }
|
|
||||||
import java.net.InetSocketAddress
|
import java.net.InetSocketAddress
|
||||||
import redis.actors.RedisSubscriberActor
|
|
||||||
import redis.api.pubsub.{ PMessage, Message }
|
import scala.concurrent.ExecutionContext.Implicits.global
|
||||||
import scala.concurrent.duration._
|
import scala.concurrent.duration.DurationInt
|
||||||
import akka.actor.ActorRef
|
|
||||||
import akka.actor.actorRef2Scala
|
|
||||||
import org.bigbluebutton.SystemConfiguration
|
import org.bigbluebutton.SystemConfiguration
|
||||||
import org.bigbluebutton.freeswitch.pubsub.receivers.RedisMessageReceiver
|
|
||||||
import redis.api.servers.ClientSetname
|
|
||||||
import org.bigbluebutton.common.converters.FromJsonDecoder
|
import org.bigbluebutton.common.converters.FromJsonDecoder
|
||||||
import org.bigbluebutton.common.messages.PubSubPongMessage
|
import org.bigbluebutton.common.messages.PubSubPongMessage
|
||||||
|
import org.bigbluebutton.freeswitch.pubsub.receivers.RedisMessageReceiver
|
||||||
|
|
||||||
import akka.actor.ActorSystem
|
import akka.actor.ActorSystem
|
||||||
import scala.concurrent.duration._
|
import akka.actor.OneForOneStrategy
|
||||||
import scala.concurrent.ExecutionContext.Implicits.global
|
import akka.actor.Props
|
||||||
|
import akka.actor.SupervisorStrategy.Resume
|
||||||
|
import redis.actors.RedisSubscriberActor
|
||||||
|
import redis.api.pubsub.Message
|
||||||
|
import redis.api.pubsub.PMessage
|
||||||
|
import redis.api.servers.ClientSetname
|
||||||
|
|
||||||
object AppsRedisSubscriberActor extends SystemConfiguration {
|
object AppsRedisSubscriberActor extends SystemConfiguration {
|
||||||
|
|
||||||
@ -31,9 +33,10 @@ object AppsRedisSubscriberActor extends SystemConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessageReceiver, redisHost: String,
|
class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessageReceiver, redisHost: String,
|
||||||
redisPort: Int, channels: Seq[String] = Nil, patterns: Seq[String] = Nil)
|
redisPort: Int,
|
||||||
|
channels: Seq[String] = Nil, patterns: Seq[String] = Nil)
|
||||||
extends RedisSubscriberActor(new InetSocketAddress(redisHost, redisPort),
|
extends RedisSubscriberActor(new InetSocketAddress(redisHost, redisPort),
|
||||||
channels, patterns) {
|
channels, patterns, onConnectStatus = connected => { println(s"connected: $connected") }) with SystemConfiguration {
|
||||||
|
|
||||||
override val supervisorStrategy = OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) {
|
override val supervisorStrategy = OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) {
|
||||||
case e: Exception => {
|
case e: Exception => {
|
||||||
@ -69,7 +72,7 @@ class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessag
|
|||||||
def onPMessage(pmessage: PMessage) {
|
def onPMessage(pmessage: PMessage) {
|
||||||
// log.debug(s"pattern message received: $pmessage")
|
// log.debug(s"pattern message received: $pmessage")
|
||||||
|
|
||||||
val msg = decoder.decodeMessage(pmessage.data)
|
val msg = decoder.decodeMessage(pmessage.data.utf8String)
|
||||||
|
|
||||||
if (msg != null) {
|
if (msg != null) {
|
||||||
msg match {
|
msg match {
|
||||||
@ -81,7 +84,7 @@ class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessag
|
|||||||
case _ => // do nothing
|
case _ => // do nothing
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msgReceiver.handleMessage(pmessage.patternMatched, pmessage.channel, pmessage.data)
|
msgReceiver.handleMessage(pmessage.patternMatched, pmessage.channel, pmessage.data.utf8String)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user