todd.ginsberg
10/15/2020, 3:04 PMsdeleuze
10/15/2020, 3:22 PMtodd.ginsberg
10/15/2020, 3:23 PMkotlinx.serialization
in Spring Boot! We have so many unpleasing workaround for Jackson+Kotlin, this will be nice to have a Kotlin native way to serialize json.sdeleuze
10/15/2020, 3:24 PMwakingrufus
10/15/2020, 3:38 PMwakingrufus
10/15/2020, 3:39 PMsdeleuze
10/15/2020, 3:39 PMwakingrufus
10/15/2020, 3:42 PMwakingrufus
10/15/2020, 3:44 PMwakingrufus
10/15/2020, 3:44 PMwakingrufus
10/15/2020, 3:44 PMsdeleuze
10/15/2020, 3:47 PMenable(configFoo)
and is pretty basic, mainly additive for beans, replace for other, see related https://github.com/spring-projects-experimental/spring-fu/issues/292. I am open to explore improvements with concrete use cases.wakingrufus
10/15/2020, 4:06 PMenable
in spring fu or just called within a Configuration / autoconfig provided by the library in traditional applicationsdusan
10/16/2020, 1:06 PMspring boot + coroutines
? I’m curious to figure out how they work together and if there are any concerns about leaks and creating additional threads outside of the spring scopedodalovic
10/16/2020, 5:41 PMnfrankel
10/29/2020, 7:08 PMFlux<T>
/ Mono<T>
where T
is the entity i play with
i’ve a caching service that checks first whether an entity is in the cache and returns it from here before querying the repo
and the controller transforms the Flux<T>
/ Mono<T>
to a Mono<ServerResponse>
rodolpho.couto
11/05/2020, 6:36 PMdata class CustomContext(val value: String) : AbstractCoroutineContextElement(Key) {
object Key : CoroutineContext.Key<CustomContext>
}
@SpringBootApplication
class Application {
@Bean
fun router() = coRouter {
GET("/test") { request ->
withContext(CustomContext(value = "test")) {
println(coroutineContext[CustomContext.Key]?.value)
throw IllegalArgumentException()
}
}
onError<IllegalArgumentException> { throwable, request ->
println(coroutineContext[CustomContext.Key]?.value)
status(INTERNAL_SERVER_ERROR).buildAndAwait()
}
}
}
The CustomContext
is null inside onError
function. Any ideas?Luis Munoz
11/11/2020, 7:24 PMconfigurations.all {
resolutionStrategy {
force ("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
}
}
Still didn't work getting error
Caused by: java.lang.NoSuchMethodError: kotlinx.coroutines.reactive.FlowSubscription.<init>(Lkotlinx/coroutines/flow/Flow;Lorg/reactivestreams/Subscriber;Lkotlin/coroutines/CoroutineContext;)V at kotlinx.coroutines.reactor.FlowAsFlux.subscribe(ReactorFlow.kt:39) at
My deps
+--- org.jetbrains.kotlinx:kotlinx-coroutines-reactor:1.4.1
| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1 (*)
| +--- io.projectreactor:reactor-core:3.2.5.RELEASE -> 3.3.11.RELEASE (*)
| +--- org.jetbrains.kotlinx:kotlinx-coroutines-reactive:1.4.1 -> 1.3.8
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.71 -> 1.4.10 (*)
| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8 -> 1.4.1 (*)
| | \--- org.reactivestreams:reactive-streams:1.0.2 -> 1.0.3
| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.0 -> 1.4.10 (*)
mickeelm
11/12/2020, 5:31 PMKush Patel
11/23/2020, 3:47 AMspring-fu/kofu
and so far I’m a fan. However, I’m having a hard time rendering my index.html
which exists in the build/resources/main/static/
folder. My app is pretty small so far but the error I’m getting is the following. I believe when I visit <http://localhost:8080/>
my index.html
should render
javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
org.springframework.web.servlet.view.InternalResourceView.prepareForRendering(InternalResourceView.java:210)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:148)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:316)
val app: KofuApplication = webApplication {
webMvc {
converters {
resource()
}
router {
accept(MediaType.TEXT_HTML).nest {
GET("/") {
ServerResponse.ok().render("index")
}
}
resources("/**", ClassPathResource("static/"))
}
}
}
fun main(args: Array<String>) {
app.run(args)
}
sdeleuze
11/23/2020, 3:41 PMsdeleuze
11/26/2020, 11:45 AM5.3.2-SNAPSHOT
, see https://github.com/spring-projects/spring-framework/commit/43faa439ab567c382e50ae670560024cebdf63d2 for more details, and feel free to test it with Spring Boot 2.4.0
or 2.4.1-SNAPSHOT
by defining spring-framework.version=5.3.2-SNAPSHOT
in gradle.properties
to check it behaves as expected. No more need for jackson exclusion.Robert Jaros
11/26/2020, 1:21 PM@Serializable
class, Kotlin serialization will be automatically used?Robert Jaros
11/26/2020, 1:27 PM@Serializable
on the client side but not on the server side (I use contextual serialization and use some types which are not automatically serializable). I think it will break things. It's not a hypothetical question - my KVision works that way (Kotlin seralization on the client side, Jackson on the server side).Robert Jaros
11/26/2020, 1:31 PMapplication.yml
to select the serialization engine would be very useful.sdeleuze
11/26/2020, 2:23 PMsdeleuze
11/26/2020, 2:24 PMsdeleuze
11/26/2020, 2:25 PM@Serializable
and collection of those + collection of primitive types). Then forwarded to Jackson.sdeleuze
11/26/2020, 2:26 PM