I’m using this class and I’m wondering whether it’s thread safe: https://docs.spring.io/spring-amqp/api/org/springframework/amqp/support/converter/Jackson2JsonMessageConverter.html The docs don’t make any claims about this. I skipped through the code and found no signs it’s not thread-safe. It’s using an ObjectMapper internally, which is thread-safe according to docs: https://fasterxml.github.io/jackson-databind/javadoc/2.13/com/fasterxml/jackson/databind/ObjectMapper.html Mapper instances are fully thread-safe provided that ALL configuration of the instance occurs before ANY read
Tag: spring-amqp
Handle inbound AMQP messages based on a header attribute (e.g. routing key)
I have a service, that receives AMQP messages. This service is bound to a queue, which receives all messages which match a set of routing keys. My set up is as follows: This already works fine. However, now I want to handle a message with different controllers, depending on a header attribute. In this case I’d like to have a
Does Spring AMQP CorrelationData getFuture wait indefinitely without timeout?
In the context of Publisher confirms, when waiting for the CorrelationData’s future (SettableListenableFuture#get()) – does it wait indefinitely or is there a timeout configured under the water? Answer It does wait indefinitely. There is just no any opinion and everything is delegated directly to the java.util.concurrent.FutureTask internally in the org.springframework.util.concurrent.SettableListenableFuture implementation. Not sure why the question, but in normal situation
What kind of threading model changes led to DMLC
The doc explains why DMLC was introduced in version 2: https://docs.spring.io/spring-amqp/reference/html/#choose-container This architecture was required because, in early versions of the RabbitMQ client, multiple concurrent deliveries were not possible. Newer versions of the client have a revised threading model and can now support concurrency. This has allowed the introduction of the DMLC where the listener is now invoked directly on
Rabbit MQ doesn’t flush acks?
The problem appeared in logs: Consumer failed to start in 60000 milliseconds; does the task executor have enough threads to support the container concurrency? We try to open handlers for like 50 queues dynamically by SimpleMessageListenerContainer.addQueueNames(), then application is started. It consumes some messages, but the RabbitMQ admin panel shows that they are unacked. After a significant amount of time,
Dynamically configure RabbitMQ users and permissions with Java Spring AMQP
For security reasons, I want to configure separate user accounts with specific permissions to isolates queues in RabbitMQ. As users need to be a dynamic (adding new, removing deactivated…) I would like to achieve this with Java Spring AMQP. Creating queues, exchanges and bindings is possible with The RabbitMQ Management HTTP API provides also features regarding the user management, as
Synchronous publish for rabbitmq
I want to have two sets API for the clients to publish messages sync send(no retry, fail immediately and send status back to the clients synchronously) async send (publisher and confirm callback, with retry, log and drop the message after certain retries). I am able to implement this by enabling confirm and return. Is there any way to implement Synchronous
Java RabbitMQ: can’t map message to corresponding class
I have two different java spring projects that communicate through rabbitmq. I’m trying to send a java object but I get this error message: I’m aware that the problem is in the classpath that should be the same in both producer and consumer, but since each project has a different name I can’t make the classpath the same even though
How to configure separately both consumer and producer spring boot app when using rabbitmq?
I watched a tutorial that explains how to integrate RabbitMQ into Spring Boot app. In the tutorial, the ReceiveMessageHandler.java (Consumer) and SendMessageController.java (Producer) classes were in the same project. I want to implement them in two different Spring Boot application. However I can’t split the tutorial project into two consumer and producer project because of the ConfigureRabbitMq class. Because it
When publisher confirms are enabled, queue length limit is set and overflow is set to reject-publish,why cause in confirm callback I received is null?
I am learning Queue Length Limit(https://www.rabbitmq.com/maxlength.html), as it says, queue is set to ‘x-max-length:10’,and ‘x-overflow:reject-publish’, and also, I enable publisher confirms. So, when the number of messages in the queue reaches 10, the publisher will be informed of the reject via a basic.nack message. And it is: my confirm callback got a false ack, but cause is null. I’m wondering