Accessing data element of UDP datagram in Alpakka UDP

Has anybody found a workaround for accessing the data variable of a UDP Datagram in Alpakka? Datagram defines its data field as a private member, so I’m unable to access the actual data to use in my downstream flow. Seem so be an issue that data has only private access in Datagram.

For example, I’d like to create a Kafka producer record using that element:

public static ProducerRecord toProducerRecord(Datagram datagram)
{
return new ProducerRecord(“my-topic”, datagram.data);
}

Have you tried calling data() method?

public static ProducerRecord toProducerRecord(Datagram datagram)
{
  return new ProducerRecord(“my-topic”, datagram.data());
}

Note that when Alpakka 1.1.0 is released, you will be able to use getData() as well: https://github.com/akka/alpakka/pull/1803