关于java:Http.outboundGateway上的Spring Integration DSL OAuth

Spring Integration DSL OAuth on Http.outboundGateway

我对Spring-Integration有点陌生,并且一直在尝试POC一些简单的任务。从未接触过OAuth并需要OAuth提供rest服务,我希望有人可以向我展示一个将OAuth与Java DSL一起使用的示例。我目前正在从Rabbit获取一条消息,并将其转换为JAVA POJO,然后将其发送到新通道以发布到Rest服务,但是我需要首先针对服务器进行身份验证。正如我对SI和OAuth所说的那样,并寻找一些建议。我似乎无法在OAuth

的DSL上找到任何东西

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
    @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不熟悉,但是可以使用外部RestTemplate配置Http.outboundGateway(),该外部RestTemplate可以通过任何可能的方式进行自定义。请在Spring Security中了解??有关OAuth的更多信息:https://docs.spring.io/spring-security/site/docs/5.2.1.RELEASE/reference/htmlsingle/#oauth2。在Spring Integration中,没有任何事情要做:完全不是这个项目责任