### YamlMime:JavaType uid: "com.microsoft.azure.eventhubs.EventData" fullName: "com.microsoft.azure.eventhubs.EventData" name: "EventData" nameWithType: "EventData" summary: "The data structure encapsulating the Event being sent-to and received-from EventHubs." syntax: "public interface **EventData**
extends Serializable, Comparable<>" methods: - uid: "com.microsoft.azure.eventhubs.EventData.create(byte[])" fullName: "com.microsoft.azure.eventhubs.EventData.create(byte[] data)" name: "create(byte[] data)" nameWithType: "EventData.create(byte[] data)" summary: "Construct EventData to Send to EventHubs." modifiers: - "static" parameters: - description: "the actual payload of data in bytes to be Sent to EventHubs." name: "data" type: "[]" syntax: "public static EventData create(byte[] data)" desc: "Construct EventData to Send to EventHubs. Typical pattern to create a Sending EventData is:\n\n```java\ni. Serialize the sending ApplicationEvent to be sent to EventHubs into bytes.\n ii. If complex serialization logic is involved (for example: multiple types of data) - add a Hint using the for the Consumer.\n```\n\nSample Code:\n\n```java\nEventData eventData = EventData.create(telemetryEventBytes);\n eventData.getProperties().put(\"eventType\", \"com.microsoft.azure.monitoring.EtlEvent\");\n partitionSender.Send(eventData);\n```" returns: description: "EventData the created to send to EventHubs." type: "" - uid: "com.microsoft.azure.eventhubs.EventData.create(byte[],int,int)" fullName: "com.microsoft.azure.eventhubs.EventData.create(byte[] data, int offset, int length)" name: "create(byte[] data, int offset, int length)" nameWithType: "EventData.create(byte[] data, int offset, int length)" summary: "Construct EventData to Send to EventHubs." modifiers: - "static" parameters: - description: "the byte[] where the payload of the Event to be sent to EventHubs is present" name: "data" type: "[]" - description: "Offset in the byte[] to read from ; inclusive index" name: "offset" type: "" - description: "length of the byte[] to be read, starting from offset" name: "length" type: "" syntax: "public static EventData create(byte[] data, int offset, int length)" desc: "Construct EventData to Send to EventHubs. Typical pattern to create a Sending EventData is:\n\n```java\ni. Serialize the sending ApplicationEvent to be sent to EventHubs into bytes.\n ii. If complex serialization logic is involved (for example: multiple types of data) - add a Hint using the for the Consumer.\n```\n\nIllustration:\n\n```java\nEventData eventData = EventData.create(telemetryEventBytes, offset, length);\n eventData.getProperties().put(\"eventType\", \"com.microsoft.azure.monitoring.EtlEvent\");\n partitionSender.Send(eventData);\n```" returns: description: "EventData the created to send to EventHubs." type: "" - uid: "com.microsoft.azure.eventhubs.EventData.create(java.nio.ByteBuffer)" fullName: "com.microsoft.azure.eventhubs.EventData.create(ByteBuffer buffer)" name: "create(ByteBuffer buffer)" nameWithType: "EventData.create(ByteBuffer buffer)" summary: "Construct EventData to Send to EventHubs." modifiers: - "static" parameters: - description: "ByteBuffer which references the payload of the Event to be sent to EventHubs" name: "buffer" type: "ByteBuffer" syntax: "public static EventData create(ByteBuffer buffer)" desc: "Construct EventData to Send to EventHubs. Typical pattern to create a Sending EventData is:\n\n```java\ni. Serialize the sending ApplicationEvent to be sent to EventHubs into bytes.\n ii. If complex serialization logic is involved (for example: multiple types of data) - add a Hint using the for the Consumer.\n```\n\nIllustration:\n\n```java\nEventData eventData = EventData.create(telemetryEventByteBuffer);\n eventData.getProperties().put(\"eventType\", \"com.microsoft.azure.monitoring.EtlEvent\");\n partitionSender.Send(eventData);\n```" returns: description: "EventData the created to send to EventHubs." type: "" - uid: "com.microsoft.azure.eventhubs.EventData.getBytes()" fullName: "com.microsoft.azure.eventhubs.EventData.getBytes()" name: "getBytes()" nameWithType: "EventData.getBytes()" summary: "Get Actual Payload/Data wrapped by EventData." modifiers: - "abstract" syntax: "public abstract byte[] getBytes()" desc: "Get Actual Payload/Data wrapped by EventData." returns: description: "byte[] of the actual data\n

null if the body of the message has other inter-operable AMQP messages, whose body does not represent byte[].\n In that case use ." type: "[]" - uid: "com.microsoft.azure.eventhubs.EventData.getObject()" fullName: "com.microsoft.azure.eventhubs.EventData.getObject()" name: "getObject()" nameWithType: "EventData.getObject()" summary: "Use this method only if, the sender could be sending messages using third-party AMQP libraries." modifiers: - "abstract" syntax: "public abstract Object getObject()" desc: "Use this method only if, the sender could be sending messages using third-party AMQP libraries.\n\nIf all the senders of EventHub use client libraries released and maintained by Microsoft Azure EventHubs, use method.\n\nGet the value of AMQP messages' Body section on the received .\n\nIf the AMQP message Body is always guaranteed to have Data section, use method." returns: description: "returns the Object which could represent either Data or AmqpValue or AmqpSequence.\n

if the Body is Data section\n

List if the Body is AmqpSequence\n

package org.apache.qpid.proton.amqp contains various AMQP types that could be returned." type: "Object" - uid: "com.microsoft.azure.eventhubs.EventData.getProperties()" fullName: "com.microsoft.azure.eventhubs.EventData.getProperties()" name: "getProperties()" nameWithType: "EventData.getProperties()" summary: "Application property bag" modifiers: - "abstract" syntax: "public abstract Map getProperties()" desc: "Application property bag" returns: description: "returns Application properties" type: "Map<String,Object>" - uid: "com.microsoft.azure.eventhubs.EventData.getSystemProperties()" fullName: "com.microsoft.azure.eventhubs.EventData.getSystemProperties()" name: "getSystemProperties()" nameWithType: "EventData.getSystemProperties()" summary: "SystemProperties that are populated by EventHubService." modifiers: - "abstract" syntax: "public abstract EventData.SystemProperties getSystemProperties()" desc: "SystemProperties that are populated by EventHubService.\n\nAs these are populated by Service, they are only present on a Received EventData.\n\nUsage:\n\n`final String offset = eventData.getSystemProperties().getOffset();`" returns: description: "an encapsulation of all SystemProperties appended by EventHubs service into EventData.\n null if the is not received and is created by the public constructors." type: "" - uid: "com.microsoft.azure.eventhubs.EventData.setSystemProperties(com.microsoft.azure.eventhubs.EventData.SystemProperties)" fullName: "com.microsoft.azure.eventhubs.EventData.setSystemProperties(EventData.SystemProperties props)" name: "setSystemProperties(EventData.SystemProperties props)" nameWithType: "EventData.setSystemProperties(EventData.SystemProperties props)" modifiers: - "abstract" parameters: - name: "props" type: "" syntax: "public abstract void setSystemProperties(EventData.SystemProperties props)" type: "interface" desc: "The data structure encapsulating the Event being sent-to and received-from EventHubs. Each EventHubs partition can be visualized as a Stream of .\n\nSerializing a received with AMQP sections other than ApplicationProperties (with primitive java types) and Data section is not supported.\n\nHere's how AMQP message sections map to . Here's the reference used for AMQP 1.0 specification: http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf\n\n```java\ni. - AMQPMessage.ApplicationProperties section\n ii. - if AMQPMessage.Body has Data section\n iii. - if AMQPMessage.Body has AMQPValue or AMQPSequence sections\n```\n\nWhile using client libraries released by Microsoft Azure EventHubs, sections (i) and (ii) alone are sufficient. Section (iii) is used for advanced scenarios, where the sending application uses third-party AMQP library to send the message to EventHubs and the receiving application uses this client library to receive ." implements: - "Serializable" - "Comparable<>" metadata: {} package: "com.microsoft.azure.eventhubs" artifact: com.microsoft.azure:azure-eventhubs:3.2.2