I have a spring boot app configured with a RabbitMqListener. It has to receive JSON data of the format below: (showing sample)
{ "name" :"abc",
"key" : "somekey",
"value" : {"data": {"notes": "**foo \u0026 bar"}}**
}
This data represents some info. which should be used only for read-only processing, and the receiver spring app should receive it as it is(raw form).
What I mean is if I assert value
node in spring app with input that was published on queue it should be equal.
This is simply not happening.
I always get the value in spring app as
foo & bar
but I wanted it in raw form without a conversation of \u codes.
I try several approaches,
- Jackaon2JsonMessage converter,
- passing bytes from
Message.getBody() - byte[]
tomapper.readValue()
in Rabbit handler.- Using JSON-simple, gson libraries
Why is it so tricky to get the data as it is, without any conversion or translation. Do I need to follow an alternative approach?
Any help is appreciated