Closed dpaje closed 5 years ago
@dpaje thanks for raising this issue! Do you know what is the value that is returned by this code EventPosition.fromEnqueuedTime(Date.now())
?
@dpaje I'm adding a sample code based on what you described above and It works without any errors.
I would like to suggest:
EventPosition.fromEnqueuedTime
using date format
Example :
const date: Date = new Date('2019-02-14');
Sample Code:
async function startEph(ephName: string): Promise<EventProcessorHost> {
// This is the enqueue time of my messages.
const date: Date = new Date('Thu Feb 14 2019 12:14:20 GMT-0800 (Pacific Standard Time)');
// Create the Event Processo Host
const eph = EventProcessorHost.createFromConnectionString(
EventProcessorHost.createHostName(ephName),
storageCS!,
storageContainerName,
ehCS!,
{
eventHubPath: path,
initialOffset: EventPosition.fromEnqueuedTime(date),
onEphError: (error) => {
console.log(">>>>>>> [%s] Error: %O", ephName, error);
}
}
);
const onMessage: OnReceivedMessage = async (context: PartitionContext, data: EventData) => {
console.log(data);
};
// Error handler
const onError: OnReceivedError = (error) => {
console.log(">>>>> [%s] Received Error: %O", ephName, error);
};
console.log(">>>>>> Starting the EPH - %s", ephName);
await eph.start(onMessage, onError);
return eph;
}
Package-name: azure-event-processor-host Package-version: 1.0.6 node.js version: 10.14.1 OS name and version: Windows 10 Enterprise
Can you please provide more details about the error or stack trace?
@dpaje We havent heard back from you in a while, so we are assuming that you are not seeing this issue anymore. Therefore, we are closing this issue.
If you still see this problem or you have any other feedback on this library, please feel free to open a new issue.
Describe the bug Initial offset for EventProcessorHost is set to 0 and cannot be overridden.
To Reproduce Steps to reproduce the behavior:
The supplied offset '0' is invalid. The last offset in the system is '-1'
even if you changeinitialOffset
to any other value inEventProcessorHost.createFromConnectionString
or omit it altogetherExpected behavior The initial offset should be overridable to whatever is passed to the create method. If it's not passed, it should correctly default to -1 (the eventhub default)
Package-name: azure-event-hubs | azure-event-processor-host Package-version: 1.0.6 node.js version: 9.7.1 OS name and version: OSX 10.14
Additional context Add any other context about the problem here.