diff --git a/boot-rabbitmq-thymeleaf/src/main/java/com/poc/boot/rabbitmq/config/RabbitMQConfig.java b/boot-rabbitmq-thymeleaf/src/main/java/com/poc/boot/rabbitmq/config/RabbitMQConfig.java index 541b1fccd..1a6238d86 100644 --- a/boot-rabbitmq-thymeleaf/src/main/java/com/poc/boot/rabbitmq/config/RabbitMQConfig.java +++ b/boot-rabbitmq-thymeleaf/src/main/java/com/poc/boot/rabbitmq/config/RabbitMQConfig.java @@ -8,6 +8,7 @@ import org.springframework.amqp.core.Queue; import org.springframework.amqp.core.QueueBuilder; import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; +import org.springframework.amqp.support.converter.MessageConverter; import org.springframework.boot.autoconfigure.amqp.RabbitTemplateCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -77,16 +78,12 @@ Binding deadLetterBinding(Queue deadLetterQueue, FanoutExchange deadLetterExchan } @Bean - RabbitTemplateCustomizer rabbitTemplateCustomizer( - Jackson2JsonMessageConverter producerJackson2MessageConverter) { - return rabbitTemplate -> { - rabbitTemplate.setMessageConverter(producerJackson2MessageConverter); - rabbitTemplate.setConfirmCallback(rabbitTemplateConfirmCallback); - }; + RabbitTemplateCustomizer rabbitTemplateCustomizer() { + return rabbitTemplate -> rabbitTemplate.setConfirmCallback(rabbitTemplateConfirmCallback); } @Bean - Jackson2JsonMessageConverter producerJackson2MessageConverter() { + MessageConverter producerJackson2MessageConverter() { return new Jackson2JsonMessageConverter(); } diff --git a/boot-rabbitmq-thymeleaf/src/main/java/com/poc/boot/rabbitmq/entities/TrackingState.java b/boot-rabbitmq-thymeleaf/src/main/java/com/poc/boot/rabbitmq/entities/TrackingState.java index eb0dd3e9c..65d64248d 100644 --- a/boot-rabbitmq-thymeleaf/src/main/java/com/poc/boot/rabbitmq/entities/TrackingState.java +++ b/boot-rabbitmq-thymeleaf/src/main/java/com/poc/boot/rabbitmq/entities/TrackingState.java @@ -5,6 +5,7 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; +import java.util.StringJoiner; @Entity public class TrackingState { @@ -46,4 +47,13 @@ public TrackingState setStatus(String status) { this.status = status; return this; } + + @Override + public String toString() { + return new StringJoiner(", ", TrackingState.class.getSimpleName() + "[", "]") + .add("id=" + id) + .add("correlationId='" + correlationId + "'") + .add("status='" + status + "'") + .toString(); + } }