Message from discussion
TCPConsumer only consuming first message
Received: by 10.58.15.10 with SMTP id t10mr3072764vec.6.1352112183387;
Mon, 05 Nov 2012 02:43:03 -0800 (PST)
X-BeenThere: akka-user@googlegroups.com
Received: by 10.52.141.116 with SMTP id rn20ls5077534vdb.5.gmail; Mon, 05 Nov
2012 02:43:00 -0800 (PST)
Received: by 10.58.255.136 with SMTP id aq8mr3021046ved.29.1352112180816;
Mon, 05 Nov 2012 02:43:00 -0800 (PST)
Received: by 10.58.255.136 with SMTP id aq8mr3021045ved.29.1352112180796;
Mon, 05 Nov 2012 02:43:00 -0800 (PST)
Return-Path: <viktor.kl...@gmail.com>
Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48])
by gmr-mx.google.com with ESMTPS id q19si2524022vds.3.2012.11.05.02.42.59
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 05 Nov 2012 02:42:59 -0800 (PST)
Received-SPF: pass (google.com: domain of viktor.kl...@gmail.com designates 209.85.212.48 as permitted sender) client-ip=209.85.212.48;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of viktor.kl...@gmail.com designates 209.85.212.48 as permitted sender) smtp.mail=viktor.kl...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-vb0-f48.google.com with SMTP id e21so6759064vbm.35
for <akka-user@googlegroups.com>; Mon, 05 Nov 2012 02:42:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=ma3U8AYl2CjgSQ/ZE+xKHPrzkg5WG16V/GXRBC8DpwQ=;
b=dMAh8RnoW9O9fbeBu0lmllBVu4qzK4ObSSnNcpabX3CbXh14HpRfbFaqkW9hLVRsFp
can/ZdeOfwUExEc8IPjgbOLnZWnoksroHS8q1NVaLrJLxg3YLWaZb3hwKQexHFfBpmGm
btKtcFB/HT8XY3dkwzREJ+xdAM3x43A5n5KhUUEVuCCDm/sTFSkXFM72mG4pQ98huyjR
sc/GH34hXkHFC0c8PpmBb3RAoeif6hevzUF05gJZk9F06s6NcHFS/mUw0mUI3b2i2Nbr
ongejPocEdzkuNmjL1mBWIR9g2MLi8cdov7+2EVZ/mW/chii/7R7+qlLyxnkNKSWsF7+
2Okw==
MIME-Version: 1.0
Received: by 10.52.100.229 with SMTP id fb5mr7764996vdb.103.1352112179449;
Mon, 05 Nov 2012 02:42:59 -0800 (PST)
Received: by 10.58.207.169 with HTTP; Mon, 5 Nov 2012 02:42:59 -0800 (PST)
In-Reply-To: <50977A52.90...@googlemail.com>
References: <7b2d20c3-560d-459d-b8bd-5576ad737fc4@googlegroups.com>
<509773F3.6050...@googlemail.com>
<CANPzfU9j1QNdgYZoN60Z0GKDiVMumjzuDqfEE_vc7AFqoZC...@mail.gmail.com>
<50977A52.90...@googlemail.com>
Date: Mon, 5 Nov 2012 11:42:59 +0100
Message-ID: <CANPzfU-iTRz24N5r1Z4Xrh1s1wtB7B9pTJFP8fUD+=sEJHi...@mail.gmail.com>
Subject: Re: [akka-user] TCPConsumer only consuming first message
From: =?UTF-8?B?4oiaaWt0b3Ig0qBsYW5n?= <viktor.kl...@gmail.com>
To: Akka User List <akka-user@googlegroups.com>
Content-Type: multipart/alternative; boundary=20cf307f343e270e7704cdbd2654
--20cf307f343e270e7704cdbd2654
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Touch=C3=A9
On Mon, Nov 5, 2012 at 9:35 AM, Martin Krasser <krass...@googlemail.com>wro=
te:
>
> Am 05.11.12 09:32, schrieb =E2=88=9Aiktor =D2=A0lang:
>
> sync is a terrible name for that, if it means "reply=3Dfalse"
>
>
> Agree. Something for the camel mailing list ...
>
>
>
>
> On Mon, Nov 5, 2012 at 9:08 AM, Martin Krasser <krass...@googlemail.com>w=
rote:
>
>> Hi Javier,
>>
>> either add "&sync=3Dfalse" to the consumer endpoint URI (which configure=
s
>> 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 =3D "mina:tcp://localhost:6100?textline=3Dtrue"
>>> protected def receive =3D {
>>> case msg:Message =3D> {
>>> val textReceived =3D 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 =3D
>>> "mina:tcp://localhost:6100?textline=3Dtrue&sync=3Dfalse"
>>> }
>>>
>>>
>>> val service =3D CamelServiceManager.startCamelService
>>> val tcpConsumer =3D actorOf[TcpConsumer]
>>>
>>> service.awaitEndpointActivation(1) {
>>> tcpConsumer.start
>>> }
>>>
>>> val tcpProducer =3D 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-user@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> akka-user+unsubscribe@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/akka-user?hl=3Den.
>>>
>>>
>>>
>> --
>> 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-user@googlegroups.com.
>> To unsubscribe from this group, send email to
>> akka-user+unsubscribe@googlegroups.com.
>> Visit this group at http://groups.google.com/group/akka-user?hl=3Den.
>>
>>
>>
>
>
> --
> Viktor Klang
>
> Akka Tech Lead
> Typesafe <http://www.typesafe.com/> - 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-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user?hl=3Den.
>
>
>
>
> --
> 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-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user?hl=3Den.
>
>
>
--=20
Viktor Klang
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - The software stack for applications
that scale
Twitter: @viktorklang
--20cf307f343e270e7704cdbd2654
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Touch=C3=A9<div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On=
Mon, Nov 5, 2012 at 9:35 AM, Martin Krasser <span dir=3D"ltr"><<a href=
=3D"mailto:krass...@googlemail.com" target=3D"_blank">krass...@googlemail.c=
om</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">
<br>
<div>Am 05.11.12 09:32, schrieb =E2=88=9Aiktor
=D2=A0lang:<br>
</div><div class=3D"im">
<blockquote type=3D"cite">sync is a terrible name for that, if it means
"reply=3Dfalse"</blockquote>
<br></div>
Agree. Something for the camel mailing list ...<div><div class=3D"h5"><=
br>
<br>
<blockquote type=3D"cite">
<div class=3D"gmail_extra"><br>
<br>
<div class=3D"gmail_quote">On Mon, Nov 5, 2012 at 9:08 AM, Martin
Krasser <span dir=3D"ltr"><<a href=3D"mailto:krasserm@googlema=
il.com" target=3D"_blank">krass...@googlemail.com</a>></span>
wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex">Hi Javier,<br>
<br>
either add "&sync=3Dfalse" to the consumer endpoi=
nt URI
(which configures the endpoint for a one-way message
exchange) or reply to the sender with 'self.reply(...)'=
and
your example should work.<br>
<br>
Cheers,<br>
Martin<br>
<br>
Am 04.11.12 13:57, schrieb Javier Teso:
<div>
<div><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
Having defined a consumer as:<br>
<br>
=C2=A0 class TcpConsumer extends Actor with Consumer {<br=
>
=C2=A0 =C2=A0 def endpointUri =3D "mina:tcp://localh=
ost:6100?textline=3Dtrue"<br>
=C2=A0 =C2=A0 protected def receive =3D {<br>
=C2=A0 =C2=A0 =C2=A0 case msg:Message =3D> {<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 val textReceived =3D msg.body=
As[String]<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 println("Message receive=
d: [%s]" format
textReceived )<br>
=C2=A0 =C2=A0 =C2=A0 }<br>
=C2=A0 =C2=A0 }<br>
=C2=A0 }<br>
<br>
<br>
I wonder why it only prints the first message that I
send from my producer.<br>
<br>
class TcpProducer extends Actor with Producer {<br>
=C2=A0 =C2=A0 def endpointUri =3D "mina:tcp://localh=
ost:6100?textline=3Dtrue&sync=3Dfalse"<br>
=C2=A0 }<br>
<br>
<br>
=C2=A0 val service =3D CamelServiceManager.startCamelServ=
ice<br>
=C2=A0 val tcpConsumer =C2=A0 =3D actorOf[TcpConsumer]<br=
>
<br>
=C2=A0 service.awaitEndpointActivation(1) {<br>
=C2=A0 =C2=A0 tcpConsumer.start<br>
=C2=A0 }<br>
<br>
=C2=A0 val tcpProducer =C2=A0 =3D actorOf[TcpProducer]<br=
>
=C2=A0 tcpProducer.start<br>
<br>
=C2=A0 tcpProducer ! "This will be printed by consum=
er"<br>
=C2=A0 tcpProducer ! "But this message will be ignor=
ed"<br>
<br>
Any help is really appreciated.<br>
<br>
Thanks<br>
<br>
-- <br>
>>>>>>>>>> Read the
docs: <a href=3D"http://akka.io/docs/" target=3D"_blank">=
http://akka.io/docs/</a><br>
>>>>>>>>>> Check the
FAQ: <a href=3D"http://akka.io/faq/" target=3D"_blank">ht=
tp://akka.io/faq/</a><br>
>>>>>>>>>> Search the
archives: <a href=3D"https://groups.google.com/group/akka=
-user" target=3D"_blank">https://groups.google.com/group/akka-user</a><br>
---<br>
You received this message because you are subscribed
to the Google Groups "Akka User List" group.<br=
>
To post to this group, send email to <a href=3D"mailto:ak=
ka-user@googlegroups.com" target=3D"_blank">akka-user@googlegroups.com</a>.=
<br>
To unsubscribe from this group, send email to <a href=3D"=
mailto:akka-user%2Bunsubscribe@googlegroups.com" target=3D"_blank">akka-use=
r+unsubscribe@googlegroups.com</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/g=
roup/akka-user?hl=3Den" target=3D"_blank">http://groups.google.com/group/ak=
ka-user?hl=3Den</a>.<br>
<br>
<br>
</blockquote>
<br>
</div>
</div>
<span><font color=3D"#888888">
-- <br>
Martin Krasser<br>
<br>
blog: =C2=A0 =C2=A0<a href=3D"http://krasserm.blogspot.com"=
target=3D"_blank">http://krasserm.blogspot.com</a><br>
code: =C2=A0 =C2=A0<a href=3D"http://github.com/krasserm" t=
arget=3D"_blank">http://github.com/krasserm</a><br>
twitter: <a href=3D"http://twitter.com/mrt1nz" target=3D"_b=
lank">http://twitter.com/mrt1nz</a></font></span>
<div>
<div><br>
<br>
-- <br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0=
0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=3D"margin:0=
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=3D"marg=
in:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=3D"=
margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
=C2=A0 =C2=A0 =C2=A0Read the docs: <a h=
ref=3D"http://akka.io/docs/" target=3D"_blank">http://akka.io/docs/</a><br>
=C2=A0 =C2=A0 =C2=A0Check the FAQ: <a h=
ref=3D"http://akka.io/faq/" target=3D"_blank">http://akka.io/faq/</a><br>
=C2=A0 =C2=A0 =C2=A0Search the archives=
: <a href=3D"https://groups.google.com/group/akka-user" target=3D"_blank">h=
ttps://groups.google.com/group/akka-user</a><br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
--- You received this message because you are subscribed
to the Google Groups "Akka User List" group.<br>
To post to this group, send email to <a href=3D"mailto:akka=
-user@googlegroups.com" target=3D"_blank">akka-user@googlegroups.com</a>.<b=
r>
To unsubscribe from this group, send email to <a href=3D"ma=
ilto:akka-user%2Bunsubscribe@googlegroups.com" target=3D"_blank">akka-user+=
unsubscribe@googlegroups.com</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/gro=
up/akka-user?hl=3Den" target=3D"_blank">http://groups.google.com/group/akka=
-user?hl=3Den</a>.<br>
<br>
<br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear=3D"all">
<div><br>
</div>
-- <br>
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:n=
ormal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-hei=
ght:normal;border-collapse:separate;text-transform:none;font-size:medium;wh=
ite-space:normal;font-family:Times;word-spacing:0px"><span style=3D"font-fa=
mily:arial;font-size:small"><span style=3D"border-collapse:collapse;font-fa=
mily:arial,sans-serif;font-size:13px">Viktor
Klang<br>
<br>
Akka Tech Lead</span>
<div><font face=3D"arial, sans-serif"><span style=3D"border-col=
lapse:collapse"><a href=3D"http://www.typesafe.com/" target=3D"_blank">Type=
safe</a><span>=C2=A0</span>-
</span></font><span>The software stack for applications
that scale</span><br>
<font face=3D"arial, sans-serif"><span style=3D"border-collap=
se:collapse"><br>
</span></font><font face=3D"arial, sans-serif"><span style=
=3D"border-collapse:collapse">Twitter: @viktorklang</span></font></div>
</span></span><br>
</div>
-- <br>
>>>>>>>>>> Read the docs: <a href=3D"ht=
tp://akka.io/docs/" target=3D"_blank">http://akka.io/docs/</a><br>
>>>>>>>>>> Check the FAQ: <a href=3D"ht=
tp://akka.io/faq/" target=3D"_blank">http://akka.io/faq/</a><br>
>>>>>>>>>> Search the archives: <a href=
=3D"https://groups.google.com/group/akka-user" target=3D"_blank">https://gr=
oups.google.com/group/akka-user</a><br>
--- <br>
You received this message because you are subscribed to the Google
Groups "Akka User List" group.<br>
To post to this group, send email to <a href=3D"mailto:akka-user@goog=
legroups.com" target=3D"_blank">akka-user@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to
<a href=3D"mailto:akka-user+unsubscribe@googlegroups.com" target=3D"_=
blank">akka-user+unsubscribe@googlegroups.com</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/group/akka-us=
er?hl=3Den" target=3D"_blank">http://groups.google.com/group/akka-user?hl=
=3Den</a>.<br>
=C2=A0<br>
=C2=A0<br>
</blockquote>
<br>
<pre cols=3D"72">--=20
Martin Krasser
blog: <a href=3D"http://krasserm.blogspot.com" target=3D"_blank">http://=
krasserm.blogspot.com</a>
code: <a href=3D"http://github.com/krasserm" target=3D"_blank">http://gi=
thub.com/krasserm</a>
twitter: <a href=3D"http://twitter.com/mrt1nz" target=3D"_blank">http://twi=
tter.com/mrt1nz</a>
</pre>
</div></div></div><div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
-- <br>
>>>>>>>>>> Read the docs: <a href=3D"htt=
p://akka.io/docs/" target=3D"_blank">http://akka.io/docs/</a><br>
>>>>>>>>>> Check the FAQ: <a href=3D"htt=
p://akka.io/faq/" target=3D"_blank">http://akka.io/faq/</a><br>
>>>>>>>>>> Search the archives: <a href=
=3D"https://groups.google.com/group/akka-user" target=3D"_blank">https://gr=
oups.google.com/group/akka-user</a><br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;Akka User List" group.<br>
To post to this group, send email to <a href=3D"mailto:akka-user@googlegrou=
ps.com" target=3D"_blank">akka-user@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:akka-user%2=
Bunsubscribe@googlegroups.com" target=3D"_blank">akka-user+unsubscribe@goog=
legroups.com</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/group/akka-user?hl=
=3Den" target=3D"_blank">http://groups.google.com/group/akka-user?hl=3Den</=
a>.<br>
=C2=A0<br>
=C2=A0<br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
<span style=3D"border-collapse:separate;color:rgb(0,0,0);font-family:Times;=
font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:nor=
mal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transfo=
rm:none;white-space:normal;word-spacing:0px;font-size:medium"><span style=
=3D"font-family:arial;font-size:small"><span style=3D"border-collapse:colla=
pse;font-family:arial,sans-serif;font-size:13px">Viktor Klang<br>
<br>Akka Tech Lead</span><div><font face=3D"arial, sans-serif"><span style=
=3D"border-collapse:collapse"><a href=3D"http://www.typesafe.com/" target=
=3D"_blank">Typesafe</a><span>=C2=A0</span>- </span></font><span>The softwa=
re stack for applications that scale</span><br>
<font face=3D"arial, sans-serif"><span style=3D"border-collapse:collapse"><=
br></span></font><font face=3D"arial, sans-serif"><span style=3D"border-col=
lapse:collapse">Twitter: @viktorklang</span></font></div></span></span><br>
</div>
--20cf307f343e270e7704cdbd2654--