My Ktor application plugin's `onCallReceive` event...
# ktor
d
My Ktor application plugin's
onCallReceive
event is not getting triggered. I'm wondering if there's something I'm not understanding about what
onCallReceive
means, or maybe I'm doing something else in my ktor application that's interrupting it?
Nothing crazy in the plugin, just doing this for now:
Copy code
val demo = createApplicationPlugin("DemoKobwebServerPlugin") {
            onCall { call -> <http://application.log.info|application.log.info>("onCall") }
            onCallReceive { call -> <http://application.log.info|application.log.info>("onCallReceive") }
            onCallRespond { call -> <http://application.log.info|application.log.info>("onCallRespond") }
        }
        application.install(demo)
Logs look like this when I connect to a route (and fetch multiple resources I imagine)
Copy code
2024-01-15 10:28:42.201 [eventLoopGroupProxy-4-3] INFO  ktor.application - onCall
2024-01-15 10:28:42.202 [eventLoopGroupProxy-4-3] INFO  ktor.application - onCallRespond
2024-01-15 10:28:42.211 [eventLoopGroupProxy-4-3] INFO  ktor.application - onCall
2024-01-15 10:28:42.211 [eventLoopGroupProxy-4-3] INFO  ktor.application - onCallRespond
2024-01-15 10:28:42.854 [eventLoopGroupProxy-4-3] INFO  ktor.application - onCall
2024-01-15 10:28:42.855 [eventLoopGroupProxy-4-3] INFO  ktor.application - onCallRespond
2024-01-15 10:28:42.867 [eventLoopGroupProxy-4-3] INFO  ktor.application - onCall
2024-01-15 10:28:42.868 [eventLoopGroupProxy-4-3] INFO  ktor.application - onCallRespond
Shouldn't it be "onCall" -> "onCallReceive" -> "onCallRespond"? Or am I thinking about "onCallReceive" incorrectly?
a
The
onCallReceive
hook is triggered only when you call the
ApplicationCall.receive
method (usually in a route's handler).
thank you color 1