bitkid
04/22/2019, 5:41 PMhdarritchon
04/23/2019, 6:37 AMThomas
04/23/2019, 10:04 AMribesg
04/23/2019, 1:48 PM<http://client.post|client.post><Unit>(...)
or something like that?Nikky
04/23/2019, 10:49 PMpardom
04/24/2019, 1:49 PMlookupSerializerByType
which does not look for serializers in listMappers
(where registerList<Long>()
places the serializer).hdarritchon
04/24/2019, 7:34 PMserebit
04/24/2019, 7:41 PMribesg
04/25/2019, 7:23 AMktor-client-android
, I get a 400
with a nice json response on Android L/21 to a request but the client never actually sent the request to the server, it responded alone with this:``` {
"message": "Bad request",
"status": 400
}```
I can’t provide a way to reproduce the issue so I don’t know if it’s worth to open one on Github. The problem doesn’t occur with Android Q/29.
I worked around the issue by switching to ktor-client-okhttp
rrader
04/25/2019, 11:26 AMAntanas A.
04/25/2019, 11:50 AMSteven
04/25/2019, 12:04 PMhyukchan
04/25/2019, 4:20 PMtjohnn
04/25/2019, 7:02 PMinvoke()
warned against overusing it, right now I am using it for all my uses cases e.g
class CreateNewSubCategory @Inject constructor(private val subcategoryRepository: SubCategoryRepository){
suspend operator fun invoke(category: Subcategory): Int = subcategoryRepository.createSubCategory(category)
}
Is there any detriment to that?napperley
04/26/2019, 1:41 AM2019-04-26 13:35:26 DEBUG ManagedSelector:395 - Selector sun.nio.ch.EPollSelectorImpl@3127e5fa waiting with 1 keys
2019-04-26 13:35:26 DEBUG IdleTimeout:156 - SocketChannelEndPoint@1c0f19b5{/192.168.10.40:45496<->/192.168.10.40:10001,OPEN,fill=-,flush=-,to=5/30000}{io=0/0,kio=0,kro=0}-><null> idle timeout check, elapsed: 5 ms, remaining: 29995 ms
2019-04-26 13:35:26 DEBUG SslContextFactory:1645 - Customize sun.security.ssl.SSLEngineImpl@26e0da09
2019-04-26 13:35:26 DEBUG PreEncodedHttpField:64 - HttpField encoders loaded: [org.eclipse.jetty.http2.hpack.HpackFieldPreEncoder@172d9369]
2019-04-26 13:35:26 DEBUG ManagedSelector:671 -
java.lang.ExceptionInInitializerError
at org.eclipse.jetty.server.HttpConnection.<clinit>(HttpConnection.java:56)
at org.eclipse.jetty.server.HttpConnectionFactory.newConnection(HttpConnectionFactory.java:85)
at org.eclipse.jetty.server.SslConnectionFactory.newConnection(SslConnectionFactory.java:95)
at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.newConnection(ServerConnector.java:532)
at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:227)
at org.eclipse.jetty.io.ManagedSelector.access$1500(ManagedSelector.java:60)
at org.eclipse.jetty.io.ManagedSelector$Accept.run(ManagedSelector.java:667)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at org.eclipse.jetty.http.PreEncodedHttpField.<clinit>(PreEncodedHttpField.java:71)
... 10 more
2019-04-26 13:35:26 WARN ManagedSelector:679 - java.lang.ExceptionInInitializerError
2019-04-26 13:35:26 DEBUG ManagedSelector:680 -
java.lang.ExceptionInInitializerError
at org.eclipse.jetty.server.HttpConnection.<clinit>(HttpConnection.java:56)
at org.eclipse.jetty.server.HttpConnectionFactory.newConnection(HttpConnectionFactory.java:85)
at org.eclipse.jetty.server.SslConnectionFactory.newConnection(SslConnectionFactory.java:95)
at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.newConnection(ServerConnector.java:532)
at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:227)
at org.eclipse.jetty.io.ManagedSelector.access$1500(ManagedSelector.java:60)
at org.eclipse.jetty.io.ManagedSelector$Accept.run(ManagedSelector.java:667)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at org.eclipse.jetty.http.PreEncodedHttpField.<clinit>(PreEncodedHttpField.java:71)
... 10 more
2019-04-26 13:35:26 DEBUG QueuedThreadPool:682 - ran org.eclipse.jetty.io.ManagedSelector$Accept@229ba41d
Rainer Schlonvoigt
04/26/2019, 8:05 AMRainer Schlonvoigt
04/26/2019, 8:06 AMAbbas A
04/26/2019, 2:31 PMget("/item/{itemId}/search?address[lat]={lat}")
unfortunately ktor can’t map it, from server I see that request was encoded as:
/item/1234/search?address%5Blat%5D={lat}
is it issue or I do something wrong?
I tried to find something here or in docs, what I found is:
<https://ktor.io/servers/features/routing.html#tracing>
after applying trace to routing:
/item/1234/search?address[lat]={lat}, segment:3 -> FAILURE "Selector didn't match" @ /item/1234/search?address%5Blat%5D={lat})
wakingrufus
04/26/2019, 4:41 PMrequest<HttpResponse>
I can check for status and other things in order to do my own error handling, but then i can't leverage the built in Json deserialization of my object. but if i call request<MyObject>
in order to get the deserialization, it is not clear how to check and handle errors. I am looking for something like Fuel's `Result.fold`: inline fun <X> fold(success: (V) -> X, failure: (E) -> X): X = when (this) {
is Success -> success(this.value)
is Failure -> failure(this.error)
}
. is there something like this in ktor?Marcin Wisniowski
04/27/2019, 3:40 PMformData
function is very nice, why doesn't it work?)Marcin Wisniowski
04/27/2019, 3:49 PMMultiPartFormDataContent
, not FormDataContent
as the documentation wrongly states.napperley
04/28/2019, 4:40 AMDEBUG Application:102 - I/O operation failed
java.io.IOException: Connection reset by peer
at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1108)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:345)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:545)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
On the Android client side it looks as though there is a issue on the server side with Socket Closed (https://stackoverflow.com/questions/24620953/android-error-java-net-socketexception-socket-closed) errors appearing in the logs. Encountering bi-directional issues here where it isn't clear which side is causing the issue 😕. How do I know if the issue is on the server side?Jens Baitinger
04/28/2019, 12:05 PMCannot change attributes of configuration ':ktor-server:ktor-server-jetty:ktor-server-jetty-test-http2:posixApiElements' after it has been resolved
Anyone who knows a quickfix for that?andrew
04/28/2019, 3:25 PMdarkmoon_uk
04/29/2019, 11:36 AM1.3.20
at the moment, is that correct?darkmoon_uk
04/29/2019, 1:39 PM1.1.5
?
There's a ktor-client-websocket-1.1.5
artifact.
... but no 1.1.5
for any of the platform-specific ktor-client-websocket-1.1.5-*
artifacts... ?Cláudio Bartolomeu
04/29/2019, 3:40 PMKevin Schmeichel
04/29/2019, 6:55 PMLocations
- why isn't this just built into Routing
?bitkid
04/29/2019, 9:55 PMbitkid
04/29/2019, 9:59 PMbitkid
04/29/2019, 9:59 PMKevin Schmeichel
04/29/2019, 10:23 PMbitkid
04/29/2019, 10:42 PMKevin Schmeichel
04/29/2019, 10:55 PMbitkid
04/29/2019, 11:09 PMKevin Schmeichel
04/30/2019, 12:07 AM