Azure/azure-functions-java-library

Reading events metadata in Event triggered function

muneeba-mughal opened this issue · 1 comments

Hi there! I'm trying to write an Azure function triggered by EventHub. My function looks like this:

@FunctionName("eventHubMonitor")
    fun run(
        @EventHubTrigger(
            name = "event",
            eventHubName = "eventhub",
            connection = "AzureEventHubConnection"
        ) message: String,
        context: ExecutionContext
    ) {
         context.logger.info("Event trigger processed a ${message} request.")
        }

In the message I only get the body of the event. I have important information in SystemProperties of the event that I need to read as well. How can I read those?

Thank you so much in advance <3

I figured it out. It's described beautifully in this repository:
https://github.com/Azure/azure-functions-java-worker

I will create a proposal for updating the documentation. :)