| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using Microsoft.Azure.Amqp; |
| | 5 | | using Microsoft.Azure.Amqp.Encoding; |
| | 6 | |
|
| | 7 | | namespace Azure.Messaging.EventHubs |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// The set of well-known properties associated with an AMQP messages and |
| | 11 | | /// entities. |
| | 12 | | /// </summary> |
| | 13 | | /// |
| | 14 | | internal static class AmqpProperty |
| | 15 | | { |
| | 16 | | /// <summary> |
| | 17 | | /// The owner level (a.k.a. epoch) to associate with a link. |
| | 18 | | /// </summary> |
| | 19 | | /// |
| 14 | 20 | | public static AmqpSymbol OwnerLevel { get; } = AmqpConstants.Vendor + ":epoch"; |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// The type of Event Hubs entity to associate with a link. |
| | 24 | | /// </summary> |
| | 25 | | /// |
| 34 | 26 | | public static AmqpSymbol EntityType { get; } = AmqpConstants.Vendor + ":entity-type"; |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// The capability for tracking the last event enqueued in a partition, to associate with a link. |
| | 30 | | /// </summary> |
| | 31 | | /// |
| 8 | 32 | | public static AmqpSymbol TrackLastEnqueuedEventProperties { get; } = AmqpConstants.Vendor + ":enable-receiver-ru |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// The timeout to associate with a link. |
| | 36 | | /// </summary> |
| | 37 | | /// |
| 16 | 38 | | public static AmqpSymbol Timeout { get; } = AmqpConstants.Vendor + ":timeout"; |
| | 39 | |
|
| | 40 | | /// <summary> |
| | 41 | | /// The date and time, in UTC, that a message was enqueued. |
| | 42 | | /// </summary> |
| | 43 | | /// |
| 30 | 44 | | public static AmqpSymbol EnqueuedTime { get; } = "x-opt-enqueued-time"; |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// The sequence number assigned to a message. |
| | 48 | | /// </summary> |
| | 49 | | /// |
| 22 | 50 | | public static AmqpSymbol SequenceNumber { get; } = "x-opt-sequence-number"; |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// The offset of a message within a given partition. |
| | 54 | | /// </summary> |
| | 55 | | /// |
| 26 | 56 | | public static AmqpSymbol Offset { get; } = "x-opt-offset"; |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// The partition hashing key used for grouping a batch of events together with the intent of routing to a sin |
| | 60 | | /// </summary> |
| | 61 | | /// |
| 148 | 62 | | public static AmqpSymbol PartitionKey { get; } = "x-opt-partition-key"; |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// The message property that identifies the last sequence number enqueued for a partition. |
| | 66 | | /// </summary> |
| | 67 | | /// |
| 14 | 68 | | public static AmqpSymbol PartitionLastEnqueuedSequenceNumber { get; } = "last_enqueued_sequence_number"; |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// The message property that identifies the last offset enqueued for a partition. |
| | 72 | | /// </summary> |
| | 73 | | /// |
| 14 | 74 | | public static AmqpSymbol PartitionLastEnqueuedOffset { get; } = "last_enqueued_offset"; |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// The message property that identifies the last time enqueued for a partition. |
| | 78 | | /// </summary> |
| | 79 | | /// |
| 18 | 80 | | public static AmqpSymbol PartitionLastEnqueuedTimeUtc { get; } = "last_enqueued_time_utc"; |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// The message property that identifies the time that the last enqueued event information was |
| | 84 | | /// received from the service. |
| | 85 | | /// </summary> |
| | 86 | | /// |
| 18 | 87 | | public static AmqpSymbol LastPartitionPropertiesRetrievalTimeUtc { get; } = "runtime_info_retrieval_time_utc"; |
| | 88 | |
|
| | 89 | | /// <summary> |
| | 90 | | /// The set of descriptors for well-known <see cref="DescribedType" /> |
| | 91 | | /// property types. |
| | 92 | | /// </summary> |
| | 93 | | /// |
| | 94 | | public static class Descriptor |
| | 95 | | { |
| | 96 | | /// <summary> |
| | 97 | | /// A type annotation for representing a <see cref="System.TimeSpan" /> in a message. |
| | 98 | | /// </summary> |
| | 99 | | /// |
| 14 | 100 | | public static AmqpSymbol TimeSpan { get; } = AmqpConstants.Vendor + ":timespan"; |
| | 101 | |
|
| | 102 | | /// <summary> |
| | 103 | | /// A type annotation for representing a <see cref="System.Uri" /> in a message. |
| | 104 | | /// </summary> |
| | 105 | | /// |
| 16 | 106 | | public static AmqpSymbol Uri { get; } = AmqpConstants.Vendor + ":uri"; |
| | 107 | |
|
| | 108 | | /// <summary> |
| | 109 | | /// A type annotation for representing a <see cref="System.DateTimeOffset" /> in a message. |
| | 110 | | /// </summary> |
| | 111 | | /// |
| 12 | 112 | | public static AmqpSymbol DateTimeOffset { get; } = AmqpConstants.Vendor + ":datetime-offset"; |
| | 113 | | } |
| | 114 | |
|
| | 115 | | /// <summary> |
| | 116 | | /// Represents the entity mapping for AMQP properties between the client library and |
| | 117 | | /// the Event Hubs service. |
| | 118 | | /// </summary> |
| | 119 | | /// |
| | 120 | | /// <remarks> |
| | 121 | | /// WARNING: |
| | 122 | | /// These values are synchronized between the Event Hubs service and the client |
| | 123 | | /// library. You must consult with the Event Hubs service team before making |
| | 124 | | /// changes, including adding a new member. |
| | 125 | | /// |
| | 126 | | /// When adding a new member, remember to always do so before the Unknown |
| | 127 | | /// member. |
| | 128 | | /// </remarks> |
| | 129 | | /// |
| | 130 | | public enum Entity |
| | 131 | | { |
| | 132 | | Namespace = 4, |
| | 133 | | EventHub = 7, |
| | 134 | | ConsumerGroup = 8, |
| | 135 | | Partition = 9, |
| | 136 | | Checkpoint = 10, |
| | 137 | | Unknown = 0x7FFFFFFE |
| | 138 | | } |
| | 139 | |
|
| | 140 | | /// <summary> |
| | 141 | | /// Represents the type mapping for AMQP properties between the client library and |
| | 142 | | /// the Event Hubs service. |
| | 143 | | /// </summary> |
| | 144 | | /// |
| | 145 | | /// <remarks> |
| | 146 | | /// WARNING: |
| | 147 | | /// These values are synchronized between the Event Hubs service and the client |
| | 148 | | /// library. You must consult with the Event Hubs service team before making |
| | 149 | | /// changes, including adding a new member. |
| | 150 | | /// |
| | 151 | | /// When adding a new member, remember to always do so before the Unknown |
| | 152 | | /// member. |
| | 153 | | /// </remarks> |
| | 154 | | /// |
| | 155 | | public enum Type |
| | 156 | | { |
| | 157 | | Null, |
| | 158 | | Byte, |
| | 159 | | SByte, |
| | 160 | | Char, |
| | 161 | | Int16, |
| | 162 | | UInt16, |
| | 163 | | Int32, |
| | 164 | | UInt32, |
| | 165 | | Int64, |
| | 166 | | UInt64, |
| | 167 | | Single, |
| | 168 | | Double, |
| | 169 | | Decimal, |
| | 170 | | Boolean, |
| | 171 | | Guid, |
| | 172 | | String, |
| | 173 | | Uri, |
| | 174 | | DateTime, |
| | 175 | | DateTimeOffset, |
| | 176 | | TimeSpan, |
| | 177 | | Stream, |
| | 178 | | Unknown |
| | 179 | | } |
| | 180 | | } |
| | 181 | | } |