byte[] received when using @RabbitListener with Batching #2889
-
Hello, Batching works fine but I want to receive a list of org.springframework.amqp.core.Message and I am receiving a list of byte[] instead. Here is the bean I use to configure the containerFactory
and here is where I expect to receive my messages
messages returns a list of byte[] which contains my payloads. I have tried switching to List<org.springframework.messaging.Message> and even a list of String just like in the following exemple but to no avail : https://docs.spring.io/spring-amqp/reference/amqp/receiving-messages/batch.html Thank you in advance for your help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The
So, if We do have logic in the
So, Perhaps you can share with us a simple project where we can reproduce the problem? |
Beta Was this translation helpful? Give feedback.
-
Hello,
It seems paramType is wrong with Kotlin, it is seen as WildcardTypeImpl<? extends org.springframework.amqp.core.Message> instead of org.springframework.amqp.core.Message thus not setting isAmqpMessageList. |
Beta Was this translation helpful? Give feedback.
So, our
parameterizedType.getRawType().equals(List.class)
cannot be passed because of thatkotlin.collections.List
.But at the same time our
java.util.List<org.springframework.amqp.core.Message>
is able to be passed into that argument.So, there is some conversion on the Kotlin side from
java.util.List
into akotlin.collections.List
.I'm not sure what to do, but it has to be fixed some way indeed.
Raising an issue from this discussion.