I am trying to publish a message in RabbitMQ using grails 3.3.11. But I am in trouble with brazilian portuguese chars.
It seems to be a matter of charset, but I don't know how to resolve it. If anyone knows, please help me.
After proccessing a message in a queue, my code publish a status in another queue. The problem is that I publish a message, but when I go to see that in RabbitMQ, the message is modified with wrong characters. Specifically for brazilian protuguese characters like à, ç, õ, ú and others.
That is my queue publishing code, that where the problem is happening.
def publishNewStatus(String solicId, String newStatus, String message){
rabbitMessagePublisher.send {
exchange = "plt.cmbsolic.requests.status"
body = [requestId:solicId,status:newStatus,message:message]
}
}
That is the console result for the publishing. Note that it is correct.
QUEUE CONSUMING => STARTED AT Thu May 13 17:58:49 BRT 2021
SOLICITATION ID STATUS => Status FAILED_IN_CMBID for solicitation 2419399765SOL01
API RESPONSE => Usuário 2419399765 não encontrado
QUEUE CONSUMING => FINISHED AT Thu May 13 17:58:49 BRT 2021
API response is the variable message, the third argument for the method publishNewStatus.
But if I go to the queue, that is the message which is stored there.
{"requestId":"2419399765SOL01","status":"FAILED_IN_CMBID","message":"Usu\u00e1rio 2419399765 n\u00e3o encontrado"}
Note that á is replaced by \u00e1 and ã is replaced by \u00e3.
How can I resolve this?
Thanks a lot.
Alfredo Oliveira