All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bybutter.sisyphus.starter.grpc.transcoding.TranscodingAttributeInterceptor.kt Maven / Gradle / Ivy

Go to download

Starter for building gRPC server which with HTTP and gRPC Transcoding in Sisyphus Framework

The newest version!
package com.bybutter.sisyphus.starter.grpc.transcoding

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import org.springframework.web.server.ServerWebExchange
import org.springframework.web.server.WebFilter
import org.springframework.web.server.WebFilterChain
import reactor.core.publisher.Mono

@Component
class TranscodingAttributeInterceptor : WebFilter {
    @Autowired(required = false)
    private val headerExporters: List = listOf()

    override fun filter(
        exchange: ServerWebExchange,
        chain: WebFilterChain,
    ): Mono {
        exchange.attributes[TranscodingFunctions.HEADER_EXPORTER_ATTRIBUTE] = headerExporters
        return chain.filter(exchange)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy