簡體   English   中英

Spring 集成 DSL OAuth 在 Http.outboundGateway

[英]Spring Integration DSL OAuth on Http.outboundGateway

我對 Spring-Integration 有點陌生,並且一直在嘗試 POC 一些簡單的任務。 Having never touched OAuth at all and having a rest service with OAuth required I am hoping someone could show me an example of using OAuth with the Java DSL. 我目前正在接收來自 Rabbit 的消息並轉換為 JAVA POJO,然后將其發送到新頻道以發布到 Rest 服務,但我需要先對服務器進行身份驗證。 正如我所說的 SI 和 OAuth 的新手並尋找一些指示。 我似乎在 OAuth 的 DSL 上找不到任何東西


    @Bean
    public IntegrationFlow amqpInboundGateway(ConnectionFactory connectionFactory, @Value("${rabbitmq.queue}") String queue) {
        return IntegrationFlows.from(Amqp.inboundGateway(connectionFactory, queue))
                .transform(Transformers.toJson())
                .transform(Transformers.fromJson(Call.class))
                .log(message -> message.getPayload())
                .channel("rabbitOutput")
                .get();
    }

    @Bean
    public IntegrationFlow httpPostAtms( @Value("${alemba.incident.get}") String uri) {

        return IntegrationFlows.from("rabbitOutput")
                .handle(Http.outboundGateway(uri)
                        .httpMethod(HttpMethod.POST)
                        .extractPayload(true))
                .transform(Transformers.toJson())
                .log()
                .get();

    }

我不熟悉 OAuth,但Http.outboundGateway()可以配置外部RestTemplate ,可以通過任何可能的方式進行定制。 Please, learn more about OAuth in Spring Security: https://docs.spring.io/spring-security/site/docs/5.2.1.RELEASE/reference/htmlsingle/#oauth2 . Spring 集成:完全不是這個項目的責任

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM