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