-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send Map Object using JMS Citrus #1205
Comments
sorry, I do not quit understand your issue and am trying to grasp it fully. would you mind answering me some questions?
what do you mean by "the other end"? I understand that the JMS message has been sent, but cannot be received? how are you sending the payload? are you marshalling the map in any way? and of course, the best way would be to have a reproducer available... 😉 |
Thank you for your response To clarify:
Given that the receiving application requires a Map type payload, is there a way to properly send such a payload using Citrus? Is there a specific approach or configuration I should use to meet the requirements of the Qpid Proton-J2 ? |
So the JMS message converter in Citrus creates JMS text, map or object messages based on the message payload type (see https://github.com/citrusframework/citrus/blob/main/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/message/JmsMessageConverter.java#L151) It should create a JMS MapMessage when the message payload is a Map. I believe this is only working with simple key value pairs of type String so nested ArrayLists may be a problem. But you can also create the JMS MapMessage directly, for instance by using the MessagePayloadBuilder approach. The JMS message converter will then just use your custom JMS MapMessage and send it. Also you could try to set the Map as an object and specify |
How do I implement the MessageConverter inside the MessagePayloadBuilder |
Citrus Version
4.1.0
Question
I am trying to test integration of components and on the other end, i receive this error:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object with class 'java.lang.String' to class 'java.util.Map'
What I've tried so far
I ve tried adding the following parameters when sending the message:
.body(marshal(payload,objectMapper))
.header("_type", Map.class))
.type(MessageType.JSON)
MessagePayloadBuilder
, where i got errorCaused by: jakarta.jms.MessageFormatException: Only objectified primitive objects and String types are allowed... type: class java.util.ArrayList
Additional Info
They payload is a Map with nested ArrayLists
The text was updated successfully, but these errors were encountered: