1
votes

I am using Apache Flinke 1.7.2 RabbitMQ connector: https://ci.apache.org/projects/flink/flink-docs-stable/dev/connectors/rabbitmq.html

I want to access the message_id in the amqp message properties sent along with the body of the amqp message. i want to be able to group by that message ID. The problem is that i only get the body of the message out from the source after i build it.

Is there an easy way that doesn't require me to rewrite the source class from scratch ?

1

1 Answers

1
votes

I guess this is not possible. Looking at the source-code of the connector you can see that they extract only the body of the RMQ message:

@Override
public void run(SourceContext<OUT> ctx) throws Exception {
    while (running) {
        QueueingConsumer.Delivery delivery = consumer.nextDelivery();
        synchronized (ctx.getCheckpointLock()) {
            OUT result = schema.deserialize(delivery.getBody());
            // ....
        ctx.collect(result);
        }
    }
}

I guess you have to find another connector (3rd party) or implement this by your own. Sorry for the bad news!