Skip to content

Commit f47cce7

Browse files
author
Reinier Lamers
committed
Fix docs and remove deprecation warnings for Akka 2.4
1 parent 71ebb2e commit f47cce7

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ libraryDependencies += "com.thenewmotion.akka" %% "akka-rabbitmq" % "1.2.4"
4242
<dependency>
4343
<groupId>com.thenewmotion.akka</groupId>
4444
<artifactId>akka-rabbitmq_{2.10/2.11}</artifactId>
45-
<version>1.2.4</version>
45+
<!-- use version 2.0 for Akka 2.4.x, or 1.2.7 for Akka 2.3.x -->
46+
<version>2.0</version>
4647
</dependency>
4748
```
4849

build.sbt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
import tnm.ScalaVersion
2+
13
organization := "com.thenewmotion.akka"
24
name := "akka-rabbitmq"
35

46
enablePlugins(OssLibPlugin)
57

8+
crossScalaVersions := Seq(ScalaVersion.curr)
9+
610
licenses := Seq(("Apache License, Version 2.0", url("http://www.apache.org/licenses/LICENSE-2.0")))
711
homepage := Some(new URL("https://github.com/thenewmotion/akka-rabbitmq"))
812

src/main/scala/com/thenewmotion/akka/rabbitmq/examples/ConfirmsExample.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import akka.pattern.ask
66
import akka.util.Timeout
77
import com.rabbitmq.client.{ MessageProperties, ConfirmListener }
88
import scala.collection.mutable
9-
import scala.concurrent.ExecutionContext
9+
import scala.concurrent.{ Await, ExecutionContext }
1010
import scala.concurrent.duration._
1111

1212
/**
@@ -100,8 +100,7 @@ object ConfirmsExample extends App {
100100
/* --- Letting the app run --- */
101101

102102
Thread.sleep(7000)
103-
system.shutdown()
104-
system.awaitTermination()
103+
Await.result(system.terminate(), 1.second)
105104

106105
System.out.println(s"Unconfirmed messages: ${unconfirmed.mkString(", ")}")
107106
}

src/main/scala/com/thenewmotion/akka/rabbitmq/examples/TutorialInComparisons.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package com.thenewmotion.akka.rabbitmq
22
package examples
33

44
import akka.actor.{ Actor, ActorRef, Props, ActorSystem }
5+
import scala.concurrent.Await
6+
import scala.concurrent.duration._
57

68
/**
79
* @author Yaroslav Klymko
@@ -74,9 +76,9 @@ class TutorialInComparisons(implicit system: ActorSystem) {
7476
channel.close()
7577
}
7678

77-
{
79+
Await.result({
7880
system stop channelActor
7981
system stop connectionActor // will close all channels associated with this connections
80-
system.shutdown()
81-
}
82+
system.terminate()
83+
}, 5.seconds)
8284
}

0 commit comments

Comments
 (0)