Apache NiFi Spring Boot integration - spring-boot

Understand that Apache NiFi could integrate with Spring as shown in SpringOne Platform 2016 Replay: Spring with ApacheNiFi. NiFi uses SpringContextProcessor to load Spring XML application context.
Question: Could NiFi integrate with Spring Boot? Specifically, could NiFi processor flows to a processor which calls a Spring Boot app, and then flows back to a NiFi processor? If so, is there any sample to demonstrate it?
Note: This integration is NOT about NiFi calling a Spring Boot REST API as shown in Spring Boot 2.0 on ACID : Integrating REST Microservices with Apache NiFi.

Note: This integration is NOT about NiFi calling a Spring Boot REST API as shown in Spring Boot 2.0 on ACID : Integrating REST Microservices with Apache NiFi.
REST is the only integration pattern here between Spring Boot apps and NiFi. The processor your referenced is good for using Spring components, but Spring Boot itself is a full application framework and would take a significant amount of effort to integrate.

The Nifi flow could use the InvokeHTTP processor to call a REST API which is implemented as your spring boot application.

I think you should check this Processor. SpringContextProcessor.
SpringContextProcessor – allows integration of processes encapsulated
in Spring Application Context to run as NiFi processor by becoming a
runtime host for an instance of Spring Application Context.
There is a demo video. It's very helpful
Official Apache Nifi SpringContextProcessor Documentation

Related

Spring Cloud Data Flow - can it be used without spring boot?

Can Spring Cloud Data Flow be used in Spring5 applications - NOT Spring Boot - my current employer seems to view Spring Boot applications as insecure (I've no idea why) in anyway I'd like to try use this stack for an integration project, so is it possible to use it without Spring Boot?
With Spring Cloud Data Flow you can deploy streams, tasks and batches.
This is all based on Spring, Spring Cloud and Spring Boot. Spring Boot is nothing else as a preconfigured Spring stack.
Spring Data Flow is a runitme that usually needs a cloud infrastructure like Kubernets.
I'm not sure if you really are looking for that or more for something like https://spring.io/projects/spring-integration

Does Elastic APM support Spring Cloud Stream

I am very new to Elastic APM and not sure how it can support different frameworks. I can see that from the documentation APM supports Spring Boot. I have tested a Spring Boot application with the APM and it looks promising. I was wondering if APM supports Spring Cloud Stream as well. Spring Cloud Stream provides Event Driven Architecture by using Spring Boot and messaging middleware. Middleware can be Kafka, RabbitMQ, etc.
I am not familiar with what is Elastic APM, but if it says it supports Spring Boot, then it means it supports any spring-boot-based framework which Spring Cloud Stream is.

Spring contract-first REST

I have a Spring web application - which doesn't use Spring-based GUI, but Wicket - and I would like to build contract-first REST services.
I already have a contract defined in Swagger and I generate model and API artifacts. Swagger codegen generates either Spring Boot artifacts, or Spring MVC ones.
My intention is to use ideally just a model, and maybe API (controllers) from this generated code. But up to my knowledge/research, there is no simple way to have just simple REST service without MVC/Boot boilerplate.
Therefore my questions are:
Is it possible to build lightweight Spring-based REST service, without having "heavy" dependency of full Spring MVC/Spring Boot?
If not, which approach is more lightweight? Spring Boot, or Spring MVC?
You are misinterpreting the Spring ecosystem.
Spring MVC is THE rest web and web service library within Spring portfolio.
The same way as Spring-WS is THE soap web service library.
They are very similar in architecture and style of use.
The fact that Spring MVC is bundled with Spring Framework does not change the situation.
Spring Boot does not bring any new REST offering. It is just a bootstrap mechanism to start Java web server with web app already deployed from a plain main() method. Therefore if you see "Building REST web services with Spring Boot", it just means that it is Spring MVC bootstrapped by Spring Boot.
Therefore, the question to what is more lightweight is straightforward: Spring MVC.
To answer the question #2:
The usage of Spring MVC is more lighweight, then usage of Spring Boot:
Size of the WAR archive:
6,1 MB for Spring MVC
9,2 MB for Spring Boot
Number of libraries in WAR archive:
12 for Spring MVC
28 for Spring Boot

Consuming Spring cloud config using Spring REST service (non-boot rest service)

I'm just curious, is it possible to consume Spring Cloud config by a Spring REST service which is not a Spring boot application. If it is possible, where to define the properties in a Spring REST service. I meant, where should I define
spring.cloud.config.uri etc.
Or, only Spring boot applications are allowed to consume Cloud configuration?
Any thought would be appreciated. Thanks
well spring boot just bootstrap all configuration automatically . so for simple spring application you have to config it manually and define the cloud config server beans in your application configuration file . it could be pure old fashion xml files or just using java code configuration with #Configuration. you could find some samples in github

Spring XD as a Rest Endpoint

Can we integrate Spring XD and Spring MVC, so that we can ingest/process data sent to the REST end point?
We have huge amounts of data collected in a Spring MVC app and are wondering if we could use Spring XD for this.
The http source is a stripped-down http server (based on netty); it is not a full Spring MVC server. For that, you would need a custom source with an embedded tomcat/jetty.
See Artem's comment on this answer for a suggestion about how to embed tomcat in a module.

Resources