New to RabbitMQ and message passing APIs. I want to send a triplet of float values every few milliseconds. To initialize my connection/channel, I have:
connection = factory.newConnection();
channel = connection.createChannel();
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
Then when I want to send a message, the following does strings:
private void sendMessage(String message) throws IOException {
channel.basicPublish("", QUEUE_NAME, null, message.getBytes());
}
How can I change sendMessage
to send float x1, float x2, float x3
?
And on the server-side, how would I receive/parse this message into 3 floats?