What is the equivalent object of Exchange (Camel) in Spring Boot? - spring-boot

I am trying to migrate an application built with Camel in Spring Boot, but i'm not using the Exchange object of Camel, so i have to use some other object to do the work of Exchange. Can anybody give me an idea about that?

SpringBoot is not an integration framework like Camel. Spring Integration is the counterpart of Camel in the Spring ecosystem. Although SpringBoot and the Spring framework works very well with Camel too.
However, the Camel Exchange is a Camel concept. I think there is nothing similar in Spring Integration.
The Camel Exchange is like an internal, enriched message. A wrapper around an in- and out-message (out is deprecated since Camel 3) and it holds additional state information such as Exchange properties (non-routable headers), Exceptions etc.
As far as I know, in Spring integration there is just the message. No wrapper around it.

Related

Baggage Propagation in Jms using Spring Cloud Sleuth

I'm trying to use the baggage propagation offered by Spring Cloud Sleuth. In the calls that use the Feign client I don't have any kind of problem, I can propagate custom fields, while while using JmsTemplate of Spring JMS I can't propagate the same fields.
My application is a Spring Boot application, version 2.1.5, with Spring Cloud version Greenwich.SR1.
In order to put the custom fields, I use
ExtraFieldPropagation.set("communicationId", "123456");
while, inside my application.properties, I put
spring.sleuth.baggage-keys= communicationId
I expect that the same functionality present for the Feign client, is also present for the producer JMS. Where am I wrong?

Does Apache Camel replace or complement creating micro-services with Spring Boot?

I have been working for a while with Spring micro-services and have no come across Apache Camel as a tool for building micro-services. I'm unclear -- is Apache Camel a replacement for creating micro-sevices with Spring Boot or does it add functionality / short-cuts to developing such services with Spring Boot? It's already fairly simple to create microservices with Spring Boot so it's hard to imagine what Apache Camel would add but that is the essence of my question.
Apache Camel has nothing to do with microservices.
It's an implementation of the Enterprise Integration Patterns: https://www.enterpriseintegrationpatterns.com/
Apache Camel provides an implementation for most of the patterns from the book from Gregor Hohpe and Bobby Woolf. Plus a variety of inbound and outbound endpoints to integrate with systems like the file system, FTP, HTTP, Messaging, Facebook etc.
Find more information on the website: https://camel.apache.org/
There is a Spring Boot Starter project to run Camel in a Spring Boot application:
https://camel.apache.org/spring-boot.html
what Apache Camel would add, that is the essence of my question
In service of declaring REST based microservices, Camel's REST DSL provides a fluent API for declaring microservices. Take for example:
rest("/books").produces("application/json")
.get().outType(Book[].class)
.to("bean:bookService?method=getBooks(${header.bookCategory})")
Should tell you at a glance that requests to the path /books will get you a List of Book, as long as you send a request parameter named bookCategory. This is mapped to a POJO bean called bookService.
Spring Boot is a framework which simplifies application packing and startup while Spring is the actual framework which has libraries for performing various tasks.
Technically, we can use Camel for building micro-services as well and many aspects of camel depend on Spring. If you foresee many integration related functionality like sending email or communicating with other system, you can use also use Hexagonal architecture.

Spring Boot Java8 Microservice Simple Message Subscription service

I am new to Microservice and JMS likes to know how can I
create a subscription
read the subscription
Using Spring Boot and JMS
To get started with Spring Boot and JMS use this getting started guide https://spring.io/guides/gs/messaging-jms/
Once you have that sorted then adding the microservices is just a matter of adding the Spring MVC and Rest components which you could first experiment as a standalone project and then integrate with the JMS application.
To get started with Spring Book and Microservices use the getting started guide https://spring.io/guides/gs/rest-service/
JMS not part of Java SE. You need Java EE or Spring.
I'm not sure queues are the best way to solve the problem.
I'd recommend Spring Boot.
Subscription maintenance isn't something that the queue would do.
A simple REST service would manage this nicely. You'll need a persistence layer to save subscription information.

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.

Is anyone focusing on Mule with Spring Boot?

I have been using Spring Boot for a short while and it's great for getting things up and running quickly.
Is anyone working on a template for integrating Mule ESB with Spring Boot ?
Not sure if Mule will be charge of this or not. But you can suggest this in the spring-boot project in github
An approach could be use queues , so mule expose a functionality as queue enpoint and spring boot send and receive string messages to mule queue. I have seen it work in complex scenarios.
Latency will increase but the core of integrations will remain in mule esb.
Other approaches:
Starting mule programmatically from spring boot: http://glawson6.github.io/spring/mule/2015/04/22/using-spring-boot-with-mule.html (not tested)
https://github.com/denschu/mule-spring-boot-starter(not tested)
HTH

Resources