Hi Vadim,

good catch, that's a bug in the actor ref resolution in channels. Ticket created <https://www.assembla.com/spaces/akka/tickets/3814-actor-ref-resolution-in-channels-doesn-t-preserve-order>.

Thanks for reporting.

Cheers,
Martin

On 09.01.14 21:17, Vadim Bobrov wrote:
class A extends Processor {

val b = context.actorFor("/user/top/b")
val channel = context.actorOf(Channel.props(ChannelSettings(redeliverInterval = 180 seconds, redeliverMax = 10)), name = "bc")

override def receive = {
case Start =>

for(i <- 1 to 10) {
channel ! Deliver(Persistent(i), b, Resolve.Destination)
println(s"sent $i")
sleep(1 second)
}
}

}

class B extends Processor {

override def receive = {

case p @ ConfirmablePersistent(payload, sequenceNr, redeliveries) =>
println("  B received " + payload.toString)
sleep(3 seconds)
p.confirm()
println("  B confirmed " + payload.toString)
}

}

where

def sleep(time: Duration) {
val start = System.currentTimeMillis()
while(System.currentTimeMillis() - start < time.toMillis) {}
}

And here is what I have in the log:

sent 1
    B received 1
sent 2
sent 3
sent 4
    B confirmed 1
    B received 2
sent 5
sent 6
sent 7
    B confirmed 2
    B received 3
sent 8
sent 9
sent 10
    B confirmed 3
    B received 4
    B confirmed 4
    B received 5
    B confirmed 5
    B received 6
    B confirmed 6
    B received 8
    B confirmed 8
    B received 10
    B confirmed 10
    B received 9
    B confirmed 9
    B received 7
    B confirmed 7

why are the messages 8, 10, 9, 7 coming out-or-order? As I understand there is no redelivery here so they must be in order

Thanks
Vadim
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

--
Martin Krasser

blog:    http://krasserm.blogspot.com
code:    http://github.com/krasserm
twitter: http://twitter.com/mrt1nz

--
     Read the docs: http://akka.io/docs/
     Check the FAQ: http://akka.io/faq/
     Search the archives: https://groups.google.com/group/akka-user
--- You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to