I'm having problem in replacing this particular example:
Consumer consumer = new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body)
throws IOException {
String message = new String(body, "UTF-8");
System.out.println(" [x] Received '" + message + "'");
}
};
Is it possible to replace that with lambda as it uses non-default constructor for DefaultConsumer?
It's from rabbitMQ java tutorial -> LINK to whole class