question

vishalchitrala-8227 avatar image
0 Votes"
vishalchitrala-8227 asked PRADEEPCHEEKATLA-MSFT commented

I'm trying to configure Azure event hub and databricks(Python) notebook and getting the following error, any help is appreciated! Issue is while configuring variable - 'eventHubConfiguration'

 #event hub name 
 eventhubname = "rideeventhub"
    
 #Event Hub Connection String 
 eventHubConnectionstring = namespaceConnectionString + ";EntityPath=" + eventhubname
    
    
 **eventHubConfiguration** = {
   'eventhubs.connectionString' : sc._jvm.org.apache.spark.eventhubs.EventHubsUtils.encrypt(eventHubConnectionstring)
 }

Error message :
ERROR:root:Exception while sending command.
Traceback (most recent call last):
File "/databricks/spark/python/lib/py4j-0.10.9.1-src.zip/py4j/java_gateway.py", line 1207, in send_command
raise Py4JNetworkError("Answer from Java side is empty")
py4j.protocol.Py4JNetworkError: Answer from Java side is empty

199404-111.png


azure-databricksazure-event-hubsazure-stream-analytics
111.png (107.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @vishalchitrala-8227,

Following up to see if the below suggestion was helpful. And, if you have any further query do let us know.


  • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.

0 Votes 0 ·

1 Answer

PRADEEPCHEEKATLA-MSFT avatar image
0 Votes"
PRADEEPCHEEKATLA-MSFT answered PRADEEPCHEEKATLA-MSFT commented

Hello @vishalchitrala-8227,

Thanks for the question and using MS Q&A platform.

All configuration relating to Event Hubs happens in your Event Hubs configuration dictionary. The configuration dictionary must contain an Event Hubs connection string:

 connectionString = "YOUR.CONNECTION.STRING"
    
 ehConf = {}
    
 # For versions before 2.3.15, set the connection string without encryption
 # ehConf['eventhubs.connectionString'] = connectionString
    
 # For 2.3.15 version and above, the configuration dictionary requires that connection string be encrypted.
 ehConf['eventhubs.connectionString'] = sc._jvm.org.apache.spark.eventhubs.EventHubsUtils.encrypt(connectionString)

For more details, refer to Structured Streaming + Event Hubs Integration Guide for PySpark.

Hope this will help. Please let us know if any further queries.


  • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how

  • Want a reminder to come back and check responses? Here is how to subscribe to a notification

  • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @vishalchitrala-8227,

Just checking in to see if the above answer helped. If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

0 Votes 0 ·