azure-docs-sdk-java/docs-ref-autogen/com.microsoft.azure.eventhu...

129 строки
12 KiB
YAML

### 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 Event<wbr>Hubs."
syntax: "public interface **EventData**</br> extends <a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html\">Serializable</a>, <a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html\">Comparable</a>&lt;<xref href=\"com.microsoft.azure.eventhubs.EventData?alt=com.microsoft.azure.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />&gt;"
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 Event<wbr>Data to Send to Event<wbr>Hubs."
modifiers:
- "static"
parameters:
- description: "the actual payload of data in bytes to be Sent to EventHubs."
name: "data"
type: "<xref href=\"byte?alt=byte&text=byte\" data-throw-if-not-resolved=\"False\" />[]"
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 <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> to send to EventHubs."
type: "<xref href=\"com.microsoft.azure.eventhubs.EventData?alt=com.microsoft.azure.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />"
- 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 Event<wbr>Data to Send to Event<wbr>Hubs."
modifiers:
- "static"
parameters:
- description: "the byte[] where the payload of the Event to be sent to EventHubs is present"
name: "data"
type: "<xref href=\"byte?alt=byte&text=byte\" data-throw-if-not-resolved=\"False\" />[]"
- description: "Offset in the byte[] to read from ; inclusive index"
name: "offset"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "length of the byte[] to be read, starting from offset"
name: "length"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
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 <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> to send to EventHubs."
type: "<xref href=\"com.microsoft.azure.eventhubs.EventData?alt=com.microsoft.azure.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />"
- 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 Event<wbr>Data to Send to Event<wbr>Hubs."
modifiers:
- "static"
parameters:
- description: "ByteBuffer which references the payload of the Event to be sent to EventHubs"
name: "buffer"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html\">ByteBuffer</a>"
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 <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> to send to EventHubs."
type: "<xref href=\"com.microsoft.azure.eventhubs.EventData?alt=com.microsoft.azure.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />"
- 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 Event<wbr>Data."
modifiers:
- "abstract"
syntax: "public abstract byte[] getBytes()"
desc: "Get Actual Payload/Data wrapped by EventData."
returns:
description: "byte[] of the actual data\n <p>null if the body of the message has other inter-operable AMQP messages, whose body does not represent byte[].\n In that case use <xref uid=\"com.microsoft.azure.eventhubs.EventData.getObject()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getObject()\"></xref>."
type: "<xref href=\"byte?alt=byte&text=byte\" data-throw-if-not-resolved=\"False\" />[]"
- 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 <xref uid=\"com.microsoft.azure.eventhubs.EventData.getBytes()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBytes()\"></xref> method.\n\nGet the value of AMQP messages' Body section on the received <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>.\n\nIf the AMQP message Body is always guaranteed to have Data section, use <xref uid=\"com.microsoft.azure.eventhubs.EventData.getBytes()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#getBytes()\"></xref> method."
returns:
description: "returns the Object which could represent either Data or AmqpValue or AmqpSequence.\n <p><xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Binary\"></xref> if the Body is Data section\n <p><a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a> if the Body is AmqpSequence\n <p>package org.apache.qpid.proton.amqp contains various AMQP types that could be returned."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
- 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<String,Object> getProperties()"
desc: "Application property bag"
returns:
description: "returns Application properties"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>&gt;"
- uid: "com.microsoft.azure.eventhubs.EventData.getSystemProperties()"
fullName: "com.microsoft.azure.eventhubs.EventData.getSystemProperties()"
name: "getSystemProperties()"
nameWithType: "EventData.getSystemProperties()"
summary: "System<wbr>Properties that are populated by Event<wbr>Hub<wbr>Service."
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 <code>null</code> if the <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> is not received and is created by the public constructors."
type: "<xref href=\"com.microsoft.azure.eventhubs.EventData.SystemProperties?alt=com.microsoft.azure.eventhubs.EventData.SystemProperties&text=SystemProperties\" data-throw-if-not-resolved=\"False\" />"
- 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: "<xref href=\"com.microsoft.azure.eventhubs.EventData.SystemProperties?alt=com.microsoft.azure.eventhubs.EventData.SystemProperties&text=SystemProperties\" data-throw-if-not-resolved=\"False\" />"
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 <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>.\n\nSerializing a received <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> 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 <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>. 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 <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>."
implements:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html\">Serializable</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html\">Comparable</a>&lt;<xref href=\"com.microsoft.azure.eventhubs.EventData?alt=com.microsoft.azure.eventhubs.EventData&text=EventData\" data-throw-if-not-resolved=\"False\" />&gt;"
metadata: {}
package: "com.microsoft.azure.eventhubs"
artifact: com.microsoft.azure:azure-eventhubs:3.2.2