Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebus.Kafka in .Net core Web API #5

Closed
hotamkushwah opened this issue Jan 29, 2021 · 8 comments
Closed

Rebus.Kafka in .Net core Web API #5

hotamkushwah opened this issue Jan 29, 2021 · 8 comments

Comments

@hotamkushwah
Copy link

I am trying to use Rebus.Kafka in .Net core Web API. I tried to do by register it in startup.cs but it always throw "The transport initialization procedure is still incomplete. There is no confirmation of completion of the subscription to the input queue".

Code is like this :
services.AddRebus(configure => configure
.Transport(t => t.UseKafka("localhost:9092", "MainQueue",producerConfig,consumerConfig))
.Routing(r =>
{
r.TypeBased()
.MapAssemblyOf(MainQueue)
})

@zejji
Copy link

zejji commented Jan 31, 2021

@hotamkushwah - Just to note that I had no problems with Rebus.Kafka up to version 1.4.3, but since then I get the same error as you. It may be worth comparing that version to see if it works; if so, it is presumably a bug in the more recent versions...

@hotamkushwah
Copy link
Author

Just to note that I had no problems with Rebus.Kafka up to version 1.4.3, but since then I get the same error as you. It may be worth comparing that version to see if it works; if so, it is presumably a bug in the more recent versions...

I have checked with version 1.4.3 but still getting same error. I have to use kafka as transport but due to this error not able to do it so now I am exploring the same with mass transit.

@glazkovalex
Copy link
Owner

I am trying to use Rebus.Kafka in .Net core Web API. I tried to do by register it in startup.cs but it always throw "The transport initialization procedure is still incomplete. There is no confirmation of completion of the subscription to the input queue".

Code is like this :
services.AddRebus(configure => configure
.Transport(t => t.UseKafka("localhost:9092", "MainQueue",producerConfig,consumerConfig))
.Routing(r =>
{
r.TypeBased()
.MapAssemblyOf(MainQueue)
})

I will not be able to verify this error for the next 2 weeks.
Try using older versions of the package.

@hotamkushwah
Copy link
Author

I have tried with older version up to 1.4.2 but getting same error.

@zejji
Copy link

zejji commented Feb 3, 2021

@glazkovalex - Just to add that I had no issues with 1.4.3, but later versions have not worked for me.

@hotamkushwah
Copy link
Author

Just to add that I had no issues with 1.4.3, but later versions have not worked for me.
@zejji
Could you please share your startup configuration or your git hub repo link if possible.
Thanks in Advance.

@glazkovalex
Copy link
Owner

glazkovalex commented Feb 19, 2021

I am trying to use Rebus.Kafka in .Net core Web API. I tried to do by register it in startup.cs but it always throw "The transport initialization procedure is still incomplete. There is no confirmation of completion of the subscription to the input queue".

@hotamkushwah, I wrote a test to reproduce your case, but without the WebAPI. I'm sure it doesn't matter in which application the bus is registered, in the console or WebAPI. This test works correctly for me. You can see for yourself. To run the test, you must have Docker Desktop installed.

You probably have something wrong with the infrastructure or with the Apahe Kafka instance. When sending a message, the transport checks whether the consumer's subscription to the queue has already completed initialization. If this subscription is not completed yet and does not complete in 30 seconds, then this exeption is returned. If in your case the consumer subscription takes longer than 30 seconds, then before the first sending to the bus, you can handle this exception, and wait for the end of the subscription of your consumer to the queue in the loop.

Just in case, in the new version 1.5.4 I increase the wait time for initialization to complete to five minutes to make the transport more patient to wait for the consumer's queue subscription to complete. And also added to the recommendations for waiting for the end of the consumer's subscription to the queue in the message of this exception.

@glazkovalex
Copy link
Owner

glazkovalex commented Mar 27, 2021

@hotamkushwah, a similar question was discussed in the next topic Usage of Confluent 1.5.3 causes topic creation issues. There, the problem was in a specific type of images with Apache Kafka, in particular in Strimzi, in which, on the strong recommendation of the community, automatic topics creation is DISABLED by default on the server side. Also, the Confluence.Kafka library, which is used in this Rebus.Kffka transport, since version 1.5.3 does not allow you to use the atomic creation of topics on some images with Apache Kafka, for example, Strimzi.
At the same time, on the image "spotify/kafka", which is used in the test of this transport Rubus.Kafka, the automatic creation of topics works the same way with the old version of Confluence.Kafka. Therefore, I recommend that you either use a different version of the image for the Apache Kafka server, or use old version of the package 1.4.3 Rebus. Kafka with the old version of Confluence. Kafka.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants