Re: [akka-user] TCPConsumer only consuming first message

43 views
Skip to first unread message

Martin Krasser

unread,
Nov 5, 2012, 3:08:19 AM11/5/12
to akka...@googlegroups.com
Hi Javier,

either add "&sync=false" to the consumer endpoint URI (which configures
the endpoint for a one-way message exchange) or reply to the sender with
'self.reply(...)' and your example should work.

Cheers,
Martin

Am 04.11.12 13:57, schrieb Javier Teso:
> Hi all,
>
> Having defined a consumer as:
>
> class TcpConsumer extends Actor with Consumer {
> def endpointUri = "mina:tcp://localhost:6100?textline=true"
> protected def receive = {
> case msg:Message => {
> val textReceived = msg.bodyAs[String]
> println("Message received: [%s]" format textReceived )
> }
> }
> }
>
>
> I wonder why it only prints the first message that I send from my
> producer.
>
> class TcpProducer extends Actor with Producer {
> def endpointUri = "mina:tcp://localhost:6100?textline=true&sync=false"
> }
>
>
> val service = CamelServiceManager.startCamelService
> val tcpConsumer = actorOf[TcpConsumer]
>
> service.awaitEndpointActivation(1) {
> tcpConsumer.start
> }
>
> val tcpProducer = actorOf[TcpProducer]
> tcpProducer.start
>
> tcpProducer ! "This will be printed by consumer"
> tcpProducer ! "But this message will be ignored"
>
> Any help is really appreciated.
>
> Thanks
>
> --
> >>>>>>>>>> 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 post to this group, send email to akka...@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user?hl=en.
>
>

--
Martin Krasser

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

√iktor Ҡlang

unread,
Nov 5, 2012, 3:32:44 AM11/5/12
to Akka User List
sync is a terrible name for that, if it means "reply=false"


To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
--
     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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.



--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Martin Krasser

unread,
Nov 5, 2012, 3:35:30 AM11/5/12
to akka...@googlegroups.com

Am 05.11.12 09:32, schrieb √iktor Ҡlang:
sync is a terrible name for that, if it means "reply=false"

Agree. Something for the camel mailing list ...



To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
--
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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.



--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

--
>>>>>>>>>> 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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.

√iktor Ҡlang

unread,
Nov 5, 2012, 5:42:59 AM11/5/12
to Akka User List
Touché
Reply all
Reply to author
Forward
0 new messages