I am trying to implement RedisSubscriber which implements MessageListener
@Override
public void onMessage(Message message, byte[] pattern) {
messageList.add(message.getBody().toString());
System.out.println("Message received: " + new String(message.getBody(), StandardCharsets.UTF_8));
}
But in my console it does not print the right string, it prints:
Message received: �� t Hi test
Why is it printing extra characters?
I tried deserializing it as well but it does not convert properly
I solved it. Just add String Serializer in RedisConfig