Home > Blockchain >  Apache Spark Streaming Connection String error with Databricks connection to Azure Event Hub
Apache Spark Streaming Connection String error with Databricks connection to Azure Event Hub

Time:03-21

I'm getting the error:

Exception: ERROR: 'int' object has no attribute 'value'
AttributeError: 'str' object has no attribute '_jvm'
ehConf['eventhubs.connectionString'] = self.connectionProperties.sc._jvm.org.apache.spark.eventhubs.EventHubsUtils.encrypt(connectionString)

When I try and call the following function:

def EventHubConnectionProperties(self,processId,startOffset,endTime):
        ehConf = {}
        ehConf['eventhubs.connectionString'] = self.connectionProperties.sc._jvm.org.apache.spark.eventhubs.EventHubsUtils.encrypt(connectionString)

Does anyone have any thoughts?

CodePudding user response:

It should be used as below -

ehConf['eventhubs.connectionString'] = sc._jvm.org.apache.spark.eventhubs.EventHubsUtils.encrypt(connectionString)
  • Related