/
com.microsoft.azure.eventhubs.PartitionReceiver.yml
225 lines (225 loc) · 19.9 KB
/
com.microsoft.azure.eventhubs.PartitionReceiver.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
### YamlMime:JavaType
uid: "com.microsoft.azure.eventhubs.PartitionReceiver"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver"
name: "PartitionReceiver"
nameWithType: "PartitionReceiver"
summary: "This is a logical representation of receiving from a Event<wbr>Hub partition."
syntax: "public interface **PartitionReceiver**"
fields:
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.DEFAULT_PREFETCH_COUNT"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.DEFAULT_PREFETCH_COUNT"
name: "DEFAULT_PREFETCH_COUNT"
nameWithType: "PartitionReceiver.DEFAULT_PREFETCH_COUNT"
modifiers:
- "static"
- "final"
field:
value: "500"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static final int DEFAULT_PREFETCH_COUNT"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.MAXIMUM_PREFETCH_COUNT"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.MAXIMUM_PREFETCH_COUNT"
name: "MAXIMUM_PREFETCH_COUNT"
nameWithType: "PartitionReceiver.MAXIMUM_PREFETCH_COUNT"
modifiers:
- "static"
- "final"
field:
value: "8000"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static final int MAXIMUM_PREFETCH_COUNT"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.MINIMUM_PREFETCH_COUNT"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.MINIMUM_PREFETCH_COUNT"
name: "MINIMUM_PREFETCH_COUNT"
nameWithType: "PartitionReceiver.MINIMUM_PREFETCH_COUNT"
modifiers:
- "static"
- "final"
field:
value: "1"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static final int MINIMUM_PREFETCH_COUNT"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.NULL_EPOCH"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.NULL_EPOCH"
name: "NULL_EPOCH"
nameWithType: "PartitionReceiver.NULL_EPOCH"
modifiers:
- "static"
- "final"
field:
value: "0"
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static final long NULL_EPOCH"
methods:
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.close()"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.close()"
name: "close()"
nameWithType: "PartitionReceiver.close()"
modifiers:
- "abstract"
syntax: "public abstract CompletableFuture<Void> close()"
returns:
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html\">CompletableFuture</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>>"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.closeSync()"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.closeSync()"
name: "closeSync()"
nameWithType: "PartitionReceiver.closeSync()"
modifiers:
- "abstract"
syntax: "public abstract void closeSync()"
exceptions:
- type: "<xref href=\"com.microsoft.azure.eventhubs.EventHubException?alt=com.microsoft.azure.eventhubs.EventHubException&text=EventHubException\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.getEpoch()"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.getEpoch()"
name: "getEpoch()"
nameWithType: "PartitionReceiver.getEpoch()"
summary: "Get the epoch value that this receiver is currently using for partition ownership."
modifiers:
- "abstract"
syntax: "public abstract long getEpoch()"
desc: "Get the epoch value that this receiver is currently using for partition ownership.\n\nA value of 0 means this receiver is not an epoch-based receiver."
returns:
description: "the epoch value that this receiver is currently using for partition ownership."
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.getEventPosition()"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.getEventPosition()"
name: "getEventPosition()"
nameWithType: "PartitionReceiver.getEventPosition()"
summary: "Get the <xref uid=\"com.microsoft.azure.eventhubs.EventPosition\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventPosition\"></xref> that corresponds to an <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> which was returned last by the receiver."
modifiers:
- "abstract"
syntax: "public abstract EventPosition getEventPosition()"
desc: "Get the <xref uid=\"com.microsoft.azure.eventhubs.EventPosition\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventPosition\"></xref> that corresponds to an <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> which was returned last by the receiver.\n\nThis value will not be populated, unless the knob <xref uid=\"com.microsoft.azure.eventhubs.ReceiverOptions.setReceiverRuntimeMetricEnabled(boolean)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ReceiverOptions#setReceiverRuntimeMetricEnabled(boolean)\"></xref> is set. Note that EventPosition object is initialized using SequenceNumber and other parameters are not set and get will return null."
returns:
description: "the EventPosition object."
type: "<xref href=\"com.microsoft.azure.eventhubs.EventPosition?alt=com.microsoft.azure.eventhubs.EventPosition&text=EventPosition\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.getIsOpen()"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.getIsOpen()"
name: "getIsOpen()"
nameWithType: "PartitionReceiver.getIsOpen()"
summary: "Determine the current state of the receiver."
modifiers:
- "abstract"
syntax: "public abstract boolean getIsOpen()"
desc: "Determine the current state of the receiver."
returns:
description: "false if the receiver is closing or has been closed, true if the receiver is open and ready to use."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.getPartitionId()"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.getPartitionId()"
name: "getPartitionId()"
nameWithType: "PartitionReceiver.getPartitionId()"
summary: "Get Event<wbr>Hubs partition identifier."
modifiers:
- "abstract"
syntax: "public abstract String getPartitionId()"
desc: "Get EventHubs partition identifier."
returns:
description: "The identifier representing the partition from which this receiver is fetching data"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.getReceiveTimeout()"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.getReceiveTimeout()"
name: "getReceiveTimeout()"
nameWithType: "PartitionReceiver.getReceiveTimeout()"
modifiers:
- "abstract"
syntax: "public abstract Duration getReceiveTimeout()"
returns:
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.getRuntimeInformation()"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.getRuntimeInformation()"
name: "getRuntimeInformation()"
nameWithType: "PartitionReceiver.getRuntimeInformation()"
summary: "Gets the temporal <xref uid=\"com.microsoft.azure.eventhubs.ReceiverRuntimeInformation\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ReceiverRuntimeInformation\"></xref> for this Event<wbr>Hub partition."
modifiers:
- "abstract"
syntax: "public abstract ReceiverRuntimeInformation getRuntimeInformation()"
desc: "Gets the temporal <xref uid=\"com.microsoft.azure.eventhubs.ReceiverRuntimeInformation\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ReceiverRuntimeInformation\"></xref> for this EventHub partition. In general, this information is a representation of, where this <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiver\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiver\"></xref>'s end of stream is, at the time <xref uid=\"com.microsoft.azure.eventhubs.ReceiverRuntimeInformation.getRetrievalTime()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ReceiverRuntimeInformation#getRetrievalTime()\"></xref>.\n\nThis value will not be populated, unless the knob <xref uid=\"com.microsoft.azure.eventhubs.ReceiverOptions.setReceiverRuntimeMetricEnabled(boolean)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ReceiverOptions#setReceiverRuntimeMetricEnabled(boolean)\"></xref> is set. This value will be refreshed every time an <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> is consumed from <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiver\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiver\"></xref>. For ex: if no events have been consumed, then this value is not populated."
returns:
description: "receiver runtime information"
type: "<xref href=\"com.microsoft.azure.eventhubs.ReceiverRuntimeInformation?alt=com.microsoft.azure.eventhubs.ReceiverRuntimeInformation&text=ReceiverRuntimeInformation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.receive(int)"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.receive(int maxEventCount)"
name: "receive(int maxEventCount)"
nameWithType: "PartitionReceiver.receive(int maxEventCount)"
summary: "Receive a batch of <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>'s from an Event<wbr>Hub partition"
modifiers:
- "abstract"
parameters:
- description: "maximum number of <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>'s that this call should return"
name: "maxEventCount"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract CompletableFuture<Iterable<EventData>> receive(int maxEventCount)"
desc: "Receive a batch of <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>'s from an EventHub partition\n\nSample code (sample uses sync version of the api but concept are identical):\n\n```java\nEventHubClient client = EventHubClient.createSync(\"__connection__\");\n PartitionReceiver receiver = client.createPartitionReceiverSync(\"ConsumerGroup1\", \"1\");\n Iterable receivedEvents = receiver.receiveSync();\n\n while (true)\n {\n int batchSize = 0;\n if (receivedEvents != null)\n {\n for(EventData receivedEvent: receivedEvents)\n {\n System.out.println(String.format(\"Message Payload: %s\", new String(receivedEvent.getBytes(), Charset.defaultCharset())));\n System.out.println(String.format(\"Offset: %s, SeqNo: %s, EnqueueTime: %s\",\n receivedEvent.getSystemProperties().getOffset(),\n receivedEvent.getSystemProperties().getSequenceNumber(),\n receivedEvent.getSystemProperties().getEnqueuedTime()));\n batchSize++;\n }\n }\n\n System.out.println(String.format(\"ReceivedBatch Size: %s\", batchSize));\n receivedEvents = receiver.receiveSync();\n }\n```"
returns:
description: "A completableFuture that will yield a batch of <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>'s from the partition on which this receiver is created. Returns 'null' if no <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> is present."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html\">CompletableFuture</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a><<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.PartitionReceiver.receiveSync(int)"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.receiveSync(int maxEventCount)"
name: "receiveSync(int maxEventCount)"
nameWithType: "PartitionReceiver.receiveSync(int maxEventCount)"
summary: "Synchronous version of <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiver.receive*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#receive\"></xref>."
modifiers:
- "default"
parameters:
- description: "maximum number of <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>'s that this call should return"
name: "maxEventCount"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default Iterable<EventData> receiveSync(int maxEventCount)"
exceptions:
- description: "if ServiceBus client encountered any unrecoverable/non-transient problems during <xref uid=\"#receive\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#receive\"></xref>"
type: "<xref href=\"com.microsoft.azure.eventhubs.EventHubException?alt=com.microsoft.azure.eventhubs.EventHubException&text=EventHubException\" data-throw-if-not-resolved=\"False\" />"
desc: "Synchronous version of <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiver.receive*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#receive\"></xref>."
returns:
description: "Batch of <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref>'s from the partition on which this receiver is created. Returns 'null' if no <xref uid=\"com.microsoft.azure.eventhubs.EventData\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventData\"></xref> is present."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a><<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.PartitionReceiver.setReceiveHandler(com.microsoft.azure.eventhubs.PartitionReceiveHandler)"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.setReceiveHandler(PartitionReceiveHandler receiveHandler)"
name: "setReceiveHandler(PartitionReceiveHandler receiveHandler)"
nameWithType: "PartitionReceiver.setReceiveHandler(PartitionReceiveHandler receiveHandler)"
summary: "Register a receive handler that will be called when an event is available."
modifiers:
- "abstract"
parameters:
- description: "An implementation of <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiveHandler\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiveHandler\"></xref>. Setting this handler to <code>null</code> will stop the receive pump."
name: "receiveHandler"
type: "<xref href=\"com.microsoft.azure.eventhubs.PartitionReceiveHandler?alt=com.microsoft.azure.eventhubs.PartitionReceiveHandler&text=PartitionReceiveHandler\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract CompletableFuture<Void> setReceiveHandler(PartitionReceiveHandler receiveHandler)"
desc: "Register a receive handler that will be called when an event is available. A <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiveHandler\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiveHandler\"></xref> is a handler that allows user to specify a callback for event processing and error handling in a receive pump model."
returns:
description: "A completableFuture which sets receiveHandler"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html\">CompletableFuture</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>>"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.setReceiveHandler(com.microsoft.azure.eventhubs.PartitionReceiveHandler,boolean)"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.setReceiveHandler(PartitionReceiveHandler receiveHandler, boolean invokeWhenNoEvents)"
name: "setReceiveHandler(PartitionReceiveHandler receiveHandler, boolean invokeWhenNoEvents)"
nameWithType: "PartitionReceiver.setReceiveHandler(PartitionReceiveHandler receiveHandler, boolean invokeWhenNoEvents)"
summary: "Register a receive handler that will be called when an event is available."
modifiers:
- "abstract"
parameters:
- description: "An implementation of <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiveHandler\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiveHandler\"></xref>"
name: "receiveHandler"
type: "<xref href=\"com.microsoft.azure.eventhubs.PartitionReceiveHandler?alt=com.microsoft.azure.eventhubs.PartitionReceiveHandler&text=PartitionReceiveHandler\" data-throw-if-not-resolved=\"False\" />"
- description: "flag to indicate whether the <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiveHandler.onReceive(java.lang.Iterable<com.microsoft.azure.eventhubs.EventData>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiveHandler#onReceive(Iterable)\"></xref> should be invoked when the receive call times out"
name: "invokeWhenNoEvents"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract CompletableFuture<Void> setReceiveHandler(PartitionReceiveHandler receiveHandler, boolean invokeWhenNoEvents)"
desc: "Register a receive handler that will be called when an event is available. A <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiveHandler\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiveHandler\"></xref> is a handler that allows user to specify a callback for event processing and error handling in a receive pump model."
returns:
description: "A completableFuture which sets receiveHandler"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html\">CompletableFuture</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>>"
- uid: "com.microsoft.azure.eventhubs.PartitionReceiver.setReceiveTimeout(java.time.Duration)"
fullName: "com.microsoft.azure.eventhubs.PartitionReceiver.setReceiveTimeout(Duration value)"
name: "setReceiveTimeout(Duration value)"
nameWithType: "PartitionReceiver.setReceiveTimeout(Duration value)"
modifiers:
- "abstract"
parameters:
- name: "value"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public abstract void setReceiveTimeout(Duration value)"
type: "interface"
desc: "This is a logical representation of receiving from a EventHub partition.\n\nA <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiver\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiver\"></xref> is tied to a ConsumerGroup + EventHub Partition combination.\n\n * If an epoch based <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiver\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiver\"></xref> (i.e., PartitionReceiver.getEpoch != 0) is created, EventHubs service will guarantee only 1 active receiver exists per ConsumerGroup + Partition combo. This is the recommended approach to create a <xref uid=\"com.microsoft.azure.eventhubs.PartitionReceiver\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionReceiver\"></xref>.\n * Multiple receivers per ConsumerGroup + Partition combo can be created using non-epoch receivers."
metadata: {}
package: "com.microsoft.azure.eventhubs"
artifact: com.microsoft.azure:azure-eventhubs:3.2.2