I added rabbitmq.conf file with these configs:
max_message_size = 536870912 frame_max = 536870912
and it can now accept larger messages.