I have a code like this in RabbitMQ :
byte[] rawBytes = serialize(trxEntities);
byte[] zipped = rawBytes;
if (shouldBeCompress) {
zipped = compressor.compress(rawBytes);
}
BasicProperties persistentBasic = MessageProperties.PERSISTENT_BASIC;
channel.basicPublish("", queueName, persistentBasic, zipped);
As you see some of my messages should be compress along witch some others shouldn't.
Is there any way I could set any properties to tell the consumer that "hey! this is a zipped message" ?
PS. does "com.rabbitmq.client.AMQP.BasicProperties.BasicProperties(..., Map headers, ...)" help me? I mean could I set any parameter in BasicProperties.header ?