Github user harshach commented on a diff in the pull request: https://github.com/apache/storm/pull/1998#discussion_r106768154 --- Diff: external/storm-eventhubs/src/main/java/org/apache/storm/eventhubs/spout/EventHubReceiverImpl.java --- @@ -65,77 +57,81 @@ public EventHubReceiverImpl(EventHubSpoutConfig config, String partitionId) { } @Override - public void open(IEventHubFilter filter) throws EventHubException { - logger.info("creating eventhub receiver: partitionId=" + partitionId + - ", filterString=" + filter.getFilterString()); + public void open(String offset) throws EventHubException { + logger.info("creating eventhub receiver: partitionId=" + partitionId + + ", offset=" + offset); long start = System.currentTimeMillis(); - receiver = new ResilientEventHubReceiver(connectionString, entityName, - partitionId, consumerGroupName, defaultCredits, filter); - receiver.initialize(); - + try { + ehClient = EventHubClient.createFromConnectionStringSync(connectionString); + receiver = ehClient.createEpochReceiverSync( + consumerGroupName, + partitionId, + offset, + false, + 1); + }catch (Exception e){ + logger.info("Exception in creating EventhubClient"+e.toString()); + } long end = System.currentTimeMillis(); logger.info("created eventhub receiver, time taken(ms): " + (end-start)); } @Override - public void close() { + public void close(){ if(receiver != null) { - receiver.close(); + try { + receiver.close().whenComplete((voidargs,error)->{ + try{ + if(error!=null){ + logger.error("Exception during receiver close phase"+error.toString()); + } + ehClient.closeSync(); + }catch (Exception e){ --- End diff -- same here
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---