I am a little new to Spring-Integration and have been trying to POC some simple tasks. 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. I am currently taking a message from Rabbit and transforming to a JAVA POJO then sending it to a new channel to be posted to Rest service, but I need to authenticate against the server first. As I said new to SI and to OAuth and looking for a few pointers. I just can't seem to find anything on DSL with OAuth
@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();
}