Spring AMQP - support for Spring programming model with AMQP, especially but not limited to RabbitMQ
Jackson2JsonMessageConverter
is used as "message converter" (which is the first step of conversion) and MappingJackson2MessageConverter
is used as "method argument converte" (which is the second step of conversion)RabbitListener
. Defining an Around
aspect around the annotation runs too late (MessagePostProcessor
are called already before the advice runs). Setting the advice chain also runs after the MessagePostProcessor
. Overriding the TaskExecutor
seems early enough, but it looks like it doesn't create a new task for each message received. I could do some of the work in a MessagePostProcessor
, but I'd need a way to know when the RabbitListener
annotated method finishes (so I can kill the scope). I suppose I could do the setup in a post processor, and the clean up in an Aspect. Are the any other possibilities?
Hi Community,
I have a general question on a use case, people use our API through HTTPs we have a service exposing these APIs and a service which has business logic.
Now we have put a RM queue between API service and business logic, but still need our APIs to be synchronous and we are using reply queues for that.
is this architecture good ? Does this have any draw backs ?
Hi,
I'm trying to connect my service to RabbitMQ over TLS. The RabbitMQ host I'm using is an AWS ELB pointing to the RabbitMQ cluster which uses an amazon-managed TLS certificate.
Is it possible to do this? When I try to, I get the following:
javax.net.ssl.SSLHandshakeException: No trusted certificate found as it's trying to find the certificate locally even though it's signed and validated as it's managed by amazon?
I have an excepion being thrown from the post-processor, and I would like to have error handler for this case. I can use org.springframework.util.ErrorHandler
for container, but in fact I would also like to have access to the message itself.
RabbitListenerErrorHandler
will not help in this case as exception happens earlier, before the listener.
In the ConditionalRejectingErrorHandler
I saw this check t instanceof ListenerExecutionFailedException
but in my case it is original exception.
What are the other options?
Hello,
Is there any way to try to create a channel with another Node of a RMQ Cluster in case of some Exception like this one?
'''
Caused by: com.rabbitmq.client.ChannelContinuationTimeoutException: Continuation call for method #method<channel.open>(out-of-band=) on channel AMQChannel(amq
p://sqfo-apps-fix-engine-six@{HOST1}/tradingsystems,655) (#655) timed out
at com.rabbitmq.client.impl.AMQChannel.wrapTimeoutException(AMQChannel.java:313)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:295)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:141)
at com.rabbitmq.client.impl.ChannelN.open(ChannelN.java:128)
at com.rabbitmq.client.impl.ChannelManager.createChannel(ChannelManager.java:182)
at com.rabbitmq.client.impl.AMQConnection.createChannel(AMQConnection.java:618)
at org.springframework.amqp.rabbit.connection.SimpleConnection.createChannel(SimpleConnection.java:58)
... 32 more
Caused by: java.util.concurrent.TimeoutException
at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:77)
at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:120)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:293)
'''
It seems that the application try to create a channel always with the same node, instead to switch on some other node.
Storing delivery for consumerTag
in the logs), but no one picks up the messages from the queue (absence of Received message:
in the logs). This leads to lots of unacked messages in RabbitMQ, after which RabbitMQ stops sending messages completely. It happens after hours or days of uptime, randomly. The logs at the time, when this happens do not show anything helpful (regarding some exceptional state). RabbitMQ connection is healthy, therefore the service needs force restart. Everything was work fine on Spring Boot 2.3.x. Any help would be hugely appreciated.
@RabbitAvailable
for our integration test purposes (RabbitMQ is running as an own docker container). Here we noticed that according to the class comment the check is only implemented for local running brokers ("Test classes annotated with this will not run if there is no broker on localhost.")BrokerRunningSupport
supports overrides by the System Environment
. We would rather like to pass our RabbitMQ credentials as runtime arguments. Is there a specific reason why the SystemProperties
are not used instead? Any support on this would be much appreciated.
I was doing
@Bean
public Binding bbbBinding() {
return BindingBuilder.bind(bbbQueue())
.to(requestExchange())
.with("*");
}
No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
Please learn how to use Gitter markdown (click the M on the right). You need to surround your code with three back-ticks (fences) on separate lines before and after the code).
What is
customPublisherSubscriber.receiveMessageFromResponseQ(
? I don't see that either in your code or the test.