When I publish a message to RabbitMQ, is the message sent to the exchange with a specific routing key, and when the consumer queue doesn't exist yet, will the message be lost?
Yes, RabbitMQ will drop the message.
But, you care about your data, so you're using publisher confirmations, correct? If so, RabbitMQ will send a message back indicating that your message was not routed.
You can also specify an alternate exchange to catch these messages.