/** * Synchronous version of {@link #createEpochReceiver(String, String, EventPosition, long)}. * * @param consumerGroupName the consumer group name that this receiver should be grouped under. * @param partitionId the partition Id that the receiver belongs to. All data received will be from this partition only. * @param eventPosition the position to start receiving the events from. See {@link EventPosition} * @param epoch an unique identifier (epoch value) that the service uses, to enforce partition/lease ownership. * @return PartitionReceiver instance which can be used for receiving {@link EventData}. * @throws EventHubException if Service Bus service encountered problems during the operation. */ default PartitionReceiver createEpochReceiverSync(final String consumerGroupName, final String partitionId, final EventPosition eventPosition, final long epoch) throws EventHubException { return ExceptionUtil.sync(() -> this.createEpochReceiver(consumerGroupName, partitionId, eventPosition, epoch).get()); }
/** * Synchronous version of {@link #createEpochReceiver(String, String, EventPosition, long)}. * * @param consumerGroupName the consumer group name that this receiver should be grouped under. * @param partitionId the partition Id that the receiver belongs to. All data received will be from this partition only. * @param eventPosition the position to start receiving the events from. See {@link EventPosition} * @param epoch an unique identifier (epoch value) that the service uses, to enforce partition/lease ownership. * @param receiverOptions the set of options to enable on the event hubs receiver * @return PartitionReceiver instance which can be used for receiving {@link EventData}. * @throws EventHubException if Service Bus service encountered problems during the operation. */ default PartitionReceiver createEpochReceiverSync(final String consumerGroupName, final String partitionId, final EventPosition eventPosition, final long epoch, final ReceiverOptions receiverOptions) throws EventHubException { return ExceptionUtil.sync(() -> this.createEpochReceiver(consumerGroupName, partitionId, eventPosition, epoch, receiverOptions).get()); }
options.setPrefetchCount(this.hostContext.getEventProcessorOptions().getPrefetchCount()); receiverFuture = this.eventHubClient.createEpochReceiver(this.partitionContext.getConsumerGroupName(), this.partitionContext.getPartitionId(), startAt, epoch, options); this.internalOperationFuture = receiverFuture;