Merge pull request #19 from riadvice/web-and-akka-apps-update

Web and akka apps update
This commit is contained in:
Richard Alam 2017-06-01 10:26:36 -04:00 committed by GitHub
commit 98f178b985
3 changed files with 30 additions and 24 deletions

View File

@ -69,6 +69,8 @@ On your message terminal, run the following commands. Other components depends o
```
cd ~/dev/bigbluebutton/bbb-common-message/
sbt clean
sbt publish
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.
```
cd dev/bigbluebutton/bbb-apps-common/
cd ~/dev/bigbluebutton/bbb-apps-common/
# Force updating of bbb-commons-message
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
sbt clean
@ -177,6 +179,7 @@ Start bbb-web
gradle clean
gradle resolveDeps
grails clean
sudo chmod -R ugo+rwx /var/log/bigbluebutton
grails -Dserver.port=8888 run-war
```

View File

@ -6,7 +6,7 @@ organization := "org.bigbluebutton"
version := "0.0.1"
scalaVersion := "2.11.6"
scalaVersion := "2.12.2"
scalacOptions ++= Seq(
"-unchecked",
@ -14,7 +14,7 @@ scalacOptions ++= Seq(
"-Xlint",
"-Ywarn-dead-code",
"-language:_",
"-target:jvm-1.7",
"-target:jvm-1.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")
libraryDependencies ++= {
val akkaVersion = "2.3.11"
val akkaVersion = "2.5.1"
Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
@ -46,13 +46,13 @@ libraryDependencies ++= {
"ch.qos.logback" % "logback-classic" % "1.0.3",
"org.pegdown" % "pegdown" % "1.4.0",
"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",
"joda-time" % "joda-time" % "2.3",
"com.google.code.gson" % "gson" % "1.7.1",
"redis.clients" % "jedis" % "2.1.0",
"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"
)}

View File

@ -1,23 +1,25 @@
package org.bigbluebutton.endpoint.redis
import akka.actor.Props
import akka.actor.OneForOneStrategy
import akka.actor.SupervisorStrategy.Resume
import java.io.{ PrintWriter, StringWriter }
import java.io.PrintWriter
import java.io.StringWriter
import java.net.InetSocketAddress
import redis.actors.RedisSubscriberActor
import redis.api.pubsub.{ PMessage, Message }
import scala.concurrent.duration._
import akka.actor.ActorRef
import akka.actor.actorRef2Scala
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.DurationInt
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.messages.PubSubPongMessage
import org.bigbluebutton.freeswitch.pubsub.receivers.RedisMessageReceiver
import akka.actor.ActorSystem
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import akka.actor.OneForOneStrategy
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 {
@ -31,9 +33,10 @@ object AppsRedisSubscriberActor extends SystemConfiguration {
}
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),
channels, patterns) {
channels, patterns, onConnectStatus = connected => { println(s"connected: $connected") }) with SystemConfiguration {
override val supervisorStrategy = OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) {
case e: Exception => {
@ -69,7 +72,7 @@ class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessag
def onPMessage(pmessage: PMessage) {
// log.debug(s"pattern message received: $pmessage")
val msg = decoder.decodeMessage(pmessage.data)
val msg = decoder.decodeMessage(pmessage.data.utf8String)
if (msg != null) {
msg match {
@ -81,7 +84,7 @@ class AppsRedisSubscriberActor(val system: ActorSystem, msgReceiver: RedisMessag
case _ => // do nothing
}
} else {
msgReceiver.handleMessage(pmessage.patternMatched, pmessage.channel, pmessage.data)
msgReceiver.handleMessage(pmessage.patternMatched, pmessage.channel, pmessage.data.utf8String)
}
}