[akka-user][deprecated] Re: [akka-user] Re: akka-http web socket issue

2018-08-14 Thread vauldex . eblangga
I will re-open this issue because I am having problems regarding 
`s2.ripple.com`'s reply. 


I was able to connect using either `webSocketClientFlow` and 
`singleWebSocketRequest`.


Having code block as my outgoing message:

```
val outgoing: Source[TextMessage.Streamed, NotUsed] =
  Source.single(TextMessage.Streamed(Source(List("""{"command": 
"subscribe", "stream": "transactions"}"""
```

I was expecting a `TextMessage.Streamed` reply but it replied a 
`TextMessage.Strict` message, naturally this command `{"command": 
"subscribe", "stream": "transactions"}` when sent to `s2.ripple.com` would 
return a stream of data, but it only replies a single message after message 
is sent.

Thanks in advance and God bless.



-- 
*
** New discussion forum: https://discuss.akka.io/ replacing akka-user 
google-group soon.
** This group will soon be put into read-only mode, and replaced by 
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*
>> 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: akka-http web socket issue

2016-07-21 Thread Konrad Malawski
Yes it works. What's wrong about Streamed?
That's a feature that it's streaming the data – consume it using the
dataBytes contained in the Streamed message.

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 21 July 2016 at 10:45:03, allobi...@gmail.com (allobi...@gmail.com)
wrote:

does this work when receiving large json data..? i have problem receiving
large json data because sometimes it returns TextMessage.Streamed instead
of TextMessage.Strict and another issue is when connecting to wss://
s2.ripple.com:443 i can't connect using this url but can connect to other
websocket servers..

On Thursday, July 7, 2016 at 6:34:02 AM UTC+8, Eric Swenson wrote:
>
> I wrote a simple python client:
>
> $ cat ws-test.py
> import os
> from websocket import create_connection
>
> eiid=os.getenv("EIID")
> token=os.getenv("BEARER_TOKEN")
> header="Authorization: Bearer %s" % token
> ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid,
> header=[header])
> while True:
> x = ws.recv()
> print(x)
>
> And used it with my server.  It does not disconnect and correctly responds
> to all messages sent by the server.  So that rules out problems with the
> akka-http-based server.  it would appear that the issue is with the
> akka-http client (whose code I got from this web page:
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>
>
> Is there some reason why this code does not work?  As mentioned
> previously, the code connects, retrieves and displays one message sent by
> the server just after connection, and then promptly disconnects the
> websocket connection.
>
> Are there known issues with client-side web socket support in 2.4.7?
>
> — Eric
>
> --
>> Read the docs: http://akka.io/docs/
>> Check the FAQ:
http://doc.akka.io/docs/akka/current/additional/faq.html
>> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: akka-http web socket issue

2016-07-21 Thread allobiano
does this work when receiving large json data..? i have problem receiving 
large json data because sometimes it returns TextMessage.Streamed instead 
of TextMessage.Strict and another issue is when connecting 
to wss://s2.ripple.com:443 i can't connect using this url but can connect 
to other websocket servers..

On Thursday, July 7, 2016 at 6:34:02 AM UTC+8, Eric Swenson wrote:
>
> I wrote a simple python client:
>
> $ cat ws-test.py
> import os
> from websocket import create_connection
>
> eiid=os.getenv("EIID")
> token=os.getenv("BEARER_TOKEN")
> header="Authorization: Bearer %s" % token
> ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid, 
> header=[header])
> while True:
> x = ws.recv()
> print(x)
>
> And used it with my server.  It does not disconnect and correctly responds 
> to all messages sent by the server.  So that rules out problems with the 
> akka-http-based server.  it would appear that the issue is with the 
> akka-http client (whose code I got from this web page:
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>
>
> Is there some reason why this code does not work?  As mentioned 
> previously, the code connects, retrieves and displays one message sent by 
> the server just after connection, and then promptly disconnects the 
> websocket connection.
>
> Are there known issues with client-side web socket support in 2.4.7?
>
> — Eric
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: akka-http web socket issue

2016-07-21 Thread allobiano
does this work when receiving large json data ?

On Thursday, July 7, 2016 at 6:34:02 AM UTC+8, Eric Swenson wrote:
>
> I wrote a simple python client:
>
> $ cat ws-test.py
> import os
> from websocket import create_connection
>
> eiid=os.getenv("EIID")
> token=os.getenv("BEARER_TOKEN")
> header="Authorization: Bearer %s" % token
> ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid, 
> header=[header])
> while True:
> x = ws.recv()
> print(x)
>
> And used it with my server.  It does not disconnect and correctly responds 
> to all messages sent by the server.  So that rules out problems with the 
> akka-http-based server.  it would appear that the issue is with the 
> akka-http client (whose code I got from this web page:
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>
>
> Is there some reason why this code does not work?  As mentioned 
> previously, the code connects, retrieves and displays one message sent by 
> the server just after connection, and then promptly disconnects the 
> websocket connection.
>
> Are there known issues with client-side web socket support in 2.4.7?
>
> — Eric
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: akka-http web socket issue

2016-07-11 Thread Akka Team
I have created a ticket for updating the docs about the client example
mentioned:
https://github.com/akka/akka/issues/20938

As always, contributions are welcome!

--
Johan

On Thu, Jul 7, 2016 at 7:42 PM, Eric Swenson  wrote:

> Thanks, Giovanni. That was precisely the problem and while I didn't see
> the article you quoted, I "fixed" the problem on my end by having my client
> use a Source.fromFuture of a promise which I didn't complete.  I'll switch
> to using the approach in the article you referenced.  Still, I think there
> will be lots of people who may use the web socket client in the
> documentation as a starting point. They will expect that the client will
> continue to display messages received from the service while the client is
> running.  I think the example should either a) document that the client
> closes after processing a single message and how to make it maintain the
> web socket connection open, or better, in my opinion, b) use Source.maybe
> to ensure the connection doesn't close.
>
> On a related note, if the web socket server side is implemented using
> akka-http, the example still closes the connection after 1 minute due to
> the server side's not having gotten any TCP packets over the connection.
> The documentation should either a) include a description of how to change
> this timeout or b) have the client include heartbeat logic to keep the
> connection alive.
>
> -- Eric
>
> On Thursday, July 7, 2016 at 3:10:54 AM UTC-7, Giovanni Alberto
> Caporaletti wrote:
>>
>> Are you keeping the outbound client flow open?
>>
>>
>> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#Half-Closed_WebSockets
>>
>>
>>> --
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: akka-http web socket issue

2016-07-07 Thread Eric Swenson
Thanks, Giovanni. That was precisely the problem and while I didn't see the 
article you quoted, I "fixed" the problem on my end by having my client use 
a Source.fromFuture of a promise which I didn't complete.  I'll switch to 
using the approach in the article you referenced.  Still, I think there 
will be lots of people who may use the web socket client in the 
documentation as a starting point. They will expect that the client will 
continue to display messages received from the service while the client is 
running.  I think the example should either a) document that the client 
closes after processing a single message and how to make it maintain the 
web socket connection open, or better, in my opinion, b) use Source.maybe 
to ensure the connection doesn't close.

On a related note, if the web socket server side is implemented using 
akka-http, the example still closes the connection after 1 minute due to 
the server side's not having gotten any TCP packets over the connection. 
The documentation should either a) include a description of how to change 
this timeout or b) have the client include heartbeat logic to keep the 
connection alive.  

-- Eric

On Thursday, July 7, 2016 at 3:10:54 AM UTC-7, Giovanni Alberto Caporaletti 
wrote:
>
> Are you keeping the outbound client flow open? 
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#Half-Closed_WebSockets
>
>
>>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: akka-http web socket issue

2016-07-07 Thread Giovanni Alberto Caporaletti
Are you keeping the outbound client flow open? 

http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#Half-Closed_WebSockets

On Thursday, 7 July 2016 00:34:02 UTC+2, Eric Swenson wrote:
>
> I wrote a simple python client:
>
> $ cat ws-test.py
> import os
> from websocket import create_connection
>
> eiid=os.getenv("EIID")
> token=os.getenv("BEARER_TOKEN")
> header="Authorization: Bearer %s" % token
> ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid, 
> header=[header])
> while True:
> x = ws.recv()
> print(x)
>
> And used it with my server.  It does not disconnect and correctly responds 
> to all messages sent by the server.  So that rules out problems with the 
> akka-http-based server.  it would appear that the issue is with the 
> akka-http client (whose code I got from this web page:
>
>
> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>
>
> Is there some reason why this code does not work?  As mentioned 
> previously, the code connects, retrieves and displays one message sent by 
> the server just after connection, and then promptly disconnects the 
> websocket connection.
>
> Are there known issues with client-side web socket support in 2.4.7?
>
> — Eric
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: akka-http web socket issue

2016-07-06 Thread Eric Swenson
I wrote a simple python client:

$ cat ws-test.py
import os
from websocket import create_connection

eiid=os.getenv("EIID")
token=os.getenv("BEARER_TOKEN")
header="Authorization: Bearer %s" % token
ws = create_connection("ws://localhost:9000/ws-connect/%s" % eiid, 
header=[header])
while True:
x = ws.recv()
print(x)

And used it with my server.  It does not disconnect and correctly responds to 
all messages sent by the server.  So that rules out problems with the 
akka-http-based server.  it would appear that the issue is with the akka-http 
client (whose code I got from this web page:

> http://doc.akka.io/docs/akka/2.4.7/scala/http/client-side/websocket-support.html#websocketclientflow
>  
> 
Is there some reason why this code does not work?  As mentioned previously, the 
code connects, retrieves and displays one message sent by the server just after 
connection, and then promptly disconnects the websocket connection.

Are there known issues with client-side web socket support in 2.4.7?

— Eric

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.