Kafka Flow (Producer Consumer arch.)
I'm having a lil issue with registering consumers on Kafka (using kafka flow).
23 Replies
The logic is extremely simple.
The employee MS create an employee, it saves it to its own DB and then it pushes the ID on kafka.
I want the payroll to "listen" on the queue and for now print at screen the IDs.
I'm not sure what the question is I'm afraid
You're right, its because i forgot to post it.
I created this little service
when i create an employee, the payroll service throws brutally
lemme show u
on the left, the employee MS which works fine
on the right, the payroll MS which jus hangs
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
Hosting failed to start
System.ArgumentException: An item with the same key has already been added. Key: 6692eb0d-402a-40cd-ba7b-405e7a104e23
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
How do those two errors relate to each other?
the first one happened because i didnt initialise the consumer properly
The MethodMissingException is normally due to something like running against an older version of a DLL to the one you compiled against
I feel like you've just dropped a few maybe-related things here, and I'm having a hard time stitching everything together, and working out what you're actually doing, and what's going wrong
can i show u what my producers and consumers look like?
yeah my bad
im sorry
Payroll MS (its inside the program.cs file)
EmployeeMS
First one is how i setup my producer
upon create of an employee a message should be pushed to a queue
and that works fine
I'm just not sure about how to get the consumer to work
adding this in the program.cs file (where i have all my aspnet stuff) makes my program crash
with this error right here
lemme send a pic so u can see better
@canton7 Hope this will help, if you want i can also send the repository where all this is at.
ok so the activation isn't needed
the issue then is just this
lol the issue is that i should use a deserializer in the consumer
n i wrote serializer
Ok last issue i swear
Now it works (as in it doesn't crash) but the service doesn't print anything