Migrating Scala code to dotnet #1129
onkaragarwal
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
HI
I am from dotnet background and new to scala and spark.
We have written some code in scala which process logs from Kafka ,do some modification and re save in Kafka different topic.
I am able to read the data from Kafka and send it back to another topic with minor processing.
I have to do a bit of complex processing in which I have to read the settings from postgres, log the progress in file but when i try to do I get Errors. Following is my code:
As you can see from the above code I am connecting to Kafka reading the data ,trying to process the data using UDF and then sending it back to Kafka.
Currently I am using Read for testing but in real time I will use ReadStream.
When it tries to postgres I get below error:
I need to connect to Postgres because there is some dynamic configuration which I need to fetch and based on that I have to process the Kafka stream.
How do I connect to Postgres to fetch data?
Second Issue is that I tried to use Serilog/Nlog and both of them threw error saying that it is not serailizable. How can I log the progress in UDF in file system.
Any idea can be appreciated?
Project is Console dotnet core 6
Beta Was this translation helpful? Give feedback.
All reactions