error handling spring boot kafka library feature - spring-boot

I want to include a feature in my spring boot Kafka library which enables the user to just call a listener which includes a retry logic for the messages which are getting failed.Help me with that.

Related

Spring and Google Cloud PubSub - subscribing to events

Following documentation, there are multiple ways to integrate Google Cloud PubSub events with Spring application:
Spring Cloud GCP has several modules for sending messages to Pub/Sub
topics and receiving messages from Pub/Sub subscriptions using the
Spring Framework. You can use these modules independently or combine
them for different use cases:
Spring Cloud GCP Pub/Sub Starter lets you send and receive messages
using helper classes and call the Pub/Sub Java client library for more
advanced scenarios.
Spring Integration Channel Adapters for Pub/Sub
let you connect Spring Integration Message Channels with Pub/Sub.
Spring Cloud Stream Binder for Pub/Sub lets you use Pub/Sub as
messaging middleware in Spring Cloud Stream applications.
I don't have full understanding - what are those different use cases mentioned, and how to determine, which module is best for which use case?
Application (Dockerized Spring Boot app, deployed to Kubernetes in GCP) I am working on is rather simple, it is expected to act upon received PubSub event, it is not going to publish any events itself.
Spring Cloud GCP Pub/Sub Starter module contains the java client classes for pub sub which will be used by your spring application to perform administrative and functional operations (ie. sending and receiving messages).
Spring Integration Channel Adapters for Pub/Sub module is utilized when your spring application uses Message Channels. This module will help routing message between message channel and pub/sub using channel adapters.
Spring Cloud Stream Binder for Pub/Sub module is used in Spring Cloud Stream Applications in order to utilize cloud Pub/Sub API.
Since, your application requirements are basic you can easily go for Spring Cloud GCP Pub/Sub Starter module. For more information you can refer to this Google documentation.

How to build a Pub Sub application with RabbitMQ, Spring Boot and React

I'm trying to build an application with a couple of services. One service publishes details to a rabbitMQ queue, another spring boot application has to consume them and send the correct details to the correct user. The front end is developed in reactJS. How can I implement the spring boot consuming and sending to the subscribed user part? Any reference is appreciated. Can I use the web socket in spring boot to this?

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?

Spring cloud contract - integrating with non - spring endpoint

I have a spring webapp that communicates with external service over kafka. IS it possible to somehow test contract between those services?
Yes you can. Spring Cloud Contract supports CDC with messaging. If you're using Spring Cloud Stream - the work to be done is trivial. If not then you'll have to implement your own as presented in this issue - Spring Cloud Contract and plain Spring AMQP . Summing it up it's enough for both consumer and producer to implement a custom org.springframework.cloud.contract.verifier.messaging.MessageVerifier bean that will be responsible for receiving and sending of messages via Kafka

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.

Resources