First, there is an AutofacConsumerFactory that will resolve your consumers from the container. WinTeamApplication.LiveScheduleUpdate((). Integrating with Autofac is easy, there are extension methods in the MassTransit.Autofac package that help out. Var winTeamApplication = scope.Resolve() MassTransit fault handling configuration. When I have been able to see the error queue, I noticed de following error. How to use Autofac Dependency Injection in MassTransit IConsume. The following examples show the various ways that MassTransit can be configured, including the appropriate interfaces necessary. Nested lifetime scopes are used extensively to encapsulate dependencies and ensure clean object lifetime management. LiveScheduleUpdateData.PunchRequest = request ĪzureBus.Publish(liveScheduleUpdateData) Register an IConsumer with dependency in Masstransit using Autofac-C. Autofac is a powerful and fast container, and is well supported by MassTransit. LiveScheduleUpdateData.PunchAction = punchType LiveScheduleUpdateData.LiveSchedule = schedFound LiveScheduleUpdateData.MappingKey = ().MappingKey Var liveScheduleUpdateData = new LiveScheduleUpdateMessage() Using (var scope = container.BeginLifetimeScope()) And what you want, the single lifetime scope from the consumer all the way to sent/received messages is already how it is supposed to behave. Some part of the code where I use the "resolve" is here, although I am not sure if it is related: var container = CreatorContainer.ConfigureContainer() So the change here is that your filter will be resolved within the saga/consumer scope. I had to rewrite much of the code and I have no errors in showing me the visual studio, but at the time of starting the bus I have this problem, which I think is more related to the change of libraries: Well the problem is that for now by system requirements I have to implement masstransit with autofac to use azure bus, what happens is that at first I used version 7.2.1 of masstransit, after that I downgraded to version 5.5.6 of masstransit together with the tofac and azure service bus libraries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |